goto fail;
}
BT_INFO("Connecting to service %s", uuid);
+ /* First Check if device is in connecting state if it than return error */
+ value = __bt_is_headset_connecting(type);
+ if (value != BLUETOOTH_ERROR_NONE) {
+ result = BLUETOOTH_ERROR_IN_PROGRESS;
+ goto fail;
+ }
value = __bt_is_headset_connected(type, request_id, address);
result = BLUETOOTH_ERROR_ALREADY_CONNECT;
goto fail;
} else if (value == BLUETOOTH_ERROR_NOT_CONNECTED) {
- value = __bt_is_headset_connecting(type);
- if (value != BLUETOOTH_ERROR_NONE) {
- result = BLUETOOTH_ERROR_IN_PROGRESS;
- goto fail;
- }
_bt_headset_set_local_connection(TRUE);
ret = _bt_connect_profile(address, uuid,
__bt_audio_request_cb, func_data);