[TBT][tizen_3.0_mobile][d2d publishing issue fixed] 08/89808/1
authornazib.ullah <nazib.ullah@samsung.com>
Tue, 27 Sep 2016 05:54:45 +0000 (11:54 +0600)
committernazib.ullah <nazib.ullah@samsung.com>
Tue, 27 Sep 2016 05:56:07 +0000 (11:56 +0600)
Change-Id: I7e451f7dc4d6a3d4b8b6e891026c62dc1f2d07d7

release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk
tbtcoreapp/src/view/tbt-d2d-view.c

index a17a7b7d2399d7642d5fb58d4934e65d0de1c0be..6fbc0c833b1bc7e6298c23fd5bb0f74773db2ef0 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 22111843b35c1c571cf361cbae46318519a81874..298f9ddb83546aec89a8e22a8bcf61992e250bac 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 04110afb0f50229cf1b1a6045b4d52f10b76d2a4..abf9315689099209f325ce52e4b0ecda0a36d7aa 100644 (file)
@@ -186,40 +186,19 @@ static void start_discovery_cb(void *data, Evas_Object *obj, void *event_info)
        RETM_IF(ret != CONV_ERROR_NONE, "conv_discovery_start failed with error : %s", get_d2d_error(ret));
 }
 
-static int app_control_start(conv_service_h service_handle)
+
+static int app_control_start(conv_service_h service_handle, void* data)
 {
        DBG("app_control_start");
        int ret;
+
+       service_data *s_data = (service_data*) data;
+       s_data->service_handle = service_handle;
+       ret = conv_service_set_listener_cb(service_handle, message_listener, (void*)s_data);
+       DBG("conv_service_set_listener_cb failed with error : %s", get_d2d_error(ret));
        ret = conv_service_start(service_handle, NULL, NULL);
        RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_service_start failed with error : %s", get_d2d_error(ret));
 
-       is_app_control_tested = true;
-       conv_payload_h payload_handle;
-
-       ret = conv_payload_create(&payload_handle);
-       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_create failed with error : %s", get_d2d_error(ret));
-
-       app_control_h app_control = NULL;
-       app_control_create(&app_control);
-       app_control_set_app_id(app_control, "org.tizen.coretbt_uiapp");
-       app_control_set_operation(app_control, APP_CONTROL_OPERATION_MAIN);
-
-       ret = conv_payload_set_app_control(payload_handle, "app_control", app_control);
-       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_set_app_control failed with error : %s", get_d2d_error(ret));
-       ret = conv_payload_set_string(payload_handle, "reply", "0");
-       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_set_string failed with error : %s", get_d2d_error(ret));
-       ret = conv_service_publish(service_handle, NULL, payload_handle);
-       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_service_publish failed with error : %s", get_d2d_error(ret));
-
-       sleep(3);
-
-       ret = conv_service_stop(service_handle, NULL, NULL);
-       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_service_stop failed with error : %s", get_d2d_error(ret));
-
-       printf ("conv_payload_destroy called..\n");
-       ret = conv_payload_destroy(payload_handle);
-       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_destroy failed with error : %s", get_d2d_error(ret));
-
        return 0;
 }
 
@@ -255,7 +234,7 @@ static void service_selected_cb(void *data, Evas_Object *obj, void *event_info)
 
        case CONV_SERVICE_REMOTE_APP_CONTROL :
                DBG("CONV_SERVICE_REMOTE_APP_CONTROL");
-               ret = app_control_start(service_handle);
+               ret = app_control_start(service_handle, s_data);
                RETM_IF(ret != CONV_ERROR_NONE, "app_control_start failed with error : %s", get_d2d_error(ret));
                break;
        case CONV_SERVICE_REMOTE_INTERACTION:
@@ -282,9 +261,9 @@ static void publish_cb(void *data, Evas_Object *obj, void *event_info)
 
        int ret = conv_channel_create(&channel_handle);
        DBG("conv_channel_create : %s", get_d2d_error(ret));
-       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
+       ret = conv_channel_set_string(channel_handle, "uri", "org.tizen.tbtcoreapp");
        DBG("conv_channel_set_string : %s", get_d2d_error(ret));
-       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       ret = conv_channel_set_string(channel_handle, "channel_id", "tbtcoreapp");
        DBG("conv_channel_set_string : %s", get_d2d_error(ret));
        ret = conv_payload_create(&payload_handle);
        DBG("conv_payload_create : %s", get_d2d_error(ret));
@@ -312,8 +291,8 @@ static void read_cb(void *data, Evas_Object *obj, void *event_info)
        conv_payload_h payload_handle;
 
        int ret = conv_channel_create(&channel_handle);
-       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
-       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       ret = conv_channel_set_string(channel_handle, "uri", "org.tizen.tbtcoreapp");
+       ret = conv_channel_set_string(channel_handle, "channel_id", "tbtcoreapp");
        ret = conv_payload_create(&payload_handle);
 
        //To-do: implementation for "Read" API
@@ -334,9 +313,9 @@ static void app_launch_cb(void *data, Evas_Object *obj, void *event_info)
        DBG("conv_channel_create : %s", get_d2d_error(ret));
        ret = conv_channel_create(&channel_handle);
        DBG("conv_channel_create : %s", get_d2d_error(ret));
-       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
+       ret = conv_channel_set_string(channel_handle, "uri", "org.tizen.tbtcoreapp");
        DBG("conv_channel_set_string : %s", get_d2d_error(ret));
-       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       ret = conv_channel_set_string(channel_handle, "channel_id", "tbtcoreapp");
        DBG("conv_channel_set_string : %s", get_d2d_error(ret));
        ret = conv_payload_create(&payload_handle);
        DBG("conv_payload_create : %s", get_d2d_error(ret));
@@ -355,6 +334,7 @@ static void message_listener(conv_service_h handle, conv_channel_h channel, int
        d2d_view* this = (d2d_view*)s_data->view;
        conv_service_h listner_handle = (conv_service_h)s_data->service_handle;
        conv_payload_get_string(result, "result_type", &test);
+       int ret;
 
        DBG("result_type : %s", test);
 
@@ -368,6 +348,41 @@ static void message_listener(conv_service_h handle, conv_channel_h channel, int
                elm_list_go(app_comm_menu_list);
                elm_object_part_content_set(this->view->layout, "list_container", app_comm_menu_list);
        }
+
+
+       if (!strcmp(test, "onStart"))
+       {
+               DBG("==== ON-START ====");
+               is_app_control_tested = true;
+               conv_payload_h payload_handle;
+
+               ret = conv_payload_create(&payload_handle);
+               RETM_IF(ret != CONV_ERROR_NONE, "conv_payload_create failed with error : %s", get_d2d_error(ret));
+
+               app_control_h app_control = NULL;
+               app_control_create(&app_control);
+               app_control_set_app_id(app_control, "org.tizen.coretbt_uiapp");
+               app_control_set_operation(app_control, APP_CONTROL_OPERATION_MAIN);
+
+               ret = conv_payload_set_app_control(payload_handle, "app_control", app_control);
+               RETM_IF(ret != CONV_ERROR_NONE, "conv_payload_set_app_control failed with error : %s", get_d2d_error(ret));
+               ret = conv_payload_set_string(payload_handle, "reply", "0");
+               RETM_IF(ret != CONV_ERROR_NONE, "conv_payload_set_string failed with error : %s", get_d2d_error(ret));
+               ret = conv_service_publish(s_data->service_handle, NULL, payload_handle);
+               RETM_IF(ret != CONV_ERROR_NONE, "conv_service_publish failed with error : %s", get_d2d_error(ret));
+               sleep(3);
+
+               ret = conv_service_stop(s_data->service_handle, NULL, NULL);
+               RETM_IF(ret != CONV_ERROR_NONE, "conv_service_stop failed with error : %s", get_d2d_error(ret));
+
+               DBG("conv_payload_destroy called..\n");
+               ret = conv_payload_destroy(payload_handle);
+               RETM_IF(ret != CONV_ERROR_NONE, "conv_payload_destroy failed with error : %s", get_d2d_error(ret));
+
+       }
+
+       //
+
 }
 
 static int app_communication_menu(conv_service_h service_handle, void* data)
@@ -388,10 +403,10 @@ static int app_communication_menu(conv_service_h service_handle, void* data)
        int ret = conv_channel_create(&channel_handle);
        RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_channel_create failed with error : %s", get_d2d_error(ret));
 
-       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
+       ret = conv_channel_set_string(channel_handle, "uri", "org.tizen.tbtcoreapp");
        RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
 
-       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       ret = conv_channel_set_string(channel_handle, "channel_id", "tbtcoreapp");
        RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
 
        service_data* s_data = (service_data*)malloc(sizeof(service_data));
@@ -506,10 +521,10 @@ static void make_service(d2d_view *this)
     ret = conv_channel_create(&this->channel_handle);
        RETM_IF(ret != CONV_ERROR_NONE, "conv_channel_create failed with error : %s", get_d2d_error(ret));
 
-       ret = conv_channel_set_string(this->channel_handle, "uri", "org.example.d2d_test");
+       ret = conv_channel_set_string(this->channel_handle, "uri", "org.tizen.tbtcoreapp");
        RETM_IF(ret != CONV_ERROR_NONE, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
 
-       ret = conv_channel_set_string(this->channel_handle, "channel_id", "test");
+       ret = conv_channel_set_string(this->channel_handle, "channel_id", "tbtcoreapp");
        RETM_IF(ret != CONV_ERROR_NONE, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
 
        ret = conv_payload_create(&this->payld_handle);
@@ -549,7 +564,7 @@ static void _conv_service_listener_cb(conv_service_h service_handle, conv_channe
                elm_list_item_append(this->client_msg_list, "Client Connected", NULL, NULL, NULL, NULL);
                elm_list_go(this->client_msg_list);
        }
-       else if (!strcmp(test, "onMessage"))
+       if (!strcmp(test, "onMessage"))
        {
                        int ret = conv_payload_get_string(payload, "payload_type", &payload_type);
                        RETM_IF(ret != CONV_ERROR_NONE, "conv_payload_get_string failed with error: %s", get_d2d_error(ret));