Lines Matching refs:idx

216 static void send_at_result(uint8_t ok_flag, uint16_t errcode, int idx) {  in send_at_result()  argument
222 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_UNAT_RES, ag_res); in send_at_result()
271 int idx = btif_hf_idx_by_bdaddr(bd_addr); in IsSlcConnected() local
272 if (idx < 0 || idx > BTA_AG_MAX_NUM_CLIENTS) { in IsSlcConnected()
273 LOG(WARNING) << __func__ << ": invalid index " << idx << " for " in IsSlcConnected()
277 return btif_hf_cb[idx].state == BTHF_CONNECTION_STATE_SLC_CONNECTED; in IsSlcConnected()
299 int idx = p_data->hdr.handle - 1; in btif_hf_upstreams_evt() local
303 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in btif_hf_upstreams_evt()
304 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in btif_hf_upstreams_evt()
314 btif_hf_cb[idx].handle = p_data->reg.hdr.handle; in btif_hf_upstreams_evt()
316 __func__, btif_hf_cb[idx].handle); in btif_hf_upstreams_evt()
321 if (btif_hf_cb[idx].is_initiator) { in btif_hf_upstreams_evt()
323 btif_hf_cb[idx].state != BTHF_CONNECTION_STATE_CONNECTING) { in btif_hf_upstreams_evt()
324 if (p_data->open.bd_addr == btif_hf_cb[idx].connected_bda) { in btif_hf_upstreams_evt()
337 << btif_hf_cb[idx].connected_bda in btif_hf_upstreams_evt()
346 CHECK_EQ(btif_hf_cb[idx].state, BTHF_CONNECTION_STATE_CONNECTING) in btif_hf_upstreams_evt()
348 CHECK(!btif_hf_cb[idx].connected_bda.IsEmpty()) in btif_hf_upstreams_evt()
350 if (btif_hf_cb[idx].connected_bda != p_data->open.bd_addr) { in btif_hf_upstreams_evt()
355 << btif_hf_cb[idx].connected_bda in btif_hf_upstreams_evt()
360 &(btif_hf_cb[idx].connected_bda)); in btif_hf_upstreams_evt()
361 reset_control_block(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
367 btif_hf_cb[idx].connected_bda = p_data->open.bd_addr; in btif_hf_upstreams_evt()
368 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_CONNECTED; in btif_hf_upstreams_evt()
369 btif_hf_cb[idx].peer_feat = 0; in btif_hf_upstreams_evt()
370 clear_phone_state_multihf(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
374 btif_hf_cb[idx].state, &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
376 if (!btif_hf_cb[idx].is_initiator) { in btif_hf_upstreams_evt()
384 << btif_hf_cb[idx].connected_bda << ", status " in btif_hf_upstreams_evt()
386 RawAddress connected_bda = btif_hf_cb[idx].connected_bda; in btif_hf_upstreams_evt()
387 reset_control_block(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
388 bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
396 __func__, idx, btif_hf_cb[idx].handle); in btif_hf_upstreams_evt()
400 (btif_hf_cb[idx].state != BTHF_CONNECTION_STATE_SLC_CONNECTED) && in btif_hf_upstreams_evt()
401 btif_hf_cb[idx].is_initiator; in btif_hf_upstreams_evt()
402 RawAddress connected_bda = btif_hf_cb[idx].connected_bda; in btif_hf_upstreams_evt()
403 reset_control_block(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
404 bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
414 BTIF_TRACE_DEBUG("%s: BTA_AG_CONN_EVT, idx = %d ", __func__, idx); in btif_hf_upstreams_evt()
415 btif_hf_cb[idx].peer_feat = p_data->conn.peer_feat; in btif_hf_upstreams_evt()
416 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_SLC_CONNECTED; in btif_hf_upstreams_evt()
417 bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
418 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
419 if (btif_hf_cb[idx].is_initiator) { in btif_hf_upstreams_evt()
426 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
431 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
440 p_data->val.num, &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
444 bt_hf_callbacks->AnswerCallCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
452 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
456 bt_hf_callbacks->HangupCallCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
460 bt_hf_callbacks->AtCindCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
465 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
472 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
478 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
486 bt_hf_callbacks->KeyPressedCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
495 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
498 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
501 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
508 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
512 bt_hf_callbacks->AtClccCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
516 bt_hf_callbacks->AtCopsCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
521 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
525 bt_hf_callbacks->AtCnumCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
532 send_at_result(BTA_AG_OK_ERROR, BTA_AG_ERR_OP_NOT_SUPPORTED, idx); in btif_hf_upstreams_evt()
544 BTA_AgSetCodec(btif_hf_cb[idx].handle, BTA_AG_CODEC_MSBC); in btif_hf_upstreams_evt()
548 BTA_AgSetCodec(btif_hf_cb[idx].handle, BTA_AG_CODEC_CVSD); in btif_hf_upstreams_evt()
558 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
564 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
572 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
583 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
787 int idx = btif_hf_idx_by_bdaddr(bd_addr); in Disconnect() local
788 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in Disconnect()
789 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in Disconnect()
797 BTA_AgClose(btif_hf_cb[idx].handle); in Disconnect()
803 int idx = btif_hf_idx_by_bdaddr(bd_addr); in ConnectAudio() local
804 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in ConnectAudio()
805 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in ConnectAudio()
817 &btif_hf_cb[idx].connected_bda)); in ConnectAudio()
818 BTA_AgAudioOpen(btif_hf_cb[idx].handle); in ConnectAudio()
824 int idx = btif_hf_idx_by_bdaddr(bd_addr); in DisconnectAudio() local
825 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in DisconnectAudio()
826 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in DisconnectAudio()
834 BTA_AgAudioClose(btif_hf_cb[idx].handle); in DisconnectAudio()
840 int idx = btif_hf_idx_by_bdaddr(bd_addr); in StartVoiceRecognition() local
841 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in StartVoiceRecognition()
842 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in StartVoiceRecognition()
850 if (!(btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_VREC)) { in StartVoiceRecognition()
852 __func__, btif_hf_cb[idx].peer_feat); in StartVoiceRecognition()
857 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_BVRA_RES, ag_res); in StartVoiceRecognition()
863 int idx = btif_hf_idx_by_bdaddr(bd_addr); in StopVoiceRecognition() local
865 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in StopVoiceRecognition()
866 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in StopVoiceRecognition()
874 if (!(btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_VREC)) { in StopVoiceRecognition()
876 __func__, btif_hf_cb[idx].peer_feat); in StopVoiceRecognition()
881 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_BVRA_RES, ag_res); in StopVoiceRecognition()
888 int idx = btif_hf_idx_by_bdaddr(bd_addr); in VolumeControl() local
889 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in VolumeControl()
890 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in VolumeControl()
900 BTA_AgResult(btif_hf_cb[idx].handle, in VolumeControl()
914 int idx = btif_hf_idx_by_bdaddr(bd_addr); in DeviceStatusNotification() local
915 if (idx < 0 || idx > BTA_AG_MAX_NUM_CLIENTS) { in DeviceStatusNotification()
916 BTIF_TRACE_WARNING("%s: invalid index %d for %s", __func__, idx, in DeviceStatusNotification()
920 const btif_hf_cb_t& control_block = btif_hf_cb[idx]; in DeviceStatusNotification()
938 int idx = btif_hf_idx_by_bdaddr(bd_addr); in CopsResponse() local
939 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in CopsResponse()
940 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in CopsResponse()
952 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_COPS_RES, ag_res); in CopsResponse()
962 int idx = btif_hf_idx_by_bdaddr(bd_addr); in CindResponse() local
963 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in CindResponse()
964 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in CindResponse()
984 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_CIND_RES, ag_res); in CindResponse()
992 int idx = btif_hf_idx_by_bdaddr(bd_addr); in FormattedAtResponse() local
993 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in FormattedAtResponse()
994 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in FormattedAtResponse()
1004 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_UNAT_RES, ag_res); in FormattedAtResponse()
1011 int idx = btif_hf_idx_by_bdaddr(bd_addr); in AtResponse() local
1012 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in AtResponse()
1013 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in AtResponse()
1023 static_cast<uint16_t>(error_code), idx); in AtResponse()
1032 int idx = btif_hf_idx_by_bdaddr(bd_addr); in ClccResponse() local
1033 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in ClccResponse()
1034 BTIF_TRACE_ERROR("%s: Invalid index %d", __func__, idx); in ClccResponse()
1076 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_CLCC_RES, ag_res); in ClccResponse()
1089 int idx = btif_hf_idx_by_bdaddr(bd_addr); in PhoneStateChange() local
1090 if (idx < 0 || idx > BTA_AG_MAX_NUM_CLIENTS) { in PhoneStateChange()
1091 BTIF_TRACE_WARNING("%s: invalid index %d for %s", __func__, idx, in PhoneStateChange()
1095 const btif_hf_cb_t& control_block = btif_hf_cb[idx]; in PhoneStateChange()
1104 << ": Ignore call state change to DISCONNECTED, idx=" << idx in PhoneStateChange()
1109 LOG(INFO) << __func__ << ": idx=" << idx << ", addr=" << *bd_addr in PhoneStateChange()
1131 UpdateCallStates(&btif_hf_cb[idx], num_active, num_held, call_setup_state); in PhoneStateChange()
1299 UpdateCallStates(&btif_hf_cb[idx], num_active, num_held, in PhoneStateChange()
1355 UpdateCallStates(&btif_hf_cb[idx], num_active, num_held, call_setup_state); in PhoneStateChange()
1385 int idx = btif_hf_idx_by_bdaddr(bd_addr); in SendBsir() local
1386 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in SendBsir()
1387 BTIF_TRACE_ERROR("%s: Invalid index %d for %s", __func__, idx, in SendBsir()
1398 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_INBAND_RING_RES, ag_result); in SendBsir()