}
#endif
+static const char *__convert_audio_type_to_string(bt_audio_type_t type)
+{
+ switch (type) {
+ case BT_AUDIO_HSP:
+ return "AUDIO_HSP";
+ case BT_AUDIO_A2DP:
+ return "AUDIO_A2DP";
+ case BT_AUDIO_ALL:
+ return "AUDIO_ALL";
+ case BT_AVRCP_TARGET:
+ return "AVRCP_TARGET";
+ case BT_AVRCP:
+ return "AVRCP";
+ case BT_AUDIO_A2DP_SOURCE:
+ return "A2DP_SOURCE";
+ case BT_AUDIO_HFP_SOURCE:
+ return "HFP_SOURCE";
+ case BT_AUDIO_AG:
+ return "AUDIO_AG";
+ default:
+ return "Invalid";
+ }
+}
+
void _bt_set_audio_wait_data_flag(gboolean flag)
{
BT_DBG("_bt_set_audio_wait_data_flag \n");
#endif
/* Check if any other headset is connected */
- GList *node = NULL;;
+ GList *node = NULL;
- BT_INFO("Checking if any Headset connected or not: current device [%s] current dev type [%d]", address, current_conn_type);
+ BT_INFO("Checking if any Headset connected or not: current device [%s] current audio type [%s]",
+ address, __convert_audio_type_to_string(current_conn_type));
node = g_list_first(g_connected_list);
while (node != NULL) {
connected_device = node->data;
- BT_INFO(" A Device is already connected found in list [%s] conn type [%d]",
- connected_device->device_address, connected_device->type);
+ BT_INFO("A Device is already connected found in list [%s] audio type [%s]",
+ connected_device->device_address, __convert_audio_type_to_string(connected_device->type));
if ((connected_device->type & current_conn_type)) {
g_strlcpy(connected_address, connected_device->device_address,
BT_ADDRESS_STRING_SIZE + 1);
#ifdef TIZEN_SUPPORT_DUAL_HF
is_companion_device = __bt_is_companion_device(connected_address);
- BT_INFO(" is_companion_device[%d]", is_companion_device);
+ BT_INFO("is_companion_device[%d]", is_companion_device);
if (!is_companion_device) {
connected = TRUE;
}
if (!connected) {
- BT_INFO("There is no connected device with connection type [%d]", current_conn_type);
+ BT_INFO("There is no connected device with connection type [%s]",
+ __convert_audio_type_to_string(current_conn_type));
return BLUETOOTH_ERROR_NOT_CONNECTED;
}
/* Convert BD address from string type */
_bt_convert_addr_string_to_type(device_address.addr, connected_address);
int value = BLUETOOTH_ERROR_NONE;
- BT_DBG("Already connected headset addr [%s] connected headset type [0x%x] current dev conn type [0x%x]",
- connected_address, connected_device->type, current_conn_type);
+ BT_DBG("Already headset connected. addr [%s] connected type [%s] current audio type [%s]",
+ connected_address, __convert_audio_type_to_string(connected_device->type),
+ __convert_audio_type_to_string(current_conn_type));
disconn_type = connected_device->type & current_conn_type;
- BT_DBG("Attempt disconnection of Type [0x%x] of already connected device" , disconn_type);
+ BT_DBG("Attempt disconnection of Type [%s] of already connected device",
+ __convert_audio_type_to_string(disconn_type));
value = _bt_audio_disconnect(disconn_type, &device_address);
/* If already one device is waiting, remove current waiting device and add new */
//_bt_headset_set_local_connection(TRUE);
/* Add data to the connected list */
_bt_add_headset_to_list(type, BT_STATE_CONNECTING, addr);
- BT_PERMANENT_LOG("Connect %d", type);
+ BT_PERMANENT_LOG("Connect %s", __convert_audio_type_to_string(type));
} else {
- BT_ERR("Profile [%d] connect failed!!", type);
+ BT_ERR("Profile [%s] connect failed!!", __convert_audio_type_to_string(type));
}
BT_INFO("-");
return result;
bt_connected_headset_data_t *connected_device = node->data;
if (g_strcmp0(connected_device->device_address, addr) == 0) {
- BT_DBG("Connection type update");
+ BT_DBG("Connection type update. old type[%s] -> new type[%s]",
+ __convert_audio_type_to_string(connected_device->type),
+ __convert_audio_type_to_string(type));
type = connected_device->type;
break;
}
/* Update device status in connected list */
_bt_add_headset_to_list(type, BT_STATE_DISCONNECTING, addr);
- BT_PERMANENT_LOG("Disconnect %d", type);
+ BT_PERMANENT_LOG("Disconnect %s", __convert_audio_type_to_string(type));
} else {
- BT_ERR("Profile [%d] connect failed!!", type);
+ BT_ERR("Profile [%s] disconnect failed!!", __convert_audio_type_to_string(type));
}
BT_INFO("-");
return result;
BT_INFO("+");
if (_bt_is_service_connected(address, type)) {
- BT_INFO("Service [%d] is connected with device [%s], disconnect it...", type, address);
+ BT_INFO("Service [%s] is connected with device [%s], disconnect it...",
+ __convert_audio_type_to_string(type), address);
_bt_convert_addr_string_to_type(device_address.addr, address);
ret = __bt_process_audio_profile_disconnect(type, &device_address);
if (ret != BLUETOOTH_ERROR_NONE)
- BT_ERR("Disconnecting service [%d] with device [%s] failed!!", type, address);
+ BT_ERR("Disconnecting service [%s] with device [%s] failed!!",
+ __convert_audio_type_to_string(type), address);
} else {
- BT_INFO("Service [%d] is Not connected with device [%s],..", type, address);
+ BT_INFO("Service [%s] is Not connected with device [%s],..",
+ __convert_audio_type_to_string(type), address);
}
BT_INFO("-");
}
goto fail;
}
- BT_PERMANENT_LOG("Connect %d", info->type);
+ BT_PERMANENT_LOG("Connect %s", __convert_audio_type_to_string(info->type));
/* If multiple profiles are supported, queue pending connection info */
if ((info->is_hfp_supported && info->is_a2dp_sink_supported) ||
(info->is_hfp_supported && info->is_a2dp_src_supported)) {
BT_CHECK_PARAMETER(device_address, return);
_bt_convert_addr_type_to_string(address, device_address->addr);
- BT_INFO("Adderss: [%s], request type: [%d]", address, type);
+ BT_INFO("Audio Connect Request: type[%s] address [%s]",
+ __convert_audio_type_to_string(type), address);
/*
* If type is BT_AUDIO_ALL or BT_AUDIO_HFP_SOURCE, enqueue search info in
char address[BT_ADDRESS_STRING_SIZE] = { 0 };
_bt_convert_addr_type_to_string(address, device_address->addr);
- BT_INFO("Audio Diconnect Request: type[%d] address [%s]", type, address);
+ BT_INFO("Audio Diconnect Request: type[%s] address [%s]",
+ __convert_audio_type_to_string(type), address);
if (type == BT_AUDIO_ALL) {
if (_bt_is_service_connected(address, BT_AUDIO_A2DP)) {
continue;
}
- BT_DBG("Address match \n");
-
- BT_DBG("Connection type = %x\n", connected_device->type);
+ BT_DBG("Address match. Connection type = %s",
+ __convert_audio_type_to_string(connected_device->type));
switch (type) {
case BT_AUDIO_A2DP:
break;
}
- BT_DBG("Connection type = %x\n", connected_device->type);
-
if (connected_device->type == 0x00) {
BT_INFO("Device will be completely removed from connected list as the only profile connected or connecting got disconnected");
g_connected_list = g_list_remove(g_connected_list, connected_device);
break;
case BLUETOOTH_HID_CONNECTED:
signal = BT_INPUT_CONNECTED;
- BT_INFO_C("Connected [HID]");
+ BT_INFO_C("### Connected [HID]");
break;
case BLUETOOTH_HID_DISCONNECTED:
signal = BT_INPUT_DISCONNECTED;
- BT_INFO_C("Disconnected [HID]");
+ BT_INFO_C("### Disconnected [HID]");
break;
case BLUETOOTH_HID_DEVICE_CONNECTED:
signal = BT_INPUT_HID_DEVICE_CONNECTED;
- BT_INFO_C("Connected [HIDDevice]");
+ BT_INFO_C("### Connected [HIDDevice]");
break;
case BLUETOOTH_HID_DEVICE_DISCONNECTED:
signal = BT_INPUT_HID_DEVICE_DISCONNECTED;
- BT_INFO_C("Disconnected [HIDDevice]");
+ BT_INFO_C("### Disconnected [HIDDevice]");
break;
case BLUETOOTH_PBAP_CONNECTED:
signal = BT_PBAP_CONNECTED;
- BT_INFO_C("Connected [PBAP Client]");
+ BT_INFO_C("### Connected [PBAP Client]");
break;
case BLUETOOTH_PBAP_DISCONNECTED:
signal = BT_PBAP_DISCONNECTED;
- BT_INFO_C("Disconnected [PBAP Client]");
+ BT_INFO_C("### Disconnected [PBAP Client]");
break;
case BLUETOOTH_PBAP_PHONEBOOK_SIZE:
signal = BT_PBAP_PHONEBOOK_SIZE;
break;
case BLUETOOTH_EVENT_AG_CONNECTED:
signal = BT_HEADSET_CONNECTED;
- BT_INFO_C("Connected [HSP/HFP]");
+ BT_INFO_C("### Connected [HSP/HFP]");
break;
case BLUETOOTH_EVENT_AG_DISCONNECTED:
signal = BT_HEADSET_DISCONNECTED;
- BT_INFO_C("Disconnected [HSP/HFP]");
+ BT_INFO_C("### Disconnected [HSP/HFP]");
break;
case BLUETOOTH_EVENT_AV_CONNECTED:
signal = BT_STEREO_HEADSET_CONNECTED;
- BT_INFO_C("Connected [A2DP]");
+ BT_INFO_C("### Connected [A2DP]");
break;
case BLUETOOTH_EVENT_AV_DISCONNECTED:
signal = BT_STEREO_HEADSET_DISCONNECTED;
- BT_INFO_C("Disconnected [A2DP]");
+ BT_INFO_C("### Disconnected [A2DP]");
break;
case BLUETOOTH_EVENT_AV_SOURCE_CONNECTED:
signal = BT_A2DP_SOURCE_CONNECTED;
- BT_INFO_C("Connected [A2DP Source]");
+ BT_INFO_C("### Connected [A2DP Source]");
break;
case BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED:
signal = BT_A2DP_SOURCE_DISCONNECTED;
- BT_INFO_C("Disconnected [A2DP Source]");
+ BT_INFO_C("### Disconnected [A2DP Source]");
break;
case BLUETOOTH_EVENT_AG_AUDIO_CONNECTED:
signal = BT_SCO_CONNECTED;
- BT_INFO_C("Connected [SCO]");
+ BT_INFO_C("### Connected [SCO]");
break;
case BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED:
signal = BT_SCO_DISCONNECTED;
- BT_INFO_C("Disonnected [SCO]");
+ BT_INFO_C("### Disonnected [SCO]");
break;
case BLUETOOTH_EVENT_AG_SPEAKER_GAIN:
signal = BT_SPEAKER_GAIN;