Lines Matching refs:cb

91   btif_hf_client_cb_t cb[HF_CLIENT_MAX_DEVICES];  member
99 bool is_connected(const btif_hf_client_cb_t* cb);
130 #define CHECK_BTHF_CLIENT_SLC_CONNECTED(cb) \ argument
135 } else if ((cb)->state != BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED) { \
137 __func__, dump_hf_client_conn_state((cb)->state)); \
164 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in btif_in_hf_client_generic_evt() local
165 if (cb == NULL || !is_connected(cb)) { in btif_in_hf_client_generic_evt()
173 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_in_hf_client_generic_evt()
185 bool is_connected(const btif_hf_client_cb_t* cb) { in is_connected() argument
186 if ((cb->state == BTHF_CLIENT_CONNECTION_STATE_CONNECTED) || in is_connected()
187 (cb->state == BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED)) in is_connected()
207 if (btif_hf_client_cb_arr.cb[i].state != in btif_hf_client_get_cb_by_handle()
209 btif_hf_client_cb_arr.cb[i].handle == handle) { in btif_hf_client_get_cb_by_handle()
210 return &btif_hf_client_cb_arr.cb[i]; in btif_hf_client_get_cb_by_handle()
231 if (btif_hf_client_cb_arr.cb[i].state != in btif_hf_client_get_cb_by_bda()
233 btif_hf_client_cb_arr.cb[i].peer_bda == bd_addr) { in btif_hf_client_get_cb_by_bda()
234 return &btif_hf_client_cb_arr.cb[i]; in btif_hf_client_get_cb_by_bda()
252 btif_hf_client_cb_t* cb = &btif_hf_client_cb_arr.cb[i]; in btif_hf_client_allocate_cb() local
253 if (cb->state == BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED) { in btif_hf_client_allocate_cb()
254 return cb; in btif_hf_client_allocate_cb()
298 btif_hf_client_cb_t* cb = btif_hf_client_allocate_cb(); in connect_int() local
299 if (cb == NULL) { in connect_int()
304 cb->peer_bda = *bd_addr; in connect_int()
305 if (is_connected(cb)) return BT_STATUS_BUSY; in connect_int()
307 cb->state = BTHF_CLIENT_CONNECTION_STATE_CONNECTING; in connect_int()
308 cb->peer_bda = *bd_addr; in connect_int()
314 BTA_HfClientOpen(cb->peer_bda, &cb->handle); in connect_int()
337 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in disconnect() local
338 if (cb != NULL) { in disconnect()
339 BTA_HfClientClose(cb->handle); in disconnect()
356 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in connect_audio() local
357 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in connect_audio()
359 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in connect_audio()
362 (cb->peer_feat & BTA_HF_CLIENT_PEER_CODEC)) { in connect_audio()
363 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BCC, 0, 0, NULL); in connect_audio()
365 BTA_HfClientAudioOpen(cb->handle); in connect_audio()
386 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in disconnect_audio() local
387 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in disconnect_audio()
389 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in disconnect_audio()
391 BTA_HfClientAudioClose(cb->handle); in disconnect_audio()
405 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in start_voice_recognition() local
406 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in start_voice_recognition()
408 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in start_voice_recognition()
410 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_VREC) { in start_voice_recognition()
411 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BVRA, 1, 0, NULL); in start_voice_recognition()
427 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in stop_voice_recognition() local
428 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in stop_voice_recognition()
430 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in stop_voice_recognition()
432 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_VREC) { in stop_voice_recognition()
433 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BVRA, 0, 0, NULL); in stop_voice_recognition()
450 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in volume_control() local
451 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in volume_control()
453 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in volume_control()
457 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_VGS, volume, 0, NULL); in volume_control()
460 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_VGM, volume, 0, NULL); in volume_control()
480 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in dial() local
481 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in dial()
483 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in dial()
486 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_ATD, 0, 0, number); in dial()
488 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BLDN, 0, 0, NULL); in dial()
503 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in dial_memory() local
504 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in dial_memory()
506 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in dial_memory()
508 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_ATD, location, 0, NULL); in dial_memory()
524 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in handle_call_action() local
525 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in handle_call_action()
527 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in handle_call_action()
531 if (cb->chld_feat & BTA_HF_CLIENT_CHLD_REL) { in handle_call_action()
532 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 0, 0, NULL); in handle_call_action()
538 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_3WAY) { in handle_call_action()
539 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 1, 0, NULL); in handle_call_action()
545 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_3WAY) { in handle_call_action()
546 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 2, 0, NULL); in handle_call_action()
551 if (cb->chld_feat & BTA_HF_CLIENT_CHLD_MERGE) { in handle_call_action()
552 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 3, 0, NULL); in handle_call_action()
557 if (cb->chld_feat & BTA_HF_CLIENT_CHLD_MERGE_DETACH) { in handle_call_action()
558 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 4, 0, NULL); in handle_call_action()
563 if (cb->peer_feat & BTA_HF_CLIENT_PEER_ECC) { in handle_call_action()
567 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 1, idx, NULL); in handle_call_action()
572 if (cb->peer_feat & BTA_HF_CLIENT_PEER_ECC) { in handle_call_action()
576 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 2, idx, NULL); in handle_call_action()
581 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_ATA, 0, 0, NULL); in handle_call_action()
584 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHUP, 0, 0, NULL); in handle_call_action()
587 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BTRH, 0, 0, NULL); in handle_call_action()
590 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BTRH, 1, 0, NULL); in handle_call_action()
593 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BTRH, 2, 0, NULL); in handle_call_action()
612 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in query_current_calls() local
613 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in query_current_calls()
615 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in query_current_calls()
617 if (cb->peer_feat & BTA_HF_CLIENT_PEER_ECS) { in query_current_calls()
618 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CLCC, 0, 0, NULL); in query_current_calls()
635 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in query_current_operator_name() local
636 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in query_current_operator_name()
638 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in query_current_operator_name()
640 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_COPS, 0, 0, NULL); in query_current_operator_name()
654 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in retrieve_subscriber_info() local
655 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in retrieve_subscriber_info()
657 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in retrieve_subscriber_info()
659 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CNUM, 0, 0, NULL); in retrieve_subscriber_info()
673 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in send_dtmf() local
674 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in send_dtmf()
676 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in send_dtmf()
678 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_VTS, code, 0, NULL); in send_dtmf()
692 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in request_last_voice_tag_number() local
693 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in request_last_voice_tag_number()
695 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in request_last_voice_tag_number()
697 if (cb->peer_feat & BTA_HF_CLIENT_PEER_VTAG) { in request_last_voice_tag_number()
698 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BINP, 1, 0, NULL); in request_last_voice_tag_number()
734 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in send_at_cmd() local
735 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in send_at_cmd()
737 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in send_at_cmd()
741 BTA_HfClientSendAT(cb->handle, cmd, val1, val2, arg); in send_at_cmd()
771 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(ind->bd_addr); in process_ind_evt() local
772 if (cb == NULL || !is_connected(cb)) return; in process_ind_evt()
776 HAL_CBACK(bt_hf_client_callbacks, call_cb, &cb->peer_bda, in process_ind_evt()
781 HAL_CBACK(bt_hf_client_callbacks, callsetup_cb, &cb->peer_bda, in process_ind_evt()
785 HAL_CBACK(bt_hf_client_callbacks, callheld_cb, &cb->peer_bda, in process_ind_evt()
790 HAL_CBACK(bt_hf_client_callbacks, network_state_cb, &cb->peer_bda, in process_ind_evt()
795 HAL_CBACK(bt_hf_client_callbacks, network_signal_cb, &cb->peer_bda, in process_ind_evt()
800 HAL_CBACK(bt_hf_client_callbacks, network_roaming_cb, &cb->peer_bda, in process_ind_evt()
805 HAL_CBACK(bt_hf_client_callbacks, battery_level_cb, &cb->peer_bda, in process_ind_evt()
826 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(p_data->bd_addr); in btif_hf_client_upstreams_evt() local
827 if (cb == NULL && event == BTA_HF_CLIENT_OPEN_EVT) { in btif_hf_client_upstreams_evt()
830 cb = btif_hf_client_allocate_cb(); in btif_hf_client_upstreams_evt()
831 cb->handle = p_data->open.handle; in btif_hf_client_upstreams_evt()
832 cb->peer_bda = p_data->open.bd_addr; in btif_hf_client_upstreams_evt()
833 } else if (cb == NULL) { in btif_hf_client_upstreams_evt()
845 cb->state = BTHF_CLIENT_CONNECTION_STATE_CONNECTED; in btif_hf_client_upstreams_evt()
846 cb->peer_feat = 0; in btif_hf_client_upstreams_evt()
847 cb->chld_feat = 0; in btif_hf_client_upstreams_evt()
848 } else if (cb->state == BTHF_CLIENT_CONNECTION_STATE_CONNECTING) { in btif_hf_client_upstreams_evt()
849 cb->state = BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED; in btif_hf_client_upstreams_evt()
854 __func__, p_data->open.status, cb->state, in btif_hf_client_upstreams_evt()
855 cb->peer_bda.ToString().c_str()); in btif_hf_client_upstreams_evt()
859 HAL_CBACK(bt_hf_client_callbacks, connection_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
860 cb->state, 0, /* peer feat */ in btif_hf_client_upstreams_evt()
863 if (cb->state == BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED) in btif_hf_client_upstreams_evt()
864 cb->peer_bda = RawAddress::kAny; in btif_hf_client_upstreams_evt()
870 cb->peer_feat = p_data->conn.peer_feat; in btif_hf_client_upstreams_evt()
871 cb->chld_feat = p_data->conn.chld_feat; in btif_hf_client_upstreams_evt()
872 cb->state = BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED; in btif_hf_client_upstreams_evt()
874 HAL_CBACK(bt_hf_client_callbacks, connection_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
875 cb->state, cb->peer_feat, cb->chld_feat); in btif_hf_client_upstreams_evt()
878 if (cb->peer_feat & BTA_HF_CLIENT_PEER_INBAND) { in btif_hf_client_upstreams_evt()
879 HAL_CBACK(bt_hf_client_callbacks, in_band_ring_tone_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
887 cb->state = BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED; in btif_hf_client_upstreams_evt()
888 HAL_CBACK(bt_hf_client_callbacks, connection_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
889 cb->state, 0, 0); in btif_hf_client_upstreams_evt()
890 cb->peer_bda = RawAddress::kAny; in btif_hf_client_upstreams_evt()
891 cb->peer_feat = 0; in btif_hf_client_upstreams_evt()
892 cb->chld_feat = 0; in btif_hf_client_upstreams_evt()
901 HAL_CBACK(bt_hf_client_callbacks, volume_change_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
906 HAL_CBACK(bt_hf_client_callbacks, volume_change_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
911 HAL_CBACK(bt_hf_client_callbacks, vr_cmd_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
916 HAL_CBACK(bt_hf_client_callbacks, current_operator_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
921 HAL_CBACK(bt_hf_client_callbacks, clip_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
927 &cb->peer_bda, p_data->number.number); in btif_hf_client_upstreams_evt()
931 HAL_CBACK(bt_hf_client_callbacks, call_waiting_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
936 HAL_CBACK(bt_hf_client_callbacks, cmd_complete_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
942 HAL_CBACK(bt_hf_client_callbacks, current_calls_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
954 HAL_CBACK(bt_hf_client_callbacks, subscriber_info_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
957 HAL_CBACK(bt_hf_client_callbacks, subscriber_info_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
960 HAL_CBACK(bt_hf_client_callbacks, subscriber_info_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
967 HAL_CBACK(bt_hf_client_callbacks, resp_and_hold_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
974 HAL_CBACK(bt_hf_client_callbacks, in_band_ring_tone_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
977 HAL_CBACK(bt_hf_client_callbacks, in_band_ring_tone_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
983 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
988 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
993 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
997 HAL_CBACK(bt_hf_client_callbacks, ring_indication_cb, &cb->peer_bda); in btif_hf_client_upstreams_evt()
1000 HAL_CBACK(bt_hf_client_callbacks, unknown_event_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()