[TBT][tizen_3.0_mobile][d2d discovery results mis-mapping issue fixed] 92/106792/1
authornazib.ullah <nazib.ullah@samsung.com>
Fri, 23 Dec 2016 05:55:09 +0000 (11:55 +0600)
committernazib.ullah <nazib.ullah@samsung.com>
Fri, 23 Dec 2016 05:55:09 +0000 (11:55 +0600)
Change-Id: Ie057c8c2454921c7d046c90c18db0177c27047b3
Signed-off-by: nazib.ullah <nazib.ullah@samsung.com>
release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk
release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk
tbtcoreapp/src/view/tbt-d2d-view.c

index acf3b482f458432e4edd4dfc9149285403b26402..2cb2ccdd8772348233071af09baa8bae09a53277 100644 (file)
Binary files a/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk and b/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk differ
index af3ea707402bef5ec70e9ce7c4617cf24ab09166..1dcc4ed2963d028e8cc516b6383b103328be0cbb 100644 (file)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index 94b58c122c85e30feea41a8d44e74835abbddcb3..8f0f5a95ac74ca7c8ce9e1b7073d8243b87474bd 100644 (file)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ
index d1f9ee7cedf11ed01a8f88d233f44129172ecf62..e98a3101ba28f667834ed47678e7b460e5b7b223 100644 (file)
Binary files a/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk and b/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk differ
index 0374d8d19e4d6ba518d743b9ad6b2b1cff39edd5..ce8d3610533584b59d919df9acb19e08cd0149ec 100644 (file)
@@ -32,7 +32,7 @@
 #include "utils/ui-utils.h"
 #include "view/tbt-d2d-view.h"
 #include "view/tbt-common-view.h"
-
+#include <json-glib/json-glib.h>
 #include <d2d_conv_manager.h>
 
 struct _d2d_view
@@ -41,9 +41,14 @@ struct _d2d_view
        Evas_Object *server_list;
        Evas_Object *client_msg_list;
        conv_h gl_conv_h;
-       conv_device_h selected_device;
+       GList *devices_list;
 };
 
+typedef struct _device_data{
+       d2d_view *this;
+       conv_device_h selected_device;
+}device_data;
+
 typedef struct _service_data{
        d2d_view *view;
        conv_service_h service_handle;
@@ -164,7 +169,7 @@ static void start_discovery_cb(void *data, Evas_Object *obj, void *event_info)
        int ret = conv_create(&this->gl_conv_h);
        RETM_IF(ret != CONV_ERROR_NONE, "conv_create failed with error : %s", get_d2d_error(ret));
 
-    ret = conv_discovery_start(this->gl_conv_h, 30, discovery_cb, this);/*Timeout 30 seconds*/
+    ret = conv_discovery_start(this->gl_conv_h, 90, discovery_cb, this);/*Timeout 90 seconds*/
        RETM_IF(ret != CONV_ERROR_NONE, "conv_discovery_start failed with error : %s", get_d2d_error(ret));
 }
 
@@ -316,11 +321,15 @@ static void service_foreach_cb(conv_service_h service_handle, void *user_data)
 
 static void device_selected_cb(void *data, Evas_Object *obj, void *event_info)
 {
-       d2d_view* this = (d2d_view*) data;
+       device_data* new_device_data = (device_data*) data;
+       d2d_view* this = new_device_data->this;
+       char* device_name;
+       conv_device_get_property_string(new_device_data->selected_device, CONV_DEVICE_NAME, &device_name);
+       DBG("%s is the device name inside device_selected_cb.", device_name );
 
        elm_list_clear(this->server_list);
        conv_device_h clone_device;
-       int ret = conv_device_clone(this->selected_device, &clone_device);
+       int ret = conv_device_clone(new_device_data->selected_device, &clone_device);
        RETM_IF(ret != CONV_ERROR_NONE, "conv_device_clone failed with error : %s", get_d2d_error(ret));
 
        ret = conv_device_foreach_service(clone_device, service_foreach_cb, this);
@@ -347,11 +356,17 @@ static void discovery_cb(conv_device_h device, int result, void* user_data)
        DBG("conv_device_get_property_string failed with error : %s", get_d2d_error(ret));
        DBG( "device TYPE = %s", value);
 
-       this->selected_device = device;
+//     this->selected_device = device;
+
 
        if( device_name!=NULL)
        {
-               elm_list_item_append(found_device_list, device_name, NULL, NULL, device_selected_cb, this);
+               //FIX_ME
+               device_data *new_device_data = (device_data*) malloc(sizeof(device_data));
+               new_device_data->this = this;
+               new_device_data->selected_device = device;
+               this->devices_list = g_list_append(this->devices_list, (gpointer) new_device_data);
+               elm_list_item_append(found_device_list, device_name, NULL, NULL, device_selected_cb, new_device_data);
                elm_list_go(found_device_list);
                elm_object_part_content_set(this->view->layout, "list_container", found_device_list);
 
@@ -374,7 +389,14 @@ static void _app_destroy_cb(void* this)
        view = (d2d_view*)this;
        RETM_IF(NULL == view, "view is NULL");
 
-       conv_device_destroy(view->selected_device);
+       GList *l;
+       device_data *d;
+       for(l = view->devices_list; l != NULL; l = l->next)
+       {
+               d = (device_data*)l->data;
+               conv_device_destroy(d->selected_device);
+               SAFE_DELETE(d);
+       }
 
        SAFE_DELETE(view->view);
        SAFE_DELETE(view);