Lines Matching refs:btif_hf_cb

141     else if (btif_hf_cb.state != BTHF_CONNECTION_STATE_SLC_CONNECTED)\
143 …("BTHF: %s: SLC connection not up. state=%s", __FUNCTION__, dump_hf_conn_state(btif_hf_cb.state));\
166 static btif_hf_cb_t btif_hf_cb[BTIF_HF_NUM_CB]; variable
202 if (((btif_hf_cb[i].state == BTHF_CONNECTION_STATE_CONNECTED) || in is_connected()
203 (btif_hf_cb[i].state == BTHF_CONNECTION_STATE_SLC_CONNECTED)) && in is_connected()
205 btif_hf_cb[i].connected_bda.address) == 0))) in is_connected()
226 btif_hf_cb[i].connected_bda.address) == 0)) in btif_hf_idx_by_bdaddr()
274 BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_UNAT_RES, &ag_res); in send_at_result()
299 btif_hf_cb[idx].call_setup_state = BTHF_CALL_STATE_IDLE; in clear_phone_state_multihf()
300 btif_hf_cb[idx].num_active = btif_hf_cb[idx].num_held = 0; in clear_phone_state_multihf()
322 if (btif_hf_cb[i].state == BTHF_CONNECTION_STATE_SLC_CONNECTED) in btif_hf_latest_connected_idx()
324 if ((now.tv_sec - btif_hf_cb[i].connected_timestamp.tv_sec) in btif_hf_latest_connected_idx()
328 now.tv_sec - btif_hf_cb[i].connected_timestamp.tv_sec; in btif_hf_latest_connected_idx()
357 if (btif_hf_cb[i].state == BTHF_CONNECTION_STATE_SLC_CONNECTED) in btif_hf_check_if_slc_connected()
409 btif_hf_cb[idx].handle = p_data->reg.hdr.handle; in btif_hf_upstreams_evt()
411 "btif_hf_cb.handle = %d", __FUNCTION__, btif_hf_cb[idx].handle); in btif_hf_upstreams_evt()
417 bdcpy(btif_hf_cb[idx].connected_bda.address, in btif_hf_upstreams_evt()
419 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_CONNECTED; in btif_hf_upstreams_evt()
420 btif_hf_cb[idx].peer_feat = 0; in btif_hf_upstreams_evt()
423 else if (btif_hf_cb[idx].state == BTHF_CONNECTION_STATE_CONNECTING) in btif_hf_upstreams_evt()
425 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_DISCONNECTED; in btif_hf_upstreams_evt()
430 __FUNCTION__, p_data->open.status, btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
431 … bdaddr_to_string(&btif_hf_cb[idx].connected_bda, bdstr, sizeof(bdstr))); in btif_hf_upstreams_evt()
435 HAL_CBACK(bt_hf_callbacks, connection_state_cb, btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
436 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
438 if (btif_hf_cb[idx].state == BTHF_CONNECTION_STATE_DISCONNECTED) in btif_hf_upstreams_evt()
439 bdsetany(btif_hf_cb[idx].connected_bda.address); in btif_hf_upstreams_evt()
446 btif_hf_cb[idx].connected_timestamp.tv_sec = 0; in btif_hf_upstreams_evt()
447 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_DISCONNECTED; in btif_hf_upstreams_evt()
450 btif_hf_cb[idx].handle); in btif_hf_upstreams_evt()
451 HAL_CBACK(bt_hf_callbacks, connection_state_cb, btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
452 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
453 bdsetany(btif_hf_cb[idx].connected_bda.address); in btif_hf_upstreams_evt()
454 btif_hf_cb[idx].peer_feat = 0; in btif_hf_upstreams_evt()
465 &btif_hf_cb[idx].connected_timestamp); in btif_hf_upstreams_evt()
468 btif_hf_cb[idx].peer_feat = p_data->conn.peer_feat; in btif_hf_upstreams_evt()
469 btif_hf_cb[idx].state = BTHF_CONNECTION_STATE_SLC_CONNECTED; in btif_hf_upstreams_evt()
472 HAL_CBACK(bt_hf_callbacks, connection_state_cb, btif_hf_cb[idx].state, in btif_hf_upstreams_evt()
473 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
480 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
485 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
494 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
498 if ((btif_hf_cb[0].num_held + btif_hf_cb[0].num_active) == 0) in btif_hf_upstreams_evt()
504 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
510 if ((btif_hf_cb[0].num_held + btif_hf_cb[0].num_active) == 0) in btif_hf_upstreams_evt()
517 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
522 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
527 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
532 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
538 BTHF_VR_STATE_STOPPED, &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
544 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
553 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
561 { HAL_CBACK(bt_hf_callbacks, wbs_cb, BTHF_WBS_NO, &btif_hf_cb[idx].connected_bda);} in btif_hf_upstreams_evt()
563 {HAL_CBACK(bt_hf_callbacks, wbs_cb, BTHF_WBS_YES, &btif_hf_cb[idx].connected_bda);} in btif_hf_upstreams_evt()
565 {HAL_CBACK(bt_hf_callbacks, wbs_cb, BTHF_WBS_NONE, &btif_hf_cb[idx].connected_bda);} in btif_hf_upstreams_evt()
571 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
576 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
581 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
586 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
591 &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
608 BTA_AgSetCodec(btif_hf_cb[idx].handle,BTA_AG_CODEC_MSBC); in btif_hf_upstreams_evt()
613 BTA_AgSetCodec(btif_hf_cb[idx].handle,BTA_AG_CODEC_CVSD); in btif_hf_upstreams_evt()
621 BTHF_WBS_YES : BTHF_WBS_NO, &btif_hf_cb[idx].connected_bda); in btif_hf_upstreams_evt()
690 &btif_hf_cb[idx].connected_bda); in btif_in_hf_generic_evt()
715 memset(&btif_hf_cb, 0, sizeof(btif_hf_cb)); in init()
748 if (((btif_hf_cb[i].state == BTHF_CONNECTION_STATE_CONNECTED) || in connect_int()
749 (btif_hf_cb[i].state == BTHF_CONNECTION_STATE_SLC_CONNECTED))) in connect_int()
760 btif_hf_cb[i].state = BTHF_CONNECTION_STATE_CONNECTING; in connect_int()
761 bdcpy(btif_hf_cb[i].connected_bda.address, bd_addr->address); in connect_int()
763 BTA_AgOpen(btif_hf_cb[i].handle, btif_hf_cb[i].connected_bda.address, in connect_int()
800 BTA_AgClose(btif_hf_cb[idx].handle); in disconnect()
834 BTA_AgAudioOpen(btif_hf_cb[idx].handle); in connect_audio()
868 BTA_AgAudioClose(btif_hf_cb[idx].handle); in disconnect_audio()
898 if (btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_VREC) in start_voice_recognition()
903 BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_BVRA_RES, &ag_res); in start_voice_recognition()
939 if (btif_hf_cb[idx].peer_feat & BTA_AG_PEER_FEAT_VREC) in stop_voice_recognition()
944 BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_BVRA_RES, &ag_res); in stop_voice_recognition()
984 BTA_AgResult(btif_hf_cb[idx].handle, in volume_control()
1053 BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_COPS_RES, &ag_res); in cops_response()
1100 BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_CIND_RES, &ag_res); in cind_response()
1134 BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_UNAT_RES, &ag_res); in formatted_at_response()
1227 BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_CLCC_RES, &ag_res); in clcc_response()
1269 " call_setup=%s [prev: %s]", num_active, btif_hf_cb[idx].num_active, in phone_state_change()
1270 num_held, btif_hf_cb[idx].num_held, dump_hf_call_state(call_setup_state), in phone_state_change()
1271 dump_hf_call_state(btif_hf_cb[idx].call_setup_state)); in phone_state_change()
1280 if ((btif_hf_cb[idx].call_setup_state != BTHF_CALL_STATE_IDLE ) || in phone_state_change()
1281 (btif_hf_cb[idx].num_active) ||(btif_hf_cb[idx].num_held)) in phone_state_change()
1284 clock_gettime(CLOCK_MONOTONIC, &btif_hf_cb[0].call_end_timestamp); in phone_state_change()
1290 if (btif_hf_cb[idx].num_held) in phone_state_change()
1307 …if ( ((num_active + num_held) > 0) && (btif_hf_cb[idx].num_active == 0) && (btif_hf_cb[idx].num_he… in phone_state_change()
1308 (btif_hf_cb[idx].call_setup_state == BTHF_CALL_STATE_IDLE) ) in phone_state_change()
1314 ag_res.audio_handle = btif_hf_cb[idx].handle; in phone_state_change()
1328 if (call_setup_state != btif_hf_cb[idx].call_setup_state) in phone_state_change()
1331 __FUNCTION__, dump_hf_call_state(btif_hf_cb[idx].call_setup_state), in phone_state_change()
1339 switch (btif_hf_cb[idx].call_setup_state) in phone_state_change()
1342 if (num_active > btif_hf_cb[idx].num_active) in phone_state_change()
1345 ag_res.audio_handle = btif_hf_cb[idx].handle; in phone_state_change()
1347 else if (num_held > btif_hf_cb[idx].num_held) in phone_state_change()
1354 if (num_active > btif_hf_cb[idx].num_active) in phone_state_change()
1389 ag_res.audio_handle = btif_hf_cb[idx].handle; in phone_state_change()
1394 if ((btif_hf_cb[idx].call_setup_state == BTHF_CALL_STATE_IDLE) && in phone_state_change()
1396 ag_res.audio_handle = btif_hf_cb[idx].handle; in phone_state_change()
1426 (btif_hf_cb[idx].num_active + btif_hf_cb[idx].num_held)) ) in phone_state_change()
1428 …DEBUG("%s: Active call states changed. old: %d new: %d", __FUNCTION__, btif_hf_cb[idx].num_active,… in phone_state_change()
1433 if (num_held != btif_hf_cb[idx].num_held || in phone_state_change()
1434 ((num_active == 0) && ((num_held + btif_hf_cb[idx].num_held) > 1))) in phone_state_change()
1437 __FUNCTION__, btif_hf_cb[idx].num_held, num_held); in phone_state_change()
1442 if ( (call_setup_state == btif_hf_cb[idx].call_setup_state) && in phone_state_change()
1444 (num_active == btif_hf_cb[idx].num_active) && in phone_state_change()
1445 (num_held == btif_hf_cb[idx].num_held) ) in phone_state_change()
1454 btif_hf_cb[i].num_active = num_active; in phone_state_change()
1455 btif_hf_cb[i].num_held = num_held; in phone_state_change()
1456 btif_hf_cb[i].call_setup_state = call_setup_state; in phone_state_change()
1477 if ((btif_hf_cb[i].call_setup_state != BTHF_CALL_STATE_IDLE) in btif_hf_is_call_idle()
1478 || ((btif_hf_cb[i].num_held + btif_hf_cb[i].num_active) > 0)) in btif_hf_is_call_idle()
1499 if (now.tv_sec < btif_hf_cb[0].call_end_timestamp.tv_sec + in btif_hf_call_terminated_recently()
1506 btif_hf_cb[0].call_end_timestamp.tv_sec = 0; in btif_hf_call_terminated_recently()
1556 BTA_AgSetCodec(btif_hf_cb[idx].handle,BTA_AG_CODEC_MSBC); in configure_wbs()
1558 BTA_AgSetCodec(btif_hf_cb[idx].handle,BTA_AG_CODEC_CVSD); in configure_wbs()
1560 BTA_AgSetCodec(btif_hf_cb[idx].handle,BTA_AG_CODEC_NONE); in configure_wbs()
1613 BTA_AgDeregister(btif_hf_cb[i].handle); in btif_hf_execute_service()