result = le_disable(); //change
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("LE_enable failed: [%d]", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
/*TODO: perform if anything more needs to be done to handle failure */
} else {
/* TODO: To be handled */
result = le_disable();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("LE_enable failed: [%d]", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
/*TODO: perform if anything more needs to be done to handle failure */
} else {
/* TODO: To be handled */
if (result != OAL_STATUS_SUCCESS && result != OAL_STATUS_PENDING) {
BT_ERR("LE_enable failed: [%d]", result);
le_disable();
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
/*TODO: perform if anything more needs to be done to handle failure */
} else {
/* TODO: To be handled */
if (result != OAL_STATUS_SUCCESS && result != OAL_STATUS_PENDING) {
BT_ERR("LE_enable failed: [%d]", result);
le_disable();
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
/*TODO: perform if anything more needs to be done to handle failure */
} else {
/* TODO: To be handled */
result = adapter_ble_multi_adv_disable(server_instance);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("OAL API adapter_ble_multi_adv_enable Fail %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/* Update adv handle in table */
if (result != OAL_STATUS_SUCCESS){
BT_ERR("OAL API adapter_ble_set_filter_policy Fail %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/* Set Advertising parameters to Stack */
result = adapter_ble_multi_adv_update(server_instance, params->interval_min, params->interval_max,
params->type, BT_ADV_DEFAULT_CHANNEL_MAP, params->tx_power_level, BT_ADV_DEFAULT_TIMEOUT);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("OAL API adapter_ble_multi_adv_update Fail %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/* Start Advertising when Adv update event is received */
result = adapter_ble_multi_adv_enable(server_instance);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("OAL API adapter_ble_multi_adv_enable Fail %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/* Update adv handle in table */
_bt_update_adv_handle(sender, adv_handle);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("OAL API adapter_ble_multi_adv_disable Fail %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return BLUETOOTH_ERROR_NONE;
}
ret = gattc_set_le_scan_param(params->type, itv, win);
if (OAL_STATUS_SUCCESS != ret) {
BT_ERR("gattc_set_le_scan_param failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
is_le_set_scan_parameter = TRUE;
if (OAL_STATUS_SUCCESS != ret) {
BT_ERR("gattc_register_scan_filter failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
scanner = __bt_find_scanner_from_list(sender);
if (OAL_STATUS_SUCCESS != ret) {
BT_ERR("gattc_start_le_discovery failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
if (OAL_STATUS_SUCCESS != ret) {
BT_ERR("gattc_start_le_discovery failed");
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(ret);
}
// TODO: Disable scan filter
return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
}
- result = adapter_ble_set_privacy(set_privacy);
+ result = adapter_ble_set_privacy(set_privacy);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_set_le_privacy failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
}
return result;
result = adapter_set_white_list((bt_address_t*)device_address, address_type, is_add);
if (result != OAL_STATUS_SUCCESS) {
- if(is_add)
+ if (is_add)
BT_ERR("Add to White List Failed %d", result);
else
BT_ERR("Remove from white list Failed %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return result;
result = adapter_set_manufacturer_data((oal_manufacturer_data_t*)m_data);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("Set manufacturer data Failed %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/*data has been successfully sent to the stack, inititate manufacturer data change event */
manufac_data = g_variant_new_from_data((const GVariantType *)"ay",
return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
}
- result = adapter_set_le_static_random_address(is_enable);
+ result = adapter_set_le_static_random_address(is_enable);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_set_le_static_random_address failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else {
BT_INFO("SetLeStaticRandomAddress as %d", is_enable);
result = BLUETOOTH_ERROR_NONE;
return BLUETOOTH_ERROR_NONE;
} else if (OAL_STATUS_SUCCESS != ret) {
_bt_service_unregister_event_handler_callback(BT_ADAPTER_MODULE);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
result = adapter_recover();
if (result != OAL_STATUS_SUCCESS)
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
__bt_disconnect_all();
int _bt_reset_adapter(void)
{
+ int result;
BT_INFO("+");
- if (OAL_STATUS_SUCCESS != adapter_reset())
- return BLUETOOTH_ERROR_INTERNAL;
+ result = adapter_reset();
+ if (result != OAL_STATUS_SUCCESS)
+ return _bt_convert_oal_status_to_bt_error(result);
/* TODO_40 : 4.0 merge */
/* TODO Currently bt-service is not terminated in tizen next.
{
BT_INFO("+");
gboolean powered = FALSE;
+ int result;
BT_CHECK_PARAMETER(status, return);
*status = BT_ADAPTER_DISABLED;
- if (OAL_STATUS_SUCCESS != adapter_get_powered_status(&powered))
- return BLUETOOTH_ERROR_INTERNAL;
+ result = adapter_get_powered_status(&powered);
+ if (result != OAL_STATUS_SUCCESS)
+ return _bt_convert_oal_status_to_bt_error(result);
else if (powered) {
BT_INFO("Adapter is in Powered Up state");
*status = BT_ADAPTER_ENABLED;
BT_DBG("+");
- result = adapter_get_address();
+ result = adapter_get_address();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_get_address failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
int result;
BT_DBG("+");
- result = adapter_get_version();
+ result = adapter_get_version();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_get_version failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
BT_DBG("+");
- result = adapter_get_name();
+ result = adapter_get_name();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_get_name failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
retv_if(NULL == local_name, BLUETOOTH_ERROR_INVALID_PARAM);
- result = adapter_set_name(local_name);
+ result = adapter_set_name(local_name);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_set_name failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
int _bt_get_energy_info(unsigned int *tx_time, unsigned int *rx_time,
unsigned int *idle_time, unsigned int *energy_used)
{
+ int result;
BT_INFO("+");
BT_CHECK_PARAMETER(tx_time, return);
*idle_time = 0;
*energy_used = 0;
- if (OAL_STATUS_SUCCESS != adapter_get_energy_info(tx_time, rx_time, idle_time, energy_used))
- return BLUETOOTH_ERROR_INTERNAL;
+ result = adapter_get_energy_info(tx_time, rx_time, idle_time, energy_used);
+ if (result != OAL_STATUS_SUCCESS)
+ return _bt_convert_oal_status_to_bt_error(result);
return BLUETOOTH_ERROR_NONE;
}
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("set scan mode failed %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
result = adapter_set_discoverable_timeout(timeout);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_set_discoverable_timeout failed %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
if (discoverable_mode == BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE) {
int result = BLUETOOTH_ERROR_NONE;
BT_DBG("+");
- result = adapter_set_connectable(connectable);
+ result = adapter_set_connectable(connectable);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_set_connectable failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
BT_DBG("+");
- result = adapter_get_connectable();
+ result = adapter_get_connectable();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_get_connectable failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
BT_DBG("+");
- result = adapter_get_service_uuids();
+ result = adapter_get_service_uuids();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_get_service_uuids failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else {
result = BLUETOOTH_ERROR_NONE;
}
int result = BLUETOOTH_ERROR_NONE;
BT_DBG("+");
- result = adapter_get_bonded_devices();
+ result = adapter_get_bonded_devices();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_get_bonded_devices failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
result = adapter_get_profile_connected_devices(profile_uuid);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_get_profile_connected_devices failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else
result = BLUETOOTH_ERROR_NONE;
result = adapter_disable();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("adapter_disable failed: [%d]", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
/*TODO: perform if anything more needs to be done to handle failure */
} else {
/* TODO: To be handled */
if (result != OAL_STATUS_SUCCESS && result != OAL_STATUS_PENDING) {
BT_ERR("adapter_enable failed: [%d]", result);
adapter_disable();
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
/*TODO: perform if anything more needs to be done to handle failure */
} else {
/* TODO: To be handled */
result = adapter_stop_inquiry();
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("Discover stop failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else {
BT_ERR("Stop Discovery Triggered successfully");
__bt_adapter_update_discovery_status(ADAPTER_DISCOVERY_STOPPING);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("Start Discovery failed: %d", result);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
} else {
BT_ERR("Start Discovery Triggered successfully");
__bt_adapter_update_discovery_status(ADAPTER_DISCOVERY_STARTING);
status = a2dp_sink_connect((bt_address_t*)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Connection could not be established, err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = a2dp_sink_disconnect((bt_address_t*)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("DisConnection err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = audio_connect((bt_address_t*)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Connection could not be established, err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = audio_disconnect((bt_address_t*)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("DisConnection err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = avrcp_ct_connect((bt_address_t*)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Connection could not be established, err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = avrcp_ct_disconnect((bt_address_t*)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("DisConnection err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Send pass through command err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Send pass through command err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
oal_type, value);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Set peoperty err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
} else {
BT_ERR("Device is not connected:");
type, value);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Set peoperty err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
} else {
BT_ERR("Device is not connected:");
status = avrcp_ct_get_play_status(&device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Get play status err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
} else {
oal_type = __media_prop_to_oal_type(type);
status = avrcp_ct_get_property(&device_address, oal_type);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Get peoperty err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
}
} else {
status = avrcp_ct_get_media_attribute((bt_address_t*)&device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Get track info err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
} else {
BT_ERR("Device is not connected:");
result = avrcp_set_property(AVRCP_EQUALIZER, value);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("avrcp_set_property failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = avrcp_set_property(AVRCP_REPEAT, value);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("avrcp_set_property failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = avrcp_set_property(AVRCP_SHUFFLE, value);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("avrcp_set_property failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = avrcp_set_property(AVRCP_SCAN, value);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("avrcp_set_property failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = avrcp_set_property(AVRCP_STATUS, value);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("avrcp_set_property failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = avrcp_set_property(AVRCP_POSITION, position);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("avrcp_set_property failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
status = avrcp_tg_connect(&bdaddr);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Connection could not be established, err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
BT_DBG("-");
status = avrcp_tg_disconnect(&bdaddr);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("DisConnection err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
BT_DBG("-");
result = avrcp_set_track_info(&media_attr);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("hid_connect error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = avrcp_tg_set_volume(&bdaddr, volume);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("hid_connect error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return BLUETOOTH_ERROR_NONE;
result = avrcp_tg_get_volume(&bdaddr, volume);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("hid_connect error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return BLUETOOTH_ERROR_NONE;
status = avrcp_enable();
if (OAL_STATUS_SUCCESS != status) {
BT_ERR("Failed to initialize Bluetooth AVRCP Target Profile, status: %d", status);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(status);
}
/* Register AVRCP target event handler */
status = avrcp_disable();
if (OAL_STATUS_SUCCESS != status) {
BT_ERR("Failed to initialize Bluetooth A2DP Source Profile, status: %d", status);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(status);
}
/* Register AVRCP target event handler */
status = audio_enable(NULL, NULL);
if (OAL_STATUS_SUCCESS != status) {
BT_ERR("Failed to initialize Bluetooth A2DP Source Profile, status: %d", status);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(status);
}
/* Register Audio module event handler */
_bt_service_register_event_handler_callback(module, _bt_a2dp_source_event_handler);
status = a2dp_sink_enable(NULL, NULL);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Failed to initialize Bluetooth A2DP Sink Profile, status: %d", status);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(status);
}
/* Register Audio sink module event handler */
_bt_service_register_event_handler_callback(module, _bt_a2dp_sink_event_handler);
status = hf_client_enable();
if (OAL_STATUS_SUCCESS != status) {
BT_ERR("Failed to initialize Bluetooth HFP client Profile, status: %d", status);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(status);
}
/* Register Audio module event handler */
_bt_service_register_event_handler_callback(module, _bt_hf_client_event_handler);
status = hfp_enable(1);
if (OAL_STATUS_SUCCESS != status) {
BT_ERR("Failed to initialize Bluetooth HFP Audio Gateway Profile, status: %d", status);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(status);
}
/* Register Audio module event handler */
_bt_service_register_event_handler_callback(module, _bt_hf_event_handler);
status = avrcp_ct_enable();
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Failed to initialize Bluetooth AVRCP Controller Profile, status: %d", status);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(status);
}
/* Register Avrcp Controller event handler */
_bt_service_register_event_handler_callback(module, _bt_avrcp_ctrl_event_handler);
status = a2dp_sink_disable();
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Failed to Disable Bluetooth A2DP Sink Profile, status: %d", status);
- ret = BLUETOOTH_ERROR_INTERNAL;
+ ret = _bt_convert_oal_status_to_bt_error(status);
goto done;
}
status = avrcp_ct_disable();
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Failed to Disable Bluetooth AVRCP Controller Profile, status: %d", status);
- ret = BLUETOOTH_ERROR_INTERNAL;
+ ret = _bt_convert_oal_status_to_bt_error(status);
goto done;
}
status = audio_disable();
if (OAL_STATUS_SUCCESS != status) {
BT_ERR("Failed to disable Bluetooth A2DP Source Profile, status: %d", status);
- ret = BLUETOOTH_ERROR_INTERNAL;
+ ret = _bt_convert_oal_status_to_bt_error(status);
goto done;
}
result = _bt_audio_disconnect(BT_AUDIO_A2DP, &dev_addr);
if (result != BLUETOOTH_ERROR_NONE) {
BT_ERR("_bt_audio_disconnect(BT_AUDIO_A2DP, %s) Failed", address);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
}
} else {
BT_INFO("No BT_AUDIO_A2DP device is connected, proceed with role switch");
result = _bt_audio_disconnect(BT_AUDIO_A2DP_SOURCE, &dev_addr);
if (result != BLUETOOTH_ERROR_NONE) {
BT_ERR("_bt_audio_disconnect(BT_AUDIO_A2DP_SOURCE, %s) Failed", address);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(result);
}
} else {
BT_INFO("No BT_AUDIO_A2DP_SOURCE device is connected, proceed with role switch");
status = hf_client_connect((bt_address_t *)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("HF Client Connection could not be established, err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = hf_client_disconnect((bt_address_t *)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("HF Client DisConnection err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = hfp_connect((bt_address_t *)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("Connection could not be established, err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
status = hfp_disconnect((bt_address_t *)device_address);
if (status != OAL_STATUS_SUCCESS) {
BT_ERR("DisConnection err: [%d]", status);
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(status);
}
return result;
}
addr[3], addr[4], addr[5]);
}
+int _bt_convert_oal_status_to_bt_error(oal_status_t oal_status)
+{
+ switch (oal_status) {
+ case OAL_STATUS_SUCCESS:
+ return BLUETOOTH_ERROR_NONE;
+ case OAL_STATUS_INVALID_PARAM:
+ return BLUETOOTH_ERROR_INVALID_PARAM;
+ case OAL_STATUS_NOT_SUPPORT:
+ return BLUETOOTH_ERROR_NOT_SUPPORT;
+ case OAL_STATUS_NOT_READY:
+ return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
+ case OAL_STATUS_BUSY:
+ return BLUETOOTH_ERROR_DEVICE_BUSY;
+ case OAL_STATUS_NOT_PAIRED:
+ return BLUETOOTH_ERROR_NOT_PAIRED;
+ case OAL_STATUS_ALREADY_DONE:
+ return BLUETOOTH_ERROR_ALREADY_CONNECT;
+ case OAL_STATUS_PENDING:
+ return BLUETOOTH_ERROR_IN_PROGRESS;
+ case OAL_STATUS_INTERNAL_ERROR:
+ case OAL_STATUS_RMT_DEVICE_DOWN:
+ case OAL_STATUS_AUTH_FAILED:
+ case OAL_STATUS_CONN_TIMEOUT:
+ case OAL_STATUS_HID_FAILED_MOUSE:
+#ifndef TIZEN_BT_HAL
+ case OAL_STATUS_LINK_LOSS:
+#else
+ case OAL_STATUS_LINK_LOSS:
+ case OAL_STATUS_CONN_TERM_LOCAL_HOST:
+ case OAL_STATUS_CONN_TERM_RMT_HOST:
+ case OAL_STATUS_ALREADY_CONNECT:
+#endif
+ default:
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+}
+
gboolean _bt_compare_adddress(const bluetooth_device_address_t *addr1,
const bluetooth_device_address_t *addr2)
{
result = device_set_trust_profile(&bd_addr, oal_profile, trust);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("device_set_trust_profile error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = device_get_trust_profile(&bd_addr, oal_profile, trust);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("device_set_trust_profile error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
}
if (ret != OAL_STATUS_SUCCESS)
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
else
return BLUETOOTH_ERROR_NONE;
}
result = device_query_attributes(&bd_addr);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("device_query_attributes error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return BLUETOOTH_ERROR_NONE;
ret = device_set_alias((bt_address_t *)device_address, (char *)alias);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("device_set_alias: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
/* Update local cache */
sizeof(bluetooth_device_info_t));
__bt_free_bond_info(BT_DEVICE_UNBOND_INFO);
- if (result == OAL_STATUS_NOT_PAIRED)
- return BLUETOOTH_ERROR_NOT_PAIRED;
-
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
int _bt_cancel_bonding(void)
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("_bt_device_handle_passkey_reply: err [%d]", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_INFO("-");
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("Device Service Search Failed..: %d", result);
__bt_free_service_search_info(&service_search_info);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return BLUETOOTH_ERROR_NONE;
}
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("SDP Cancel request failed [%d]", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
__bt_device_handle_pending_requests(BLUETOOTH_ERROR_CANCEL_BY_USER, BT_SEARCH_SERVICE,
ret = device_set_authorized((bt_address_t*)device_address, authorize);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("device_set_authorized: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
res = device_reply_auth_request(&bd_addr, 0, reply, FALSE);
if (res != OAL_STATUS_SUCCESS) {
BT_ERR("authorize_response: %d", res);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(res);
}
BT_DBG("-");
low_threshold, in_range_threshold, high_threshold);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("device_get_connected_link_rssi_strength error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = device_get_connected_link_rssi_strength(&bd_addr, link_type);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("device_get_connected_link_rssi_strength error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
result = device_enable_gap_auth_notifications(OAL_PASSKEY_DISPLAY, enable);
if (OAL_STATUS_SUCCESS != result) {
BT_ERR("device_enable_gap_auth_notifications error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
g_free(passkey_watcher);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("device_get_ida Failed %d", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return result;
if (ret != OAL_STATUS_SUCCESS) {
_bt_remove_le_conn_param_info(address, sender);
BT_DBG("fail to update the LE connection parameter");
- ret = BLUETOOTH_ERROR_INTERNAL;
+ ret = _bt_convert_oal_status_to_bt_error(ret);
goto fail;
}
result = device_disconnect((bt_address_t *)device_address);
if (result != OAL_STATUS_SUCCESS) {
BT_DBG("Failed to disconnect device");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
BT_DBG("-");
int _bt_gatt_init(void)
{
const char *stack_name = NULL;
+ int result;
BT_DBG("+");
- if (OAL_STATUS_SUCCESS != gatt_enable()) {
+ result = gatt_enable();
+ if (result != OAL_STATUS_SUCCESS) {
BT_ERR("gatt Init failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/* Register gatt event handler */
ret = gattc_deregister(client_if);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("DeAllocate GATT Client instance with stack Fail ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
break;
}
ret = gatts_unregister(server_instance);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("DeAllocate server instance with stack Fail ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_INFO("DeAllocated server instance with stack successful..");
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(uuid_string);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_DBG("GATT Server registration call successfully accepted by OAL..wait for Instance Initialized event from OAL..");
/* Return & wait for GATT Server Instance Initialization event */
ret = gatts_add_service(instance_id, &svc_data, num_handles);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
ret = gatts_add_included_services(instance_id, service_handle, included_svc_handle);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
}
param->properties, (int)param->permissions);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
}
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
}
ret = gatts_start_service(instance_id, service_handle, BT_GATT_TRANSPORT_LE);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
}
ret = gatts_stop_service(instance_id, service_handle);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
}
ret = gatts_delete_service(instance_id, service_handle);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
/* Remove the Service Handle */
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
/* Remove GATT server request from list */
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
/* Remove GATT server request from list */
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(address);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
} else {
BT_ERR("ret: %d", ret);
BT_INFO("Indication failed to send to Remote GATT Client [%s]", address);
g_free(address);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_INFO("Indication sent to Remote GATT Client [%s] wait for Notification completed event from OAL", address);
g_free(address);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
ret = gatts_get_att_mtu(conn_info->connection_id, &stack_mtu);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_INFO("ATT MTU received from OAL [%d]", stack_mtu);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(uuid_string);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_DBG("GATT Client registration call successfully accepted by OAL..wait for Instance Initialized event from OAL..");
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("gattc_connect is failed. ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
/* Mark this as outgoing connection */
ret = gattc_search_service(conn_info->connection_id, NULL);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
}
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_INFO("GATT characterstics FD [%d] mtu[%d]", *fd, *mtu);
g_free(addr);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
BT_INFO("GATT characterstics FD [%d] mtu [%d]", *fd, *mtu);
g_free(addr);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
g_free(addr);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
g_free(addr);
return BLUETOOTH_ERROR_NONE;
ret = gattc_deregister(client_id);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("DeAllocate GATT Client instance with stack Fail ret: %d", ret);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
} else {
return BLUETOOTH_ERROR_NONE;
}
ret = gatt_get_data_batching_available_packets(available_packets);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- if (ret == OAL_STATUS_NOT_SUPPORT)
- return BLUETOOTH_ERROR_NOT_SUPPORT;
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- if (ret == OAL_STATUS_INVALID_PARAM)
- return BLUETOOTH_ERROR_INVALID_PARAM;
- else if (ret == OAL_STATUS_NOT_SUPPORT)
- return BLUETOOTH_ERROR_NOT_SUPPORT;
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("ret: %d", ret);
- if (ret == OAL_STATUS_NOT_SUPPORT)
- return BLUETOOTH_ERROR_NOT_SUPPORT;
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
}
return BLUETOOTH_ERROR_NONE;
}
if (OAL_STATUS_SUCCESS != event->status)
- result = BLUETOOTH_ERROR_INTERNAL;
+ result = _bt_convert_oal_status_to_bt_error(event->status);
if (BLUETOOTH_ERROR_NONE == result)
__bt_handle_hid_disconnection(address);
int _bt_hidhost_initialize()
{
+ int result;
BT_DBG("+");
/* Enable HID Profile */
- if (OAL_STATUS_SUCCESS != hid_enable()) {
+ result = hid_enable();
+ if (result != OAL_STATUS_SUCCESS) {
BT_ERR("HID Enable failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/* Register HID event handler */
result = hid_connect(&bd_addr);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("hid_connect error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return BLUETOOTH_ERROR_NONE;
}
result = hid_disconnect(&bd_addr);
if (result != OAL_STATUS_SUCCESS) {
BT_ERR("hid_disconnect error: [%d]", result);
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
return BLUETOOTH_ERROR_NONE;
}
void _bt_convert_addr_type_to_string(char *address,
unsigned char *addr);
+int _bt_convert_oal_status_to_bt_error(oal_status_t oal_status);
+
void _bt_swap_byte_ordering(char *data, int data_len);
int _bt_byte_arr_cmp(const char *data1, const char *data2, int data_len);
int _bt_socket_init(void)
{
+ int result;
BT_INFO("Socket Init");
- if (OAL_STATUS_SUCCESS != socket_enable()) {
+ result = socket_enable();
+ if (result != OAL_STATUS_SUCCESS) {
BT_ERR("Socket init failed");
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(result);
}
/* Register SOCKET event handler */