BuildRequires: pkgconfig(capi-network-bluetooth)
BuildRequires: pkgconfig(capi-network-wifi-aware)
BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(capi-appfw-app-control)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
#include <gio/gio.h>
#include <dlog.h>
#include <wifi-aware.h>
+#include <app_control.h>
#include "tds-provider-common.h"
#include "tds-provider-log.h"
static gboolean g_aware_enabled;
+static void __tds_aware_start()
+{
+ int ret;
+ app_control_h app_control;
+
+ ret = app_control_create(&app_control);
+ if (ret != APP_CONTROL_ERROR_NONE)
+ TDS_ERR("app_control_create() failed. ret: %d", ret);
+
+ ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
+ if (ret != APP_CONTROL_ERROR_NONE)
+ TDS_ERR("app_control_set_operation() failed. ret: %d", ret);
+
+ ret = app_control_set_app_id(app_control, "org.example.ping-pong");
+ if (ret != APP_CONTROL_ERROR_NONE)
+ TDS_ERR("app_control_set_app_id() failed. ret: %d", ret);
+
+ ret = app_control_send_launch_request(app_control, NULL, NULL);
+ if (ret != APP_CONTROL_ERROR_NONE)
+ TDS_ERR("app_control_send_launch_request() failed. ret: %d", ret);
+
+ ret = app_control_destroy(app_control);
+ if (ret != APP_CONTROL_ERROR_NONE)
+ TDS_ERR("app_control_destroy() failed. ret: %d", ret);
+}
+
static void __aware_enabled(wifi_aware_error_e error, void *user_data)
{
if (error == WIFI_AWARE_ERROR_NONE) {
TDS_INFO("wifi-aware enabled");
g_aware_enabled = TRUE;
+ __tds_aware_start();
}
}