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;
}
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:
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));
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
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));
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);
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)
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));
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);
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));