Lines Matching refs:cb
95 btif_hf_client_cb_t cb[HF_CLIENT_MAX_DEVICES]; member
103 bool is_connected(const btif_hf_client_cb_t* cb);
134 #define CHECK_BTHF_CLIENT_SLC_CONNECTED(cb) \ argument
139 } else if ((cb)->state != BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED) { \
141 __func__, dump_hf_client_conn_state((cb)->state)); \
168 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in btif_in_hf_client_generic_evt() local
169 if (cb == NULL || !is_connected(cb)) { in btif_in_hf_client_generic_evt()
176 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_in_hf_client_generic_evt()
188 bool is_connected(const btif_hf_client_cb_t* cb) { in is_connected() argument
189 if ((cb->state == BTHF_CLIENT_CONNECTION_STATE_CONNECTED) || in is_connected()
190 (cb->state == BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED)) in is_connected()
210 if (btif_hf_client_cb_arr.cb[i].state != in btif_hf_client_get_cb_by_handle()
212 btif_hf_client_cb_arr.cb[i].handle == handle) { in btif_hf_client_get_cb_by_handle()
213 return &btif_hf_client_cb_arr.cb[i]; in btif_hf_client_get_cb_by_handle()
234 if (btif_hf_client_cb_arr.cb[i].state != in btif_hf_client_get_cb_by_bda()
236 btif_hf_client_cb_arr.cb[i].peer_bda == bd_addr) { in btif_hf_client_get_cb_by_bda()
237 return &btif_hf_client_cb_arr.cb[i]; in btif_hf_client_get_cb_by_bda()
255 btif_hf_client_cb_t* cb = &btif_hf_client_cb_arr.cb[i]; in btif_hf_client_allocate_cb() local
256 if (cb->state == BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED) { in btif_hf_client_allocate_cb()
257 return cb; in btif_hf_client_allocate_cb()
301 btif_hf_client_cb_t* cb = btif_hf_client_allocate_cb(); in connect_int() local
302 if (cb == NULL) { in connect_int()
307 cb->peer_bda = *bd_addr; in connect_int()
308 if (is_connected(cb)) return BT_STATUS_BUSY; in connect_int()
310 cb->state = BTHF_CLIENT_CONNECTION_STATE_CONNECTING; in connect_int()
311 cb->peer_bda = *bd_addr; in connect_int()
317 BTA_HfClientOpen(cb->peer_bda, BTIF_HF_CLIENT_SECURITY, &cb->handle); in connect_int()
340 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in disconnect() local
341 if (cb != NULL) { in disconnect()
342 BTA_HfClientClose(cb->handle); in disconnect()
359 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in connect_audio() local
360 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in connect_audio()
362 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in connect_audio()
365 (cb->peer_feat & BTA_HF_CLIENT_PEER_CODEC)) { in connect_audio()
366 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BCC, 0, 0, NULL); in connect_audio()
368 BTA_HfClientAudioOpen(cb->handle); in connect_audio()
389 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in disconnect_audio() local
390 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in disconnect_audio()
392 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in disconnect_audio()
394 BTA_HfClientAudioClose(cb->handle); in disconnect_audio()
408 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in start_voice_recognition() local
409 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in start_voice_recognition()
411 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in start_voice_recognition()
413 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_VREC) { in start_voice_recognition()
414 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BVRA, 1, 0, NULL); in start_voice_recognition()
430 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in stop_voice_recognition() local
431 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in stop_voice_recognition()
433 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in stop_voice_recognition()
435 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_VREC) { in stop_voice_recognition()
436 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BVRA, 0, 0, NULL); in stop_voice_recognition()
453 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in volume_control() local
454 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in volume_control()
456 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in volume_control()
460 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_VGS, volume, 0, NULL); in volume_control()
463 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_VGM, volume, 0, NULL); in volume_control()
483 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in dial() local
484 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in dial()
486 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in dial()
489 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_ATD, 0, 0, number); in dial()
491 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BLDN, 0, 0, NULL); in dial()
506 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in dial_memory() local
507 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in dial_memory()
509 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in dial_memory()
511 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_ATD, location, 0, NULL); in dial_memory()
527 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in handle_call_action() local
528 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in handle_call_action()
530 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in handle_call_action()
534 if (cb->chld_feat & BTA_HF_CLIENT_CHLD_REL) { in handle_call_action()
535 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 0, 0, NULL); in handle_call_action()
541 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_3WAY) { in handle_call_action()
542 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 1, 0, NULL); in handle_call_action()
548 if (cb->peer_feat & BTA_HF_CLIENT_PEER_FEAT_3WAY) { in handle_call_action()
549 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 2, 0, NULL); in handle_call_action()
554 if (cb->chld_feat & BTA_HF_CLIENT_CHLD_MERGE) { in handle_call_action()
555 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 3, 0, NULL); in handle_call_action()
560 if (cb->chld_feat & BTA_HF_CLIENT_CHLD_MERGE_DETACH) { in handle_call_action()
561 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 4, 0, NULL); in handle_call_action()
566 if (cb->peer_feat & BTA_HF_CLIENT_PEER_ECC) { in handle_call_action()
570 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 1, idx, NULL); in handle_call_action()
575 if (cb->peer_feat & BTA_HF_CLIENT_PEER_ECC) { in handle_call_action()
579 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHLD, 2, idx, NULL); in handle_call_action()
584 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_ATA, 0, 0, NULL); in handle_call_action()
587 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CHUP, 0, 0, NULL); in handle_call_action()
590 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BTRH, 0, 0, NULL); in handle_call_action()
593 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BTRH, 1, 0, NULL); in handle_call_action()
596 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BTRH, 2, 0, NULL); in handle_call_action()
615 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in query_current_calls() local
616 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in query_current_calls()
618 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in query_current_calls()
620 if (cb->peer_feat & BTA_HF_CLIENT_PEER_ECS) { in query_current_calls()
621 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CLCC, 0, 0, NULL); in query_current_calls()
638 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in query_current_operator_name() local
639 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in query_current_operator_name()
641 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in query_current_operator_name()
643 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_COPS, 0, 0, NULL); in query_current_operator_name()
657 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in retrieve_subscriber_info() local
658 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in retrieve_subscriber_info()
660 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in retrieve_subscriber_info()
662 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_CNUM, 0, 0, NULL); in retrieve_subscriber_info()
676 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in send_dtmf() local
677 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in send_dtmf()
679 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in send_dtmf()
681 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_VTS, code, 0, NULL); in send_dtmf()
695 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in request_last_voice_tag_number() local
696 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in request_last_voice_tag_number()
698 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in request_last_voice_tag_number()
700 if (cb->peer_feat & BTA_HF_CLIENT_PEER_VTAG) { in request_last_voice_tag_number()
701 BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BINP, 1, 0, NULL); in request_last_voice_tag_number()
737 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr); in send_at_cmd() local
738 if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL; in send_at_cmd()
740 CHECK_BTHF_CLIENT_SLC_CONNECTED(cb); in send_at_cmd()
744 BTA_HfClientSendAT(cb->handle, cmd, val1, val2, arg); in send_at_cmd()
774 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(ind->bd_addr); in process_ind_evt() local
775 if (cb == NULL || !is_connected(cb)) return; in process_ind_evt()
779 HAL_CBACK(bt_hf_client_callbacks, call_cb, &cb->peer_bda, in process_ind_evt()
784 HAL_CBACK(bt_hf_client_callbacks, callsetup_cb, &cb->peer_bda, in process_ind_evt()
788 HAL_CBACK(bt_hf_client_callbacks, callheld_cb, &cb->peer_bda, in process_ind_evt()
793 HAL_CBACK(bt_hf_client_callbacks, network_state_cb, &cb->peer_bda, in process_ind_evt()
798 HAL_CBACK(bt_hf_client_callbacks, network_signal_cb, &cb->peer_bda, in process_ind_evt()
803 HAL_CBACK(bt_hf_client_callbacks, network_roaming_cb, &cb->peer_bda, in process_ind_evt()
808 HAL_CBACK(bt_hf_client_callbacks, battery_level_cb, &cb->peer_bda, in process_ind_evt()
829 btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(p_data->bd_addr); in btif_hf_client_upstreams_evt() local
830 if (cb == NULL && event == BTA_HF_CLIENT_OPEN_EVT) { in btif_hf_client_upstreams_evt()
833 cb = btif_hf_client_allocate_cb(); in btif_hf_client_upstreams_evt()
834 cb->handle = p_data->open.handle; in btif_hf_client_upstreams_evt()
835 cb->peer_bda = p_data->open.bd_addr; in btif_hf_client_upstreams_evt()
836 } else if (cb == NULL) { in btif_hf_client_upstreams_evt()
848 cb->state = BTHF_CLIENT_CONNECTION_STATE_CONNECTED; in btif_hf_client_upstreams_evt()
849 cb->peer_feat = 0; in btif_hf_client_upstreams_evt()
850 cb->chld_feat = 0; in btif_hf_client_upstreams_evt()
851 } else if (cb->state == BTHF_CLIENT_CONNECTION_STATE_CONNECTING) { in btif_hf_client_upstreams_evt()
852 cb->state = BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED; in btif_hf_client_upstreams_evt()
857 __func__, p_data->open.status, cb->state, in btif_hf_client_upstreams_evt()
858 cb->peer_bda.ToString().c_str()); in btif_hf_client_upstreams_evt()
862 HAL_CBACK(bt_hf_client_callbacks, connection_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
863 cb->state, 0, /* peer feat */ in btif_hf_client_upstreams_evt()
866 if (cb->state == BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED) in btif_hf_client_upstreams_evt()
867 cb->peer_bda = RawAddress::kAny; in btif_hf_client_upstreams_evt()
873 cb->peer_feat = p_data->conn.peer_feat; in btif_hf_client_upstreams_evt()
874 cb->chld_feat = p_data->conn.chld_feat; in btif_hf_client_upstreams_evt()
875 cb->state = BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED; in btif_hf_client_upstreams_evt()
877 HAL_CBACK(bt_hf_client_callbacks, connection_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
878 cb->state, cb->peer_feat, cb->chld_feat); in btif_hf_client_upstreams_evt()
881 if (cb->peer_feat & BTA_HF_CLIENT_PEER_INBAND) { in btif_hf_client_upstreams_evt()
882 HAL_CBACK(bt_hf_client_callbacks, in_band_ring_tone_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
890 cb->state = BTHF_CLIENT_CONNECTION_STATE_DISCONNECTED; in btif_hf_client_upstreams_evt()
891 HAL_CBACK(bt_hf_client_callbacks, connection_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
892 cb->state, 0, 0); in btif_hf_client_upstreams_evt()
893 cb->peer_bda = RawAddress::kAny; in btif_hf_client_upstreams_evt()
894 cb->peer_feat = 0; in btif_hf_client_upstreams_evt()
895 cb->chld_feat = 0; in btif_hf_client_upstreams_evt()
904 HAL_CBACK(bt_hf_client_callbacks, volume_change_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
909 HAL_CBACK(bt_hf_client_callbacks, volume_change_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
914 HAL_CBACK(bt_hf_client_callbacks, vr_cmd_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
919 HAL_CBACK(bt_hf_client_callbacks, current_operator_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
924 HAL_CBACK(bt_hf_client_callbacks, clip_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
930 &cb->peer_bda, p_data->number.number); in btif_hf_client_upstreams_evt()
934 HAL_CBACK(bt_hf_client_callbacks, call_waiting_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
939 HAL_CBACK(bt_hf_client_callbacks, cmd_complete_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
945 HAL_CBACK(bt_hf_client_callbacks, current_calls_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()
963 HAL_CBACK(bt_hf_client_callbacks, subscriber_info_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
970 HAL_CBACK(bt_hf_client_callbacks, resp_and_hold_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()
980 HAL_CBACK(bt_hf_client_callbacks, in_band_ring_tone_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
986 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
991 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
996 HAL_CBACK(bt_hf_client_callbacks, audio_state_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()
1000 HAL_CBACK(bt_hf_client_callbacks, ring_indication_cb, &cb->peer_bda); in btif_hf_client_upstreams_evt()
1003 HAL_CBACK(bt_hf_client_callbacks, unknown_event_cb, &cb->peer_bda, in btif_hf_client_upstreams_evt()