comp-manager: implement send data API.
authorsaerome.kim <saerome.kim@samsung.com>
Thu, 25 Jan 2018 05:05:58 +0000 (14:05 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:47 +0000 (19:38 +0900)
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
12 files changed:
capi/demo/comp-manager.c
capi/demo/companion_demo.c
capi/include/companion.h
capi/src/companion.c [changed mode: 0755->0644]
capi/src/companion_gdbus.xml
src/companion-manager/CMakeLists.txt
src/companion-manager/include/comp_gdbus_group.h
src/companion-manager/include/comp_group.h [changed mode: 0755->0644]
src/companion-manager/src/comp_gdbus_group.c
src/companion-manager/src/comp_group.c [changed mode: 0755->0644]
src/companion-manager/src/comp_iot.c [changed mode: 0755->0644]
src/companion-manager/src/companion_gdbus.xml

index 930b6ec..68a9766 100644 (file)
@@ -183,7 +183,7 @@ static int run_device_invite(MManager *mm, struct menu_data *menu)
 static int run_devices_show(MManager *mm, struct menu_data *menu)
 {
        char *deviceid = NULL;
-       char *name = NULL;
+       char *ip = NULL;
        char *devicetype = NULL;
        companion_device_h device;
 
@@ -200,17 +200,17 @@ static int run_devices_show(MManager *mm, struct menu_data *menu)
                        break;
                }
                companion_device_information_get_device_id(device, &deviceid);
-               companion_device_information_get_friendly_name(device, &name);
+               companion_device_information_get_ip(device, &ip);
                companion_device_information_get_device_type(device, &devicetype);
-               msgb("[%d] deviceid: %s, name: %s type: %s", i+1, deviceid, name, devicetype);
+               msgb("[%d] deviceid: %s, IP: %s type: %s", i+1, deviceid, ip, devicetype);
 
                if (deviceid) {
                        free(deviceid);
                        deviceid = NULL;
                }
-               if (name) {
-                       free(name);
-                       name = NULL;
+               if (ip) {
+                       free(ip );
+                       ip  = NULL;
                }
                if (devicetype) {
                        free(devicetype);
@@ -260,19 +260,19 @@ static int run_group_get_members(MManager *mm, struct menu_data *menu)
        for (int i = 0; i < count; i++) {
 
                char *device_id = NULL;
-               char *friendly_name = NULL;
+               char *ip = NULL;
                char *device_type = NULL;
 
                companion_device_information_get_device_id(devices[i], &device_id);
-               companion_device_information_get_friendly_name(devices[i], &friendly_name);
+               companion_device_information_get_ip(devices[i], &ip);
                companion_device_information_get_device_type(devices[i], &device_type);
 
-               msgb("device_id : %s, name : %s, type : %s", device_id, friendly_name, device_type);
+               msgb("device_id : %s, name : %s, type : %s", device_id, ip, device_type);
 
                if (device_id)
                        free(device_id);
-               if (friendly_name)
-                       free(friendly_name);
+               if (ip)
+                       free(ip);
                if (device_type)
                        free(device_type);
        }
@@ -383,19 +383,19 @@ int run_device_show_found(MManager *mm, struct menu_data *menu)
 
        for (int i = 0; i < count; i++) {
                char *device_id = NULL;
-               char *friendly_name = NULL;
+               char *ip = NULL;
                char *device_type = NULL;
 
                companion_device_information_get_device_id(devices[i], &device_id);
-               companion_device_information_get_friendly_name(devices[i], &friendly_name);
+               companion_device_information_get_ip(devices[i], &ip);
                companion_device_information_get_device_type(devices[i], &device_type);
 
-               msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, friendly_name, device_type);
+               msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, ip, device_type);
 
                if (device_id)
                        free(device_id);
-               if (friendly_name)
-                       free(friendly_name);
+               if (ip)
+                       free(ip);
                if (device_type)
                        free(device_type);
        }
@@ -411,19 +411,19 @@ void _device_finish_cb(int num_of_devs, void *user_data)
 bool _device_found_cb(companion_device_h device, void *user_data)
 {
        char *device_id = NULL;
-       char *friendly_name = NULL;
+       char *ip = NULL;
        char *device_type = NULL;
 
        companion_device_information_get_device_id(device, &device_id);
-       companion_device_information_get_friendly_name(device, &friendly_name);
+       companion_device_information_get_ip(device, &ip);
        companion_device_information_get_device_type(device, &device_type);
 
-       msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, friendly_name, device_type);
+       msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, ip, device_type);
 
        if (device_id)
                free(device_id);
-       if (friendly_name)
-               free(friendly_name);
+       if (ip)
+               free(ip);
        if (device_type)
                free(device_type);
 
@@ -477,19 +477,19 @@ int run_device_show_my_device(MManager *mm, struct menu_data *menu)
 
        if (ret == 0) {
                char *device_id = NULL;
-               char *friendly_name = NULL;
+               char *ip = NULL;
                char *device_type = NULL;
 
                companion_device_information_get_device_id(device, &device_id);
-               companion_device_information_get_friendly_name(device, &friendly_name);
+               companion_device_information_get_ip(device, &ip);
                companion_device_information_get_device_type(device, &device_type);
 
-               msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, friendly_name, device_type);
+               msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, ip, device_type);
 
                if (device_id)
                        free(device_id);
-               if (friendly_name)
-                       free(friendly_name);
+               if (ip)
+                       free(ip);
                if (device_type)
                        free(device_type);
        }
@@ -500,19 +500,19 @@ int run_device_show_my_device(MManager *mm, struct menu_data *menu)
 bool _device_found_mine_cb(companion_device_h device, void *user_data)
 {
        char *device_id = NULL;
-       char *friendly_name = NULL;
+       char *ip = NULL;
        char *device_type = NULL;
 
        companion_device_information_get_device_id(device, &device_id);
-       companion_device_information_get_friendly_name(device, &friendly_name);
+       companion_device_information_get_ip(device, &ip);
        companion_device_information_get_device_type(device, &device_type);
 
-       msgp("\n[ID] %s [IP] %s [Ver] %s", device_id, friendly_name, device_type);
+       msgp("\n[ID] %s [IP] %s [Ver] %s", device_id, ip, device_type);
 
        if (device_id)
                free(device_id);
-       if (friendly_name)
-               free(friendly_name);
+       if (ip)
+               free(ip);
        if (device_type)
                free(device_type);
 
@@ -787,9 +787,11 @@ static int run_send_data(MManager *mm, struct menu_data *menu)
 {
        int ret = 0;
        int count = 0;
+       char *deviceid = NULL;
+       char *address = NULL;
        companion_device_h device = NULL;
 
-       count = g_list_length(found_device_list);
+       count = g_list_length(my_devices_list);
 
        if (0 >= count ) {
                msgr("No Device");
@@ -797,24 +799,25 @@ static int run_send_data(MManager *mm, struct menu_data *menu)
        }
 
        for (int i = 0; i < count; i++) {
-               device = (companion_device_h)(found_device_list[i].data);
+               device = (companion_device_h)(my_devices_list[i].data);
                if (!device)
                        continue;
-               ret = companion_send_data(device, message, _send_data_finish_cb, NULL);
+
+               companion_device_information_get_device_id(device, &deviceid);
+               companion_device_information_get_ip(device, &address);
+               msgb("Send Data: [ID] %s [IP] %s", deviceid, address);
+               if (deviceid) {
+                       free(deviceid);
+                       deviceid= NULL;
+               }
+               if (address) {
+                       free(address);
+                       address= NULL;
+               }
+
+               ret = companion_send_data(device, message, strlen(message), _send_data_finish_cb, NULL);
                if (COMP_ERROR_NONE != ret) {
-                       char *deviceid = NULL;
-                       char *address = NULL;
-                       companion_device_information_get_device_id(device, &deviceid);
-                       companion_device_information_get_device_id(device, &address);
                        msgr("Failed to Send Data: [ID] %s [IP] %s", deviceid, address);
-                       if (deviceid) {
-                               free(deviceid);
-                               deviceid= NULL;
-                       }
-                       if (address) {
-                               free(address);
-                               address= NULL;
-                       }
                }
        }
        return RET_SUCCESS;
@@ -828,19 +831,19 @@ void _mowned_device_finish_cb(int num_of_devs, void *user_data)
 bool _mowned_device_found_cb(companion_device_h device, void *user_data)
 {
        char *device_id = NULL;
-       char *friendly_name = NULL;
+       char *ip = NULL;
        char *device_type = NULL;
 
        companion_device_information_get_device_id(device, &device_id);
-       companion_device_information_get_friendly_name(device, &friendly_name);
+       companion_device_information_get_ip(device, &ip);
        companion_device_information_get_device_type(device, &device_type);
 
-       msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, friendly_name, device_type);
+       msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, ip, device_type);
 
        if (device_id)
                free(device_id);
-       if (friendly_name)
-               free(friendly_name);
+       if (ip)
+               free(ip);
        if (device_type)
                free(device_type);
 
@@ -888,19 +891,19 @@ int run_device_show_mowned_device(MManager *mm, struct menu_data *menu)
 
        for (int i = 0; i < count; i++) {
                char *device_id = NULL;
-               char *friendly_name = NULL;
+               char *ip = NULL;
                char *device_type = NULL;
 
                companion_device_information_get_device_id(devices[i], &device_id);
-               companion_device_information_get_friendly_name(devices[i], &friendly_name);
+               companion_device_information_get_ip(devices[i], &ip);
                companion_device_information_get_device_type(devices[i], &device_type);
 
-               msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, friendly_name, device_type);
+               msgb("\n[ID] %s [IP] %s [Ver] %s", device_id, ip, device_type);
 
                if (device_id)
                        free(device_id);
-               if (friendly_name)
-                       free(friendly_name);
+               if (ip)
+                       free(ip);
                if (device_type)
                        free(device_type);
        }
index 70ed081..46f43f4 100644 (file)
@@ -187,14 +187,14 @@ int companion_group_get_found_groups_test(void)
 bool _device_found_cb(companion_device_h device, void *user_data)
 {
        char *device_id;
-       char *friendly_name;
+       char *ip;
        char *device_type;
 
        companion_device_information_get_device_id(device, &device_id);
-       companion_device_information_get_friendly_name(device, &friendly_name);
+       companion_device_information_get_ip(device, &ip);
        companion_device_information_get_device_type(device, &device_type);
 
-       TC_PRT("found device device_id : %s, friendly_name : %s, device_type : %s", device_id, friendly_name, device_type);
+       TC_PRT("found device device_id : %s, ip : %s, device_type : %s", device_id, ip, device_type);
 
        found_device_list = g_list_prepend(found_device_list, device);
 }
@@ -246,14 +246,14 @@ int companion_device_get_found_devices_test(void)
 
        for (int i = 0; i < count; i++) {
                char *uuid;
-               char *friendly_name;
+               char *ip;
                char *device_type;
 
                companion_device_information_get_device_id(devices[i], &uuid);
-               companion_device_information_get_friendly_name(devices[i], &friendly_name);
+               companion_device_information_get_ip(devices[i], &ip);
                companion_device_information_get_device_type(devices[i], &device_type);
 
-               TC_PRT("%d. uuid : %s, friendly_name : %s, device_type : %s", i+1, uuid, friendly_name, device_type);
+               TC_PRT("%d. uuid : %s, ip : %s, device_type : %s", i+1, uuid, ip, device_type);
                found_device_list = g_list_prepend(found_device_list, devices[i]);
        }
 
index a6544f6..210bda3 100644 (file)
@@ -107,11 +107,11 @@ int companion_device_information_clone(companion_device_h target,
        companion_device_h source);
 int companion_device_information_destroy(companion_device_h data);
 int companion_device_information_get_device_id(companion_device_h device, char **device_id);
-int companion_device_information_get_friendly_name(companion_device_h device, char **friendly_name);
+int companion_device_information_get_ip(companion_device_h device, char **ip);
 int companion_device_information_get_device_type(companion_device_h device, char **device_type);
 
-int companion_send_data(companion_device_h device, char *data, companion_send_data_finish_cb finish_cb, void *user_data);
-
+int companion_send_data(companion_device_h device, char *data, int len,
+       companion_send_data_finish_cb finish_cb, void *user_data);
 int companion_create_subgroup(companion_group_h group, companion_device_h device, char *subgroup_name);
 int companion_get_subgroups(companion_group_h group, companion_group_h **subgroups, int *count);
 int companion_add_device_to_subgroup(companion_group_h subgroup, companion_device_h device);
old mode 100755 (executable)
new mode 100644 (file)
index ce162e2..06abeab
@@ -44,7 +44,7 @@ typedef struct _companion_group_t
 typedef struct _companion_device_t
 {
        char *device_id;
-       char *friendly_name;
+       char *ip;
        char *device_type;
        int port;
 } companion_device_t;
@@ -106,12 +106,12 @@ static companion_group_t *_create_group_handle(char *uri_path, char *device_id,
        return group;
 }
 
-static companion_device_t *_create_device_handle(char *device_id, char *friendly_name, char *device_type, int port)
+static companion_device_t *_create_device_handle(char *device_id, char *ip, char *device_type, int port)
 {
        companion_device_t *device = g_new0(companion_device_t, 1);
 
        device->device_id = g_strdup(device_id);
-       device->friendly_name = g_strdup(friendly_name);
+       device->ip = g_strdup(ip);
        device->device_type = g_strdup(device_type);
        device->port = port;
 
@@ -175,7 +175,7 @@ static void __device_found_cb(Group *object,
        g_variant_get(va, "aa{sv}", &iter);
        while (g_variant_iter_next(iter, "a{sv}", &iter_row)) {
                char *device_id;
-               char *friendly_name;
+               char *ip;
                char *device_type;
                int port;
 
@@ -183,7 +183,7 @@ static void __device_found_cb(Group *object,
                        if (g_strcmp0(key, "DeviceID") == 0) {
                                device_id = (char *)g_variant_get_string(key_value, NULL);
                        } else if (g_strcmp0(key, "Address") == 0) {
-                               friendly_name = (char *)g_variant_get_string(key_value, NULL);
+                               ip = (char *)g_variant_get_string(key_value, NULL);
                        } else if (g_strcmp0(key, "SecVer") == 0) {
                                device_type = (char *)g_variant_get_string(key_value, NULL);
                        } else if (g_strcmp0(key, "Port") == 0) {
@@ -193,7 +193,7 @@ static void __device_found_cb(Group *object,
                }
                g_variant_iter_free(iter_row);
 
-               device = _create_device_handle(device_id, friendly_name, device_type, port);
+               device = _create_device_handle(device_id, ip, device_type, port);
                if (device_found_cb.found_cb)
                        device_found_cb.found_cb(device, device_found_cb.user_data);
        }
@@ -484,16 +484,28 @@ int companion_device_find_mowned_device(
        return ret;
 }
 
-int companion_send_data(companion_device_h device, char *data, companion_send_data_finish_cb finish_cb, void *user_data)
+int companion_send_data(companion_device_h device, char *data, int len,
+       companion_send_data_finish_cb finish_cb, void *user_data)
 {
-       int ret = 0;
+       int ret = COMP_ERROR_NONE;
+
+       char *buf = NULL;
        GError *error = NULL;
        companion_device_t *dev = (companion_device_t *)device;
 
+       buf = g_malloc0(len + 1);
+       if (NULL == buf)
+               return COMP_ERROR_OUT_OF_MEMORY;
+       memcpy(buf, data, len);
+
        send_data_finish_cb.finish_cb = finish_cb;
        send_data_finish_cb.user_data = user_data;
 
-       group_call_send_data_sync(group_proxy, dev->device_id, dev->friendly_name, dev->port, &ret, NULL, &error);
+       group_call_send_data_sync(group_proxy, dev->device_id, dev->ip, dev->port,
+               buf, len, &ret, NULL, &error);
+
+       free(buf);
+       buf = NULL;
 
        return ret;
 }
@@ -843,8 +855,8 @@ int companion_device_information_clone(companion_device_h target,
        if (src->device_id) {
                dst->device_id = g_strdup(src->device_id);
        }
-       if (src->friendly_name) {
-               dst->friendly_name = g_strdup(src->friendly_name);
+       if (src->ip) {
+               dst->ip = g_strdup(src->ip);
        }
        if (src->device_type) {
                dst->device_type = g_strdup(src->device_type);
@@ -866,9 +878,9 @@ int companion_device_information_destroy(companion_device_h data)
                g_free(device->device_id);
                device->device_id = NULL;
        }
-       if (device->friendly_name) {
-               g_free(device->friendly_name);
-               device->friendly_name = NULL;
+       if (device->ip) {
+               g_free(device->ip);
+               device->ip = NULL;
        }
        if (device->device_type) {
                g_free(device->device_type);
@@ -888,9 +900,9 @@ int companion_device_information_get_device_id(companion_device_h device, char *
        return 0;
 
 }
-int companion_device_information_get_friendly_name(companion_device_h device, char **friendly_name)
+int companion_device_information_get_ip(companion_device_h device, char **ip)
 {
-       *friendly_name = g_strdup(((companion_device_t *)device)->friendly_name);
+       *ip = g_strdup(((companion_device_t *)device)->ip);
 
        return 0;
 
index 4bfcb42..97c0b9f 100644 (file)
                </method>
                <method name="SendData">
                        <arg type="s" name="uuid" direction="in" />
-                       <arg type="s" name="data" direction="in"/>
+                       <arg type="s" name="addr" direction="in"/>
                        <arg type="i" name="port" direction="in"/>
+                       <arg type="s" name="data" direction="in"/>
+                       <arg type="i" name="len" direction="in"/>
                        <arg type="i" name="result" direction="out" />
                </method>
                <method name="FindMownedDevices">
index d3e1723..cb2a284 100644 (file)
@@ -3,6 +3,7 @@ MESSAGE("Building...companion-manager")
 MESSAGE("===================================================================")
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/include/cjson)
 
 FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
 EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
index c6263da..735641c 100644 (file)
@@ -53,7 +53,7 @@ gboolean group_unpair_resource(Group *group, GDBusMethodInvocation *invocation,
        gchar *uuid_dev1, gchar *uuid_dev2, gpointer user_data);
 
 gboolean group_send_data(Group *group, GDBusMethodInvocation *invocation,
-       gchar *uuid_dev, gchar *data, int port, gpointer user_data);
+       gchar *uuid_dev, gchar *addr, int port, gchar *data, int len, gpointer user_data);
 
 gboolean group_find_mowned_devices(Group *group,
        GDBusMethodInvocation *invocation, gpointer user_data);
old mode 100755 (executable)
new mode 100644 (file)
index 04ed250..6b3199a
@@ -80,7 +80,7 @@ int comp_group_pair_resource(char* target1, char *subject1, char *uri1,
        char *uri2, char *rt2, char *interface2, int permission2);
 
 int comp_group_unpair_resource(gchar *uuid_dev1, gchar *uuid_dev2);
-int comp_group_send_data(gchar *uuid_dev, gchar *data, int port);
+int comp_group_send_data(gchar *uuid_dev, gchar *addr, int port, gchar *data, int len);
 
 GVariant *comp_group_get_remote_mot_enabled_devices();
 int comp_group_get_mot_device_count();
index e9f41bb..daf76d7 100644 (file)
@@ -210,13 +210,13 @@ gboolean group_unpair_resource(Group *group, GDBusMethodInvocation *invocation,
 }
 
 gboolean group_send_data(Group *group, GDBusMethodInvocation *invocation,
-       gchar *uuid_dev, gchar *data, int port, gpointer user_data)
+       gchar *uuid_dev, gchar *addr, int port, gchar *data, int len, gpointer user_data)
 {
        int ret = 0;
 
        LOG_DEBUG("send data called using dbus successful");
 
-       ret = comp_group_send_data(uuid_dev, data, port);
+       ret = comp_group_send_data(uuid_dev, addr, port, data, len);
 
        group_complete_send_data(group, invocation, 0);
 
old mode 100755 (executable)
new mode 100644 (file)
index b850111..920dadd
@@ -588,33 +588,33 @@ int comp_group_unpair_resource(gchar *uuid_dev1, gchar *uuid_dev2)
        return ret;
 }
 
-int comp_group_send_data(gchar *uuid_dev, gchar *data, int port)
+int comp_group_send_data(gchar *uuid_dev, gchar *addr, int port, gchar *data, int len)
 {
        int ret;
 
-       data[strlen(data) - 6] = '\0';
-
        LOG_BEGIN();
 
        iot_discovery_t *iot = g_new0(iot_discovery_t, 1);
        iot->uuid = g_strdup(uuid_dev);
-       iot->host = g_strdup_printf("coap://[%s]:%d", data, port);
-       iot->data = g_strdup("Hello");
+       iot->host = g_strdup_printf("coap://[%s]:%d", addr, port);
+       iot->data = g_malloc0(len);
+       if (NULL == iot->data) {
+               ret = COMP_ERROR_OUT_OF_MEMORY;
+               LOG_ERR("Send Data Fail to uuid = %s host %s error=%s",
+                       iot->uuid, iot->host, comp_log_get_error_string(ret));
+               return ret;
+       }
+       memcpy(iot->data, data, len);
 
        LOG_DEBUG("UUID %s host %s", iot->uuid, iot->host);
 
-       ret = comp_iot_discovery_resource(COMP_RESOURCE_TYPE_DATA, 20, iot);
+       ret = comp_iot_discovery_resource(COMP_RESOURCE_TYPE_DATA, 1, iot);
        if (ret != COMP_ERROR_NONE) {
-               LOG_ERR("Failed to discover resource : %s",
-                                comp_log_get_error_string(ret));
+               LOG_ERR("Failed to discover resource : %s", comp_log_get_error_string(ret));
        }
 
        LOG_END();
 
-       return COMP_ERROR_NONE;
-
-       LOG_END();
-
        return ret;
 }
 
@@ -937,12 +937,14 @@ int comp_group_add_device_to_subgroup(char *subgroup_name, char *uuid)
                LOG_ERR("Failed to discover resource : %s",
                                 comp_log_get_error_string(ret));
        }
+
+       return ret;
 }
 
 
 int comp_group_delete_subgroup(char *subgroup_name)
 {
-
+       return COMP_ERROR_NONE;
 }
 
 
old mode 100755 (executable)
new mode 100644 (file)
index c9efc18..1772285
@@ -1,4 +1,8 @@
 #include <tzplatform_config.h>
+#include <iotivity_config.h>
+#include <platform_features.h>
+#include <utlist.h>
+#include <srmutility.h>
 #include <ocprovisioningmanager.h>
 
 #include <comp_iot.h>
@@ -49,9 +53,9 @@ int comp_iot_initialize()
        /*
                "operation" resource
                The operation resource is a control command channel between daemon and daemon.
-          resource type is core.comp.operation
-          Within this function we create a default operation resource. (uri is /comp/operation/1)
-          If we need more control channels, increase the number.
+               resource type is core.comp.operation
+               Within this function we create a default operation resource. (uri is /comp/operation/1)
+               If we need more control channels, increase the number.
                ex) /comp/operation/2, /comp/operation/3
        */
        comp_iot_add_resource(COMP_RESOURCE_TYPE_OPERATION, "1");
@@ -73,7 +77,7 @@ static bool _query_foreach(const char *key, const char *value, void *user_data)
 
        if (strncmp(key, "UUID", 4) == 0) {
                LOG_DEBUG("Insert in %s, UUID : %s", group_name, value);
-               comp_group_add_device_in_group(group_name, value);
+               comp_group_add_device_in_group(group_name, (char *)value);
        }
 
        return IOTCON_FUNC_CONTINUE;
@@ -346,6 +350,8 @@ static bool _found_resource(iotcon_remote_resource_h resource,
                }
 
        }
+
+       return IOTCON_FUNC_CONTINUE;
 }
 
 static gboolean _timeout_cb(gpointer data)
@@ -395,7 +401,7 @@ int comp_iot_discovery_resource(comp_resource_type_e resource_type, int timeout,
 
        LOG_DEBUG("Set Resource Type : %s", get_error_message(ret));
 
-       if (timeout == 20)
+       if (timeout == 1)
                ret = iotcon_find_resource(iot->host,
                        IOTCON_CONNECTIVITY_IP | IOTCON_CONNECTIVITY_PREFER_UDP,
                        query, _found_resource, user_data);
index 4bfcb42..97c0b9f 100644 (file)
                </method>
                <method name="SendData">
                        <arg type="s" name="uuid" direction="in" />
-                       <arg type="s" name="data" direction="in"/>
+                       <arg type="s" name="addr" direction="in"/>
                        <arg type="i" name="port" direction="in"/>
+                       <arg type="s" name="data" direction="in"/>
+                       <arg type="i" name="len" direction="in"/>
                        <arg type="i" name="result" direction="out" />
                </method>
                <method name="FindMownedDevices">