}
connected_device->device_state = status;
- if (status == BT_STATE_CONNECTED)
+ if ((status == BT_STATE_CONNECTED) || (status == BT_STATE_CONNECTING))
connected_device->type |= type;
g_strlcpy(connected_device->device_address, address,
sizeof(connected_device->device_address));
bt_audio_type_t type)
{
GArray *dev_list = NULL;
- int size,i,j;
+ int size;
+ int i;
+ int j;
bluetooth_device_info_t info;
char bond_address[BT_ADDRESS_STRING_SIZE] = { 0 };
gboolean ret = FALSE;
BT_DBG("+");
- dev_list = g_array_new (FALSE, FALSE, sizeof(gchar));
+ dev_list = g_array_new(FALSE, FALSE, sizeof(gchar));
_bt_get_bonded_devices(&dev_list);
size = (dev_list->len) / sizeof(bluetooth_device_info_t);
- for (i=0; i < size; i++) {
+ for (i = 0; i < size; i++) {
info = g_array_index(dev_list, bluetooth_device_info_t, i);
_bt_convert_addr_type_to_string(bond_address,
info.device_address.addr);
if (__bt_device_support_uuid(address, BT_AUDIO_HSP)) {
uuid = HFP_HS_UUID;
func_data->pending = BT_PENDING_CONNECT;
+ type = BT_AUDIO_HSP;
} else if (__bt_device_support_uuid(address, BT_AUDIO_A2DP)) {
uuid = A2DP_SINK_UUID;
+ type = BT_AUDIO_A2DP;
} else {
BT_ERR("No audio role supported");
result = BLUETOOTH_ERROR_SERVICE_NOT_FOUND;