}
check_req_info:
- req_info = _bt_get_request_info(func_data->req_id);
- if (req_info == NULL) {
- BT_ERR("req_info == NULL");
- goto done;
- }
-
if (g_error == NULL)
goto dbus_return;
/* Event will be sent by the event reciever */
dbus_return:
- if (req_info->context == NULL) {
- BT_DBG("req_info->context is NULL");
+ req_info = _bt_get_request_info(func_data->req_id);
+ if (req_info == NULL) {
+ BT_ERR("req_info == NULL");
+ goto done;
+ } else if (req_info->context == NULL) {
+ BT_ERR("req_info->context is NULL");
goto done;
}
node = g_list_next(node);
}
- if (!connected)
+ if (!connected) {
+ __bt_free_wait_data();
return BLUETOOTH_ERROR_NOT_CONNECTED;
+ }
BT_DBG("connected headset %s", connected_address);
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);