From: nazib.ullah Date: Fri, 23 Dec 2016 05:55:09 +0000 (+0600) Subject: [TBT][tizen_3.0_mobile][d2d discovery results mis-mapping issue fixed] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=210fde0ee7f6dbdbf3e9a1ab79c9d1d777f255df;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][tizen_3.0_mobile][d2d discovery results mis-mapping issue fixed] Change-Id: Ie057c8c2454921c7d046c90c18db0177c27047b3 Signed-off-by: nazib.ullah --- diff --git a/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk b/release/binary-aarch64/org.tizen.tbtcoreapp-1.0.0-aarch64.tpk index acf3b48..2cb2ccd 100644 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 diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index af3ea70..1dcc4ed 100644 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 diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk index 94b58c1..8f0f5a9 100644 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 diff --git a/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk b/release/binary-x86_64/org.tizen.tbtcoreapp-1.0.0-x86_64.tpk index d1f9ee7..e98a310 100644 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 diff --git a/tbtcoreapp/src/view/tbt-d2d-view.c b/tbtcoreapp/src/view/tbt-d2d-view.c index 0374d8d..ce8d361 100644 --- a/tbtcoreapp/src/view/tbt-d2d-view.c +++ b/tbtcoreapp/src/view/tbt-d2d-view.c @@ -32,7 +32,7 @@ #include "utils/ui-utils.h" #include "view/tbt-d2d-view.h" #include "view/tbt-common-view.h" - +#include #include 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);