Lines Matching refs:idx

236 static void send_at_result(uint8_t ok_flag, uint16_t errcode, int idx) {  in send_at_result()  argument
242 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_UNAT_RES, ag_res); in send_at_result()
291 int idx = btif_hf_idx_by_bdaddr(bd_addr); in IsSlcConnected() local
292 if (idx < 0 || idx > BTA_AG_MAX_NUM_CLIENTS) { in IsSlcConnected()
293 log::warn("invalid index {} for {}", idx, *bd_addr); in IsSlcConnected()
296 return btif_hf_cb[idx].state == BTHF_CONNECTION_STATE_SLC_CONNECTED; in IsSlcConnected()
318 int idx = p_data->hdr.handle - 1; in btif_hf_upstreams_evt() local
322 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in btif_hf_upstreams_evt()
323 log::error("{} Invalid client index:{}", dump_hf_event(event), idx); in btif_hf_upstreams_evt()
333 btif_hf_cb[idx].handle = p_data->reg.hdr.handle; in btif_hf_upstreams_evt()
334 log::debug("{} idx:{} btif_hf_cb.handle = {}", dump_hf_event(event), idx, in btif_hf_upstreams_evt()
335 btif_hf_cb[idx].handle); in btif_hf_upstreams_evt()
342 if (btif_hf_cb[idx].is_initiator) { in btif_hf_upstreams_evt()
347 btif_hf_cb[idx].state != BTHF_CONNECTION_STATE_CONNECTING) { in btif_hf_upstreams_evt()
350 if (p_data->open.bd_addr == btif_hf_cb[idx].connected_bda) { in btif_hf_upstreams_evt()
362 p_data->open.status, btif_hf_cb[idx].connected_bda, in btif_hf_upstreams_evt()
377 btif_hf_cb[idx].state == BTHF_CONNECTION_STATE_CONNECTING, in btif_hf_upstreams_evt()
380 !btif_hf_cb[idx].connected_bda.IsEmpty(), in btif_hf_upstreams_evt()
384 if (btif_hf_cb[idx].connected_bda != p_data->open.bd_addr) { in btif_hf_upstreams_evt()
389 btif_hf_cb[idx].connected_bda, p_data->open.bd_addr); in btif_hf_upstreams_evt()
392 &(btif_hf_cb[idx].connected_bda)); in btif_hf_upstreams_evt()
396 reset_control_block(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
404 btif_hf_cb[idx].connected_bda = p_data->open.bd_addr; in btif_hf_upstreams_evt()
405 if (btif_hf_cb[idx].state != BTHF_CONNECTION_STATE_CONNECTING) { in btif_hf_upstreams_evt()
406 DEVICE_IOT_CONFIG_ADDR_SET_INT(btif_hf_cb[idx].connected_bda, in btif_hf_upstreams_evt()
409 DEVICE_IOT_CONFIG_ADDR_INT_ADD_ONE(btif_hf_cb[idx].connected_bda, in btif_hf_upstreams_evt()
413 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_CONNECTED; in btif_hf_upstreams_evt()
414 btif_hf_cb[idx].peer_feat = 0; in btif_hf_upstreams_evt()
415 clear_phone_state_multihf(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
419 btif_hf_cb[idx].state, &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
421 if (!btif_hf_cb[idx].is_initiator) { in btif_hf_upstreams_evt()
428 btif_hf_cb[idx].connected_bda, p_data->open.status); in btif_hf_upstreams_evt()
429 RawAddress connected_bda = btif_hf_cb[idx].connected_bda; in btif_hf_upstreams_evt()
430 reset_control_block(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
431 bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
445 dump_hf_event(event), idx, btif_hf_cb[idx].handle); in btif_hf_upstreams_evt()
446 RawAddress connected_bda = btif_hf_cb[idx].connected_bda; in btif_hf_upstreams_evt()
452 (btif_hf_cb[idx].state != BTHF_CONNECTION_STATE_SLC_CONNECTED) && in btif_hf_upstreams_evt()
453 btif_hf_cb[idx].is_initiator; in btif_hf_upstreams_evt()
455 reset_control_block(&btif_hf_cb[idx]); in btif_hf_upstreams_evt()
456 bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
465 btif_hf_cb[idx].connected_bda, in btif_hf_upstreams_evt()
472 btif_hf_cb[idx].connected_bda, IOT_CONF_KEY_HFP_CODECTYPE, in btif_hf_upstreams_evt()
477 btif_hf_cb[idx].connected_bda, IOT_CONF_KEY_HFP_FEATURES, in btif_hf_upstreams_evt()
480 log::debug("SLC connected event:{} idx:{}", dump_hf_event(event), idx); in btif_hf_upstreams_evt()
481 btif_hf_cb[idx].peer_feat = p_data->conn.peer_feat; in btif_hf_upstreams_evt()
482 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_SLC_CONNECTED; in btif_hf_upstreams_evt()
483 bt_hf_callbacks->ConnectionStateCallback(btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
484 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
485 if (btif_hf_cb[idx].is_initiator) { in btif_hf_upstreams_evt()
493 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
499 DEVICE_IOT_CONFIG_ADDR_INT_ADD_ONE(btif_hf_cb[idx].connected_bda, in btif_hf_upstreams_evt()
503 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
513 p_data->val.num, &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
517 bt_hf_callbacks->AnswerCallCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
525 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
529 bt_hf_callbacks->HangupCallCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
533 bt_hf_callbacks->AtCindCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
538 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
545 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
551 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
559 bt_hf_callbacks->KeyPressedCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
568 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
570 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
573 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
575 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
578 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
580 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
583 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
604 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
611 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
615 bt_hf_callbacks->AtClccCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
619 bt_hf_callbacks->AtCopsCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
624 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
628 bt_hf_callbacks->AtCnumCallback(&btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
635 send_at_result(BTA_AG_OK_ERROR, BTA_AG_ERR_OP_NOT_SUPPORTED, idx); in btif_hf_upstreams_evt()
645 BTA_AgSetCodec(btif_hf_cb[idx].handle, BTM_SCO_CODEC_LC3); in btif_hf_upstreams_evt()
649 BTA_AgSetCodec(btif_hf_cb[idx].handle, BTM_SCO_CODEC_MSBC); in btif_hf_upstreams_evt()
652 BTA_AgSetCodec(btif_hf_cb[idx].handle, BTM_SCO_CODEC_CVSD); in btif_hf_upstreams_evt()
663 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
667 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
673 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
681 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
692 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
708 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
920 int idx = btif_hf_idx_by_bdaddr(bd_addr); in Disconnect() local
921 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in Disconnect()
922 log::error("Invalid index {}", idx); in Disconnect()
929 BTA_AgClose(btif_hf_cb[idx].handle); in Disconnect()
936 int idx = btif_hf_idx_by_bdaddr(bd_addr); in ConnectAudio() local
937 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in ConnectAudio()
938 log::error("Invalid index {}", idx); in ConnectAudio()
950 &btif_hf_cb[idx].connected_bda)); in ConnectAudio()
951 BTA_AgAudioOpen(btif_hf_cb[idx].handle, disabled_codecs); in ConnectAudio()
960 int idx = btif_hf_idx_by_bdaddr(bd_addr); in DisconnectAudio() local
961 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in DisconnectAudio()
962 log::error("Invalid index {}", idx); in DisconnectAudio()
969 BTA_AgAudioClose(btif_hf_cb[idx].handle); in DisconnectAudio()
975 int idx = btif_hf_idx_by_bdaddr(bd_addr); in isNoiseReductionSupported() local
976 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in isNoiseReductionSupported()
977 log::error("Invalid index {}", idx); in isNoiseReductionSupported()
980 if (!(btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_ECNR)) { in isNoiseReductionSupported()
988 int idx = btif_hf_idx_by_bdaddr(bd_addr); in isVoiceRecognitionSupported() local
989 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in isVoiceRecognitionSupported()
990 log::error("Invalid index {}", idx); in isVoiceRecognitionSupported()
993 if (!(btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_VREC)) { in isVoiceRecognitionSupported()
1001 int idx = btif_hf_idx_by_bdaddr(bd_addr); in StartVoiceRecognition() local
1002 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in StartVoiceRecognition()
1003 log::error("Invalid index {}", idx); in StartVoiceRecognition()
1010 if (!(btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_VREC)) { in StartVoiceRecognition()
1012 btif_hf_cb[idx].peer_feat); in StartVoiceRecognition()
1017 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_BVRA_RES, ag_res); in StartVoiceRecognition()
1023 int idx = btif_hf_idx_by_bdaddr(bd_addr); in StopVoiceRecognition() local
1025 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in StopVoiceRecognition()
1026 log::error("Invalid index {}", idx); in StopVoiceRecognition()
1033 if (!(btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_VREC)) { in StopVoiceRecognition()
1035 btif_hf_cb[idx].peer_feat); in StopVoiceRecognition()
1040 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_BVRA_RES, ag_res); in StopVoiceRecognition()
1047 int idx = btif_hf_idx_by_bdaddr(bd_addr); in VolumeControl() local
1048 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in VolumeControl()
1049 log::error("Invalid index {}", idx); in VolumeControl()
1058 BTA_AgResult(btif_hf_cb[idx].handle, in VolumeControl()
1072 int idx = btif_hf_idx_by_bdaddr(bd_addr); in DeviceStatusNotification() local
1073 if (idx < 0 || idx > BTA_AG_MAX_NUM_CLIENTS) { in DeviceStatusNotification()
1074 log::warn("invalid index {} for {}", idx, *bd_addr); in DeviceStatusNotification()
1077 const btif_hf_cb_t& control_block = btif_hf_cb[idx]; in DeviceStatusNotification()
1095 int idx = btif_hf_idx_by_bdaddr(bd_addr); in CopsResponse() local
1096 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in CopsResponse()
1097 log::error("Invalid index {}", idx); in CopsResponse()
1108 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_COPS_RES, ag_res); in CopsResponse()
1118 int idx = btif_hf_idx_by_bdaddr(bd_addr); in CindResponse() local
1119 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in CindResponse()
1120 log::error("Invalid index {}", idx); in CindResponse()
1139 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_CIND_RES, ag_res); in CindResponse()
1147 int idx = btif_hf_idx_by_bdaddr(bd_addr); in FormattedAtResponse() local
1148 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in FormattedAtResponse()
1149 log::error("Invalid index {}", idx); in FormattedAtResponse()
1158 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_UNAT_RES, ag_res); in FormattedAtResponse()
1165 int idx = btif_hf_idx_by_bdaddr(bd_addr); in AtResponse() local
1166 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in AtResponse()
1167 log::error("Invalid index {}", idx); in AtResponse()
1176 static_cast<uint16_t>(error_code), idx); in AtResponse()
1185 int idx = btif_hf_idx_by_bdaddr(bd_addr); in ClccResponse() local
1186 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in ClccResponse()
1187 log::error("Invalid index {}", idx); in ClccResponse()
1228 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_CLCC_RES, ag_res); in ClccResponse()
1243 int idx = btif_hf_idx_by_bdaddr(bd_addr); in PhoneStateChange() local
1244 if (idx < 0 || idx >= BTA_AG_MAX_NUM_CLIENTS) { in PhoneStateChange()
1245 log::warn("Invalid index {} for {}", idx, raw_address); in PhoneStateChange()
1249 const btif_hf_cb_t& control_block = btif_hf_cb[idx]; in PhoneStateChange()
1260 idx, *bd_addr, num_active, num_held); in PhoneStateChange()
1285 UpdateCallStates(&btif_hf_cb[idx], num_active, num_held, call_setup_state); in PhoneStateChange()
1456 UpdateCallStates(&btif_hf_cb[idx], num_active, num_held, in PhoneStateChange()
1512 UpdateCallStates(&btif_hf_cb[idx], num_active, num_held, call_setup_state); in PhoneStateChange()
1514 DEVICE_IOT_CONFIG_ADDR_INT_ADD_ONE(btif_hf_cb[idx].connected_bda, in PhoneStateChange()
1558 int idx = btif_hf_idx_by_bdaddr(bd_addr); in SendBsir() local
1559 if ((idx < 0) || (idx >= BTA_AG_MAX_NUM_CLIENTS)) { in SendBsir()
1560 log::error("Invalid index {} for {}", idx, *bd_addr); in SendBsir()
1569 BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_INBAND_RING_RES, ag_result); in SendBsir()