#include <oal-adapter-mgr.h>
#include <oal-device-mgr.h>
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
#define MAX_BOND_RETRY_COUNT 3
+#endif
#define BT_PASSKEY_MAX_LENGTH 4
#define BT_LE_CONN_PARAM_DEFAULT_SUPERVISION_TIMEOUT 6000 /* msec */
/* BT device bond state variable */
static bt_bond_state_e bt_device_bond_state;
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
static int bond_retry_count;
+#endif
static char *passkey_watcher;
static GSList *pin_info_list = NULL;
BT_ERR("Unexpected: Info request pending for a different address!!");
return;
} else {
- BT_INFO("Found info request addr [%s]", (char*)req_info->user_data);
+ BT_DBG("Found info request addr [%s]", (char*)req_info->user_data);
bt_sdp_info_t sdp_info;
memset(&sdp_info, 0x00, sizeof(bt_sdp_info_t));
g_array_append_vals(out_param, &sdp_info, sizeof(bt_sdp_info_t));
_bt_service_method_return(req_info->context, out_param, result);
- g_free(req_info->user_data);
_bt_free_info_from_invocation_list(req_info);
g_array_free(out_param, TRUE);
}
BT_ERR("Unexpected: Info request pending for a different address!!");
return;
} else {
- BT_INFO("Found info request addr [%s]", (char*)req_info->user_data);
+ BT_DBG("Found info request addr [%s]", (char*)req_info->user_data);
bluetooth_device_info_t dev_info;
memset(&dev_info, 0x00, sizeof(bluetooth_device_info_t));
_bt_convert_addr_string_to_type(dev_info.device_address.addr,
sizeof(bluetooth_device_info_t));
_bt_service_method_return(req_info->context, out_param, result);
- g_free(req_info->user_data);
_bt_free_info_from_invocation_list(req_info);
g_array_free(out_param, TRUE);
}
BT_ERR("Unexpected: Info request pending for a different address!!");
return;
} else {
- BT_INFO("Found info request addr [%s]", (char*)req_info->user_data);
+ BT_DBG("Found info request addr [%s]", (char*)req_info->user_data);
bluetooth_device_address_t dev_addr;
_bt_convert_addr_string_to_type(dev_addr.addr, address);
out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
sizeof(bluetooth_device_address_t));
_bt_service_method_return(req_info->context, out_param, result);
- g_free(req_info->user_data);
_bt_free_info_from_invocation_list(req_info);
g_array_free(out_param, TRUE);
}
break;
}
}
- BT_INFO("-");
+ BT_DBG("-");
}
/*
{
bt_remote_dev_info_t *rem_info = NULL;
- BT_DBG("+");
rem_info = g_malloc0(sizeof(bt_remote_dev_info_t));
_bt_copy_remote_dev(rem_info, &(oal_dev_props->device_info));
/* a. Check if bonding is on-going, if yes, we MUST update the bonding device properties */
if (trigger_bond_info && !strcmp(trigger_bond_info->addr, rem_info->address)) {
- BT_INFO("Bonding is ongoing, try update properties");
+ BT_DBG("Bonding is ongoing, try update properties");
if (!trigger_bond_info->dev_info ||
(!trigger_bond_info->dev_info->name &&
!trigger_bond_info->dev_info->alias) ||
!trigger_bond_info->dev_info->address ||
trigger_bond_info->dev_info->uuid_count == 0) {
- BT_INFO("Complete data is not present, Assigning rem_info");
+ BT_DBG("Complete data is not present, Assigning rem_info");
if (!trigger_bond_info->dev_info)
trigger_bond_info->dev_info = g_malloc0(sizeof(bt_remote_dev_info_t));
_bt_copy_remote_dev_info(trigger_bond_info->dev_info, rem_info);
BT_DBG("Bonding dev addr has matched with remote dev properties address [%s]", rem_info->address);
__bt_handle_ongoing_bond(trigger_bond_info->dev_info, FALSE);
} else if (incoming_bond_info && !g_strcmp0(incoming_bond_info->addr, rem_info->address)) {
- BT_INFO("Incoming Bond is ongoing, try update properties");
+ BT_DBG("Incoming Bond is ongoing, try update properties");
if (!incoming_bond_info->dev_info ||
(!incoming_bond_info->dev_info->name &&
!incoming_bond_info->dev_info->alias) ||
!incoming_bond_info->dev_info->address ||
incoming_bond_info->dev_info->uuid_count == 0) {
- BT_INFO("Complete data is not present, Assigning rem_info");
+ BT_DBG("Complete data is not present, Assigning rem_info");
if (!incoming_bond_info->dev_info)
incoming_bond_info->dev_info = g_malloc0(sizeof(bt_remote_dev_info_t));
_bt_copy_remote_dev_info(incoming_bond_info->dev_info, rem_info);
}
_bt_free_remote_dev(rem_info);
- BT_DBG("-");
}
static int __get_oal_trusted_profile(bluetooth_trusted_profile_t profile)
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("-");
_bt_convert_addr_type_to_string(address, auth_event->address.addr);
- BT_INFO("service_d: %d", service_d);
+ BT_DBG("service_d: %d", service_d);
switch (service_d) {
case HID_SERVICE_ID:
- BT_INFO("Incoming HID Profile conn Req from device addr [%s]", address);
+ BT_DBG("Incoming HID Profile conn Req from device addr [%s]", address);
break;
case A2DP_SERVICE_ID:
- BT_INFO("Incoming A2DP(Remote Sink) profile conn Req from device addr [%s]", address);
+ BT_DBG("Incoming A2DP(Remote Sink) profile conn Req from device addr [%s]", address);
_bt_a2dp_src_handle_incoming_authorization(address, service_d);
return;
case A2DP_SRC_SERVICE_ID:
- BT_INFO("Incoming A2DP(Remote Source) Profile conn Req from device addr [%s]", address);
+ BT_DBG("Incoming A2DP(Remote Source) Profile conn Req from device addr [%s]", address);
_bt_a2dp_sink_handle_incoming_authorization(address, service_d);
break;
case AVRCP_SERVICE_ID:
- BT_INFO("Incoming AVRCP (Remote) Profile conn Req from device addr [%s]", address);
+ BT_DBG("Incoming AVRCP (Remote) Profile conn Req from device addr [%s]", address);
break;
case AVRCP_CT_SERVICE_ID:
- BT_INFO("Incoming AVRCP (Controller) Profile conn Req from device addr [%s]", address);
+ BT_DBG("Incoming AVRCP (Controller) Profile conn Req from device addr [%s]", address);
break;
#ifdef TIZEN_FEATURE_BT_OBEX
case OPP_SERVICE_ID: {
name = g_strdup(address);
- BT_INFO("Incoming OPP conn Req from device addr [%s]", address);
+ BT_DBG("Incoming OPP conn Req from device addr [%s]", address);
_bt_obex_server_set_pending_conn_auth_device_addr(address);
param = g_variant_new("(iss)", BLUETOOTH_ERROR_NONE, address, name);
_bt_send_event(BT_OPP_SERVER_EVENT,
}
#endif
case HSP_SERVICE_ID:
- BT_INFO("Incoming HSP_SERVICE_ID conn Req from device addr [%s]", address);
+ BT_DBG("Incoming HSP_SERVICE_ID conn Req from device addr [%s]", address);
break;
case HFP_SERVICE_ID:
- BT_INFO("Incoming HFP_SERVICE_ID conn Req from device addr [%s]", address);
+ BT_DBG("Incoming HFP_SERVICE_ID conn Req from device addr [%s]", address);
break;
case SAP_SERVICE_ID:
- BT_INFO("Incoming SAP_SERVICE_ID conn Req from device addr [%s]", address);
+ BT_DBG("Incoming SAP_SERVICE_ID conn Req from device addr [%s]", address);
break;
case HSP_HS_SERVICE_ID:
- BT_INFO("Incoming HSP_HS_SERVICE_ID conn Req from device addr [%s]", address);
+ BT_DBG("Incoming HSP_HS_SERVICE_ID conn Req from device addr [%s]", address);
break;
case HFP_HS_SERVICE_ID:
- BT_INFO("Incoming HFP_HS_SERVICE_ID conn Req from device addr [%s]", address);
+ BT_DBG("Incoming HFP_HS_SERVICE_ID conn Req from device addr [%s]", address);
break;
#ifdef TIZEN_BT_HAL
case IOTIVITY_SERVICE_ID:
- BT_INFO("Incoming IOTIVITY_SERVICE_ID conn Req from device addr [%s]", address);
+ BT_DBG("Incoming IOTIVITY_SERVICE_ID conn Req from device addr [%s]", address);
break;
#endif
default:
/* For now, reject authorization for any service apart from above switch cases */
- BT_INFO("Incoming Profile conn req with service ID [%d] from device addr [%s]", service_d, address);
+ BT_DBG("Incoming Profile conn req with service ID [%d] from device addr [%s]", service_d, address);
res = device_reply_auth_request((bt_address_t*)&auth_event->address, service_d, FALSE, FALSE);
if (res != OAL_STATUS_SUCCESS)
BT_ERR("authorize_response: %d", res);
res = device_reply_auth_request((bt_address_t*)&auth_event->address, service_d, TRUE, FALSE);
if (res != OAL_STATUS_SUCCESS)
BT_ERR("authorize_response: %d", res);
- BT_INFO("-");
}
static void __bt_handle_ongoing_bond(bt_remote_dev_info_t *remote_dev_info, gboolean incoming_bond)
BLUETOOTH_EVENT_BONDING_FINISHED,
param);
BT_PERMANENT_LOG("Paired %s", remote_dev_info->address + 12);
- BT_INFO_C("### Paired %s", remote_dev_info->address);
+ BT_INFO_C("### Paired %s", remote_dev_info->address + 12);
if (incoming_bond) {
__bt_free_bond_info(BT_DEVICE_INCOMING_BOND_INFO);
} else {
return;
}
- BT_INFO("Bonding successfully completed");
/* Bonding state will be cleaned up & BONDING FINISHED EVENT
will be sent only when Properties are fetched from stack
Till that time lets not free trigger_bond_info.
trigger_bond_info->addr);
if (_bt_device_get_bonded_device_info(&dev_addr) == BLUETOOTH_ERROR_NONE) {
- BT_DBG("BOnded device info query posted to stack successfully");
+ BT_DBG("Bonded device info query posted to stack successfully");
__bt_device_handle_pending_requests(BLUETOOTH_ERROR_NONE, BT_BOND_DEVICE,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
} else {
{
char address[BT_ADDRESS_STRING_SIZE];
- BT_INFO("+");
-
_bt_convert_addr_type_to_string(address, bd_addr->addr);
_bt_service_remove_device_from_bonded_list(address);
if (trigger_unbond_info) {
- BT_INFO("Bond removal request successfully handled, return DBUS and send event");
+ BT_DBG("Bond removal request successfully handled, return DBUS and send event");
GVariant *param = NULL;
__bt_device_handle_pending_requests(BLUETOOTH_ERROR_NONE, BT_UNBOND_DEVICE,
trigger_unbond_info->addr, BT_ADDRESS_STRING_SIZE);
BT_ERR("Bonding was removed");
__bt_device_handle_bond_state();
}
- BT_INFO("-");
}
static void __bt_device_handle_bond_failed_event(event_dev_bond_failed_t* bond_fail_event)
case OAL_STATUS_RMT_DEVICE_DOWN:
{
if (trigger_bond_info) {
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
BT_INFO("OAL_STATUS_RMT_DEVICE_DOWN:Lets retry bonding!! retry count [%d]",
bond_retry_count);
int ret = OAL_STATUS_SUCCESS;
} else
bond_retry_count++;
} else {
+#endif
BT_ERR("Create Bond failed MAX_BOND_RETRY_COUNT TIMES!!");
__bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
__bt_free_pairing_info(&trigger_pairing_info);
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
bond_retry_count = 0;
}
+#endif
}
break;
}
__bt_free_pairing_info(&trigger_pairing_info);
break;
}
+ case OAL_STATUS_ALREADY_CONNECT:
+ {
+ int result = BLUETOOTH_ERROR_ALREADY_CONNECT;
+ BT_INFO("OAL_STATUS_ALREADY_CONNECT");
+
+ if (trigger_bond_info) {
+ __bt_device_handle_pending_requests(result, BT_BOND_DEVICE,
+ trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
+ __bt_free_bond_info(BT_DEVICE_BOND_INFO);
+ }
+ break;
+ }
case OAL_STATUS_INTERNAL_ERROR:
{
BT_INFO("OAL_STATUS_INTERNAL_ERROR");
break;
}
case OAL_EVENT_DEVICE_ACL_CONNECTED: {
- BT_INFO("ACL Connected event Received");
- event_dev_conn_status_t* param = event_data;
- __bt_device_acl_state_changed_callback(param, TRUE, 0);
+ BT_DBG("ACL Connected event Received");
+ __bt_device_acl_state_changed_callback((event_dev_conn_status_t *)event_data, TRUE, 0);
break;
}
case OAL_EVENT_DEVICE_ACL_DISCONNECTED: {
- BT_INFO("ACL Disconnected event Received");
+ BT_DBG("ACL Disconnected event Received");
__bt_device_acl_state_changed_callback((event_dev_conn_status_t *)event_data, FALSE, 0);
break;
}
case OAL_EVENT_DEVICE_LE_CONNECTED: {
- BT_INFO("LE Connected event Received");
- event_dev_conn_status_t* param = event_data;
- __bt_device_acl_state_changed_callback(param, TRUE, 1);
+ BT_DBG("LE Connected event Received");
+ __bt_device_acl_state_changed_callback((event_dev_conn_status_t *)event_data, TRUE, 1);
break;
}
case OAL_EVENT_DEVICE_LE_DISCONNECTED: {
- BT_INFO("LE Disconnected event Received");
+ BT_DBG("LE Disconnected event Received");
__bt_device_acl_state_changed_callback((event_dev_conn_status_t *)event_data, FALSE, 1);
break;
}
BT_DBG("-");
}
-static int __bt_oal_status_to_bt_error(int oal_status)
-{
- int ret = 0;
-
- switch (oal_status) {
- case OAL_STATUS_SUCCESS:
- ret = BLUETOOTH_ERROR_NONE;
- break;
- case OAL_STATUS_CONN_TIMEOUT:
- case OAL_STATUS_LINK_LOSS:
- BT_INFO("Connection Timeout");
- ret = BLUETOOTH_ERROR_CONNECTION_TIMEOUT;
- break;
-#ifdef TIZEN_BT_HAL
- case OAL_STATUS_CONN_TERM_LOCAL_HOST:
- ret = BLUETOOTH_ERROR_LOCAL_HOST_TERM;
- break;
- case OAL_STATUS_CONN_TERM_RMT_HOST:
- ret = BLUETOOTH_ERROR_REMOTE_USER_TERM;
- break;
-#endif
- case OAL_STATUS_INTERNAL_ERROR:
- ret = BLUETOOTH_ERROR_INTERNAL;
- break;
- default:
- ret = BLUETOOTH_ERROR_INTERNAL;
- break;
- }
- return ret;
-}
-
static void __bt_device_acl_state_changed_callback(event_dev_conn_status_t *acl_event,
gboolean connected, unsigned char type)
{
gchar address[BT_ADDRESS_STR_LEN];
- int result = BLUETOOTH_ERROR_NONE;
+ int disc_reason = 0;
GVariant *param = NULL;
bt_device_conn_info_t conn_info;
_bt_logging_connection(connected, type);
- result = __bt_oal_status_to_bt_error(acl_event->status);
- BT_DBG("Result [0x%x]", result);
+ disc_reason = acl_event->status;
if (connected) {
- param = g_variant_new("(isy)", result, address, type);
+ BT_PERMANENT_LOG("Connected %s %s", !type ? "EDR" : "LE", address + 12);
+ param = g_variant_new("(isy)", BLUETOOTH_ERROR_NONE, address, type);
_bt_send_event(BT_DEVICE_EVENT,
BLUETOOTH_EVENT_DEVICE_CONNECTED,
param);
} else {
- param = g_variant_new("(isyi)", result, address, type, dbfw_rssi);
+ BT_PERMANENT_LOG("Disconnected %s(%d) %s", !type ? "EDR" : "LE", disc_reason, address + 12);
+ param = g_variant_new("(isyi)", disc_reason, address, type, dbfw_rssi);
_bt_send_event(BT_DEVICE_EVENT,
BLUETOOTH_EVENT_DEVICE_DISCONNECTED,
param);
}
- BT_PERMANENT_LOG("%sonnected %s %s",
- connected ? "C" : "Disc", !type ? "EDR" : "LE", address + 12);
conn_info.connected = connected;
conn_info.type = type;
static int __bt_device_handle_bond_state(void)
{
- BT_INFO("Current Bond state: %d", bt_device_bond_state);
+ BT_DBG("Current Bond state: %d", bt_device_bond_state);
int ret = OAL_STATUS_INTERNAL_ERROR;
switch (bt_device_bond_state) {
}
if (ret != OAL_STATUS_SUCCESS)
- return BLUETOOTH_ERROR_INTERNAL;
+ return _bt_convert_oal_status_to_bt_error(ret);
else
return BLUETOOTH_ERROR_NONE;
}
int result;
bt_address_t bd_addr;
- BT_DBG("+");
-
retv_if(!addr, BLUETOOTH_ERROR_INVALID_PARAM);
memcpy(bd_addr.addr, addr, BLUETOOTH_ADDRESS_LENGTH);
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);
}
- BT_DBG("-");
return BLUETOOTH_ERROR_NONE;
}
int ret;
char address[BT_ADDRESS_STRING_SIZE];
- BT_DBG("+");
BT_CHECK_PARAMETER(alias, return);
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 */
_bt_convert_addr_type_to_string(address, device_address->addr);
_bt_update_remote_dev_property(address, DEV_PROP_ALIAS, (void *)alias);
- BT_DBG("-");
return BLUETOOTH_ERROR_NONE;
}
char address[BT_ADDRESS_STRING_SIZE] = { 0 };
bluetooth_device_info_t dev_info;
const char *stack_name = NULL;
- BT_DBG("+");
retv_if(device_address == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
bt_device_bond_state = BT_DEVICE_BOND_STATE_REMOVE_BONDING;
}
+#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IOT)
bond_retry_count = 0;
+#endif
result = __bt_device_handle_bond_state();
if (result != BLUETOOTH_ERROR_NONE)
goto fail;
- BT_DBG("-");
return result;
fail:
sizeof(bluetooth_device_info_t));
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
- BT_DBG("-");
return result;
}
int result = OAL_STATUS_SUCCESS;
char address[BT_ADDRESS_STRING_SIZE] = { 0 };
bluetooth_device_info_t dev_info;
- BT_INFO("+");
retv_if(device_address == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
if (result != OAL_STATUS_SUCCESS)
goto fail;
- return result;
+ return BLUETOOTH_ERROR_NONE;
fail:
memset(&dev_info, 0x00, sizeof(bluetooth_device_info_t));
sizeof(bluetooth_device_info_t));
__bt_free_bond_info(BT_DEVICE_UNBOND_INFO);
- return result;
+ 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;
case BT_PROFILE_CONN_HSP:
svc_id = HFP_HS_SERVICE_ID; /* Remote is HFP HF Unit */
break;
+ case BT_PROFILE_CONN_HFG:
+ svc_id = HFP_SERVICE_ID; /* Remote is HFP AG Unit */
+ break;
#ifdef TIZEN_GATT_CLIENT
case BT_PROFILE_CONN_GATT:
return _bt_is_remote_gatt_device_connected(device_address); /* Remote is GATT client or Server */
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;
bt_le_conn_param_t *param = NULL;
bt_le_conn_param_t *data = NULL;
- BT_DBG("+");
-
if (!address || !sender)
return BLUETOOTH_ERROR_INVALID_PARAM;
max = interval_max / BT_LE_CONN_INTERVAL_SPLIT;
to = time_out / BT_LE_CONN_TO_SPLIT;
- BT_INFO("updating: Min interval: %d, Max interval: %d, Latency: %d, Supervision timeout: %d",
+ BT_DBG("updating: Min interval: %d, Max interval: %d, Latency: %d, Supervision timeout: %d",
min, max, latency, to);
_bt_convert_addr_string_to_type(dev_addr.addr, address);
BT_CHECK_PARAMETER(device_address, return);
- BT_INFO("Sender %s, Min interval: %f, Max interval: %f, Latency: %u, Supervision timeout: %u",
+ BT_DBG("Sender %s, Min interval: %f, Max interval: %f, Latency: %u, Supervision timeout: %u",
sender, interval_min, interval_max, latency, time_out);
if (interval_min > interval_max ||
dev = __bt_get_le_connected_dev_info(address);
if (dev == NULL) {
- BT_DBG("device not found in the list");
+ BT_ERR("device not found in the list");
ret = BLUETOOTH_ERROR_NOT_CONNECTED;
goto fail;
}
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;
}
- BT_DBG("updated LE connection parameter");
dev->interval_min = interval_min;
dev->interval_max = interval_max;
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("-");
return FALSE;
}
- BT_DBG("Buffer = %s\n", buffer);
-
lines = g_strsplit_set(buffer, BT_AGENT_NEW_LINE, 0);
g_free(buffer);