comp-manager: Implement DeviceFind method to find mot enabled devices
authorSaurav Babu <saurav.babu@samsung.com>
Fri, 12 Jan 2018 07:21:05 +0000 (12:51 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:40 +0000 (19:38 +0900)
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/companion-manager/src/comp_gdbus.c
src/companion-manager/src/comp_gdbus_group.c
src/companion-manager/src/comp_group.c
src/companion-manager/src/comp_mot_agent.c
src/companion-manager/src/companion_gdbus.xml

index cf14c6777065eb17f5177937ae52b783a70112b0..9b6ced7cd32c1ed98ba577bc1c5aaaac40e9d370 100755 (executable)
@@ -50,7 +50,7 @@ static bool __group_init(GDBusConnection *connection)
                NULL);
 
        g_signal_connect(group_skeleton,
-               "handle-delete",
+               "handle-device-find",
                G_CALLBACK(group_device_find),
                NULL);
 
index ae24d3c877e014db9497f74d9fc66cf72f7a9c26..67ec9c8a3791955b323654e7d0e78388b66c9a4a 100755 (executable)
@@ -71,7 +71,11 @@ gboolean group_delete(Group *group, GDBusMethodInvocation *invocation,
 gboolean group_device_find(Group *group, GDBusMethodInvocation *invocation,
        gpointer user_data)
 {
-       //group_complete_device_find(group, invocation, result);
+       int ret;
+
+       ret = comp_group_find_mot_enabled_devices();
+
+       group_complete_device_find(group, invocation, ret);
 
        return TRUE;
 }
index cc4b9dba406f9072bafe67908fec13ffd0e712c1..a99483981bd207bf2fb3bb014b7b6ca71c2e51bf 100755 (executable)
@@ -195,6 +195,19 @@ void comp_group_notify_group_invite(int result)
        notify_group_device_invite_result(result);
 }
 
+// Find MOT enabled devices
+int comp_group_find_mot_enabled_devices()
+{
+       int ret;
+       LOG_BEGIN();
+
+       ret = agent_find_mot_enable_devices();
+
+       LOG_END();
+
+       return ret;
+}
+
 //Join to device in group (async)
 int comp_group_invite(gchar *uuid, gchar *pin)
 {
index 60b35995a60a61c3731c93c8ae512488ca7f5816..f4d5f237ff4fdbf0a02b565f035d2e550c6842f7 100755 (executable)
@@ -397,11 +397,11 @@ static void _agent_signal_handler(GDBusConnection *connection,
                        while (g_variant_iter_loop(iter_row, "{sv}", &key, &val)) {
                                if (strcasecmp(key, "deviceId") == 0)  {
                                        const char *deviceid = g_variant_get_string(val, &len);
-                                       LOG_DEBUG("deviceId=%s", deviceid);
+                                       LOG_DEBUG("deviceId = %s", deviceid);
                                } else if (strcasecmp(key, "adapter") == 0)  {
                                        int adapter = g_variant_get_uint32(val);
                                        LOG_DEBUG("adapter = %d", adapter);
-                               } else if (strcasecmp(key, "adapter") == 0)  {
+                               } else if (strcasecmp(key, "flags") == 0)  {
                                        int flags = g_variant_get_uint32(val);
                                        LOG_DEBUG("flags = %d", flags);
                                } else if (strcasecmp(key, "port") == 0)  {
index fa6423cb0132034ca1bc1abaf4c8cc874a1b6399..1e5bb3eb765860716ebeb31a554b7995fb8e2886 100755 (executable)
@@ -35,8 +35,6 @@
                        <arg type="i" name="result" direction="out" />
                </method>
                <method name="DeviceFind">
-                       <arg type="i" name="group_count" direction="out" />
-                       <arg type="aa{sv}" name="groups" direction="out" />
                        <arg type="i" name="result" direction="out" />
                </method>
                <method name="DeviceInvite">