if (discoverable_mode == BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE) {
ret = _bt_stop_visibility_timer();
+ if (BLUETOOTH_ERROR_NONE != ret)
+ BT_ERR("_bt_stop_visibility_timer failed");
if (!TIZEN_PROFILE_WEARABLE) {
if (vconf_set_int(BT_FILE_VISIBLE_TIME, -1) != 0)
BT_ERR("Set vconf failed");
}
} else if (discoverable_mode == BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE) {
ret = _bt_start_visibility_timer(timeout);
+ if (BLUETOOTH_ERROR_NONE != ret)
+ BT_ERR("_bt_start_visibility_timer failed");
} else {
ret = _bt_stop_visibility_timer();
+ if (BLUETOOTH_ERROR_NONE != ret)
+ BT_ERR("_bt_stop_visibility_timer failed");
}
BT_DBG("-");
int _bt_init_profiles()
{
int ret;
+ BT_INFO("+");
/*TODO: Init bluetooth profiles */
ret = _bt_hidhost_initialize();
- if (ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE)
BT_ERR("_bt_hidhost_initialize Failed");
- return ret;
- }
ret = _bt_socket_init();
- if (ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE)
BT_ERR("_bt_socket_init Failed");
- return ret;
- }
/*
* Query local adapter services and based on a2dp service uuids initialized
* in bluetooth stack, enable A2DP sourec or A2DP sink role.
*/
ret = adapter_get_service_uuids();
- if (ret != OAL_STATUS_SUCCESS) {
+ if (ret != OAL_STATUS_SUCCESS)
BT_ERR("adapter_get_service_uuids failed: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
- } else {
+ else
a2dp_init_pending = TRUE;
- }
+
/* Initialize HFP Audio Gateway */
ret = _bt_audio_initialize(BT_AG_MODULE);
- if (ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE)
BT_ERR("_bt_audio_initialize(BT_AG_MODULE) Failed");
- return ret;
- }
+
/* Registering callback for receiving audio services searched */
ret = _bt_audio_initialize(BT_AUDIO_ALL_MODULE);
- if (ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE)
BT_ERR("_bt_audio_initialize(BT_AUDIO_ALL_MODULE) Failed");
- return ret;
- }
ret = _bt_hdp_init();
- if (ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE)
BT_ERR("_bt_hdp_init Failed");
- return ret;
- }
ret = _bt_gatt_init();
- if (ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE)
BT_ERR("_bt_gatt_init Failed");
- return ret;
- }
return BLUETOOTH_ERROR_NONE;
}
BT_ERR("vconf_ignore_key_changed failed");
}
+ /* bt-service should be terminated when BT is off */
+ if (!TIZEN_FEATURE_BT_USB_DONGLE) {
+ /* TODO: Implement to check if it is the recovery mode or not */
+ _bt_reliable_terminate_service(NULL);
+ }
+
return FALSE;
}
if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_ON) != 0)
BT_ERR("Set vconf failed\n");
+ if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
+ BT_ERR("Set vconf failed\n");
+
/* TODO:Add timer function to handle any further post processing */
g_idle_add((GSourceFunc)__bt_adapter_post_set_enabled, NULL);
if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
BT_ERR("Set vconf failed");
+ if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
+ BT_ERR("Set vconf failed\n");
+
/* TODO:Add timer function to handle any further post processing */
g_idle_add((GSourceFunc)__bt_adapter_post_set_disabled, NULL);
if (adapter_discovery_state == ADAPTER_DISCOVERY_STARTED ||
adapter_discovery_state == ADAPTER_DISCOVERY_STARTING) {
/*TODO Stop Discovery*/
- if (result != OAL_STATUS_SUCCESS)
- BT_ERR("Discover stop failed: %d", result);
__bt_adapter_update_discovery_status(FALSE);
}
result = adapter_disable();
if (adapter_discovery_state == ADAPTER_DISCOVERY_STARTED ||
adapter_discovery_state == ADAPTER_DISCOVERY_STARTING) {
/*TODO Stop Discovery*/
- if (result != OAL_STATUS_SUCCESS)
- BT_ERR("Discover stop failed: %d", result);
__bt_adapter_update_discovery_status(FALSE);
}
result = adapter_disable();
if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
BT_ERR("Set vconf failed\n");
- _bt_cancel_queued_transfers();
_bt_adapter_set_status(BT_DEACTIVATED);
__bt_adapter_update_discovery_status(ADAPTER_DISCOVERY_STOPPED);