Languages

Menu
Sites
Language
APP_CONTROL_OPERATION_SETTING_BT_ENABLE not exist anymore

I followed the Bluetooth tutorial but stucked at section "Enabling and Disabling Bluetooth".

The codes are:

   ......
   app_control_set_operation(service, "APP_CONTROL_OPERATION_SETTING_BT_ENABLE");
   ret = app_control_send_launch_request(service, NULL, NULL);

   app_control_destroy(service);
   if (ret == APP_CONTROL_ERROR_NONE) 
   {
      dlog_print(DLOG_INFO, LOG_TAG, "Succeeded to Bluetooth On/Off app!\n");

      return 0;
   } 
   else 
   {
      dlog_print(DLOG_INFO, LOG_TAG, "Failed to relaunch Bluetooth On/Off app!\n");

      return -1;
   }

but I got the value of ret is -17825759, which is APP_CONTROL_ERROR_APP_NOT_FOUND.

And I do not find definition in app_control.h for APP_CONTROL_OPERATION_SETTING_BT_ENABLE, and above codes even use it directly as a string.

Apparently, the implementation has been changed, but the tutorial are not updated.

Who know how to Enabling and Disabling Bluetooth now?

Responses

4 Replies
Jeongsu Kim

I think you can use it like below.

app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING_BT_ENABLE);
Deokhyun Kim

Which version SDK are you using? And mobile or wearable?

In wearable SDK, the app_control for Bluetooth is NOT supported, but it's for only mobile.

I think the defined feature may be missed.

 

Try it with below strings?

app_control_set_operation(service, APP_CONTROL_OPERATION_EDIT);

app_control_set_mime(service, "application/x-bluetooth-on-off");

Leo Liao

Hi Deokhyun,

   I'm using Tizen 2.3.1 mobile.

   As you said, wearable not support the app_control, then how can enable and disable bt on Tizen wearable?

Deokhyun Kim

Hi Leo.

In 2.3.1 mobile SDK, the string, i mentioned above, is right. (APP_CONTROL_OPERATION_EDIT & "application/x-bluetooth-on-off")

 

And in Wearable, there is NO way to enable/disable BT directly.

You can just get the current status of BT by using bt_adapter_get_state()

And even if bluetooth should be enabled, notify it to user through Popup. (e.x. Go to Bluetooth menu in Setting Connectivity & Turn on BT)