mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-26 02:37:41 +00:00
hfp: send start/stop audio for ENABLE_NXP_PCM_WBS
This commit is contained in:
parent
56e31a8c13
commit
e3a705f5df
@ -645,6 +645,11 @@ static hfp_connection_t * hfp_create_connection(bd_addr_t bd_addr, hfp_role_t lo
|
|||||||
hfp_connection->local_role = local_role;
|
hfp_connection->local_role = local_role;
|
||||||
log_info("Create HFP context %p: role %u, addr %s", hfp_connection, local_role, bd_addr_to_str(bd_addr));
|
log_info("Create HFP context %p: role %u, addr %s", hfp_connection, local_role, bd_addr_to_str(bd_addr));
|
||||||
|
|
||||||
|
#ifdef ENABLE_NXP_PCM_WBS
|
||||||
|
hfp_connection->nxp_start_audio_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
hfp_connection->nxp_stop_audio_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
#endif
|
||||||
|
|
||||||
return hfp_connection;
|
return hfp_connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -967,6 +972,10 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
|||||||
|
|
||||||
hfp_emit_sco_connection_established(hfp_connection, status,
|
hfp_emit_sco_connection_established(hfp_connection, status,
|
||||||
hfp_connection->negotiated_codec, rx_packet_length, tx_packet_length);
|
hfp_connection->negotiated_codec, rx_packet_length, tx_packet_length);
|
||||||
|
|
||||||
|
#ifdef ENABLE_NXP_PCM_WBS
|
||||||
|
hfp_connection->nxp_start_audio_handle = hfp_connection->sco_handle;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -982,6 +991,10 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
|||||||
#ifdef ENABLE_BCM_PCM_WBS
|
#ifdef ENABLE_BCM_PCM_WBS
|
||||||
hfp_connection->bcm_send_disable_wbs = true;
|
hfp_connection->bcm_send_disable_wbs = true;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_NXP_PCM_WBS
|
||||||
|
hfp_connection->nxp_stop_audio_handle = hfp_connection->sco_handle;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (hfp_connection->sco_handle == handle){
|
if (hfp_connection->sco_handle == handle){
|
||||||
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
||||||
hfp_connection->release_audio_connection = 0;
|
hfp_connection->release_audio_connection = 0;
|
||||||
|
@ -744,6 +744,10 @@ typedef struct hfp_connection {
|
|||||||
#ifdef ENABLE_RTK_PCM_WBS
|
#ifdef ENABLE_RTK_PCM_WBS
|
||||||
bool rtk_send_sco_config;
|
bool rtk_send_sco_config;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_NXP_PCM_WBS
|
||||||
|
hci_con_handle_t nxp_start_audio_handle;
|
||||||
|
hci_con_handle_t nxp_stop_audio_handle;
|
||||||
|
#endif
|
||||||
} hfp_connection_t;
|
} hfp_connection_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2284,6 +2284,20 @@ static void hfp_ag_run_for_context(hfp_connection_t *hfp_connection){
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_NXP_PCM_WBS
|
||||||
|
if (hfp_connection->nxp_start_audio_handle != HCI_CON_HANDLE_INVALID){
|
||||||
|
hci_con_handle_t sco_handle = hfp_connection->nxp_start_audio_handle;
|
||||||
|
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
hci_send_cmd(&hci_nxp_host_pcm_i2s_audio_config, 0, 0, sco_handle, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (hfp_connection->nxp_stop_audio_handle != HCI_CON_HANDLE_INVALID){
|
||||||
|
hci_con_handle_t sco_handle = hfp_connection->nxp_stop_audio_handle;
|
||||||
|
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
hci_send_cmd(&hci_nxp_host_pcm_i2s_audio_config, 0, 0, sco_handle, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,6 +819,20 @@ static void hfp_hf_run_for_context(hfp_connection_t * hfp_connection){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_NXP_PCM_WBS
|
||||||
|
if (hfp_connection->nxp_start_audio_handle != HCI_CON_HANDLE_INVALID){
|
||||||
|
hci_con_handle_t sco_handle = hfp_connection->nxp_start_audio_handle;
|
||||||
|
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
hci_send_cmd(&hci_nxp_host_pcm_i2s_audio_config, 0, 0, sco_handle, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (hfp_connection->nxp_stop_audio_handle != HCI_CON_HANDLE_INVALID){
|
||||||
|
hci_con_handle_t sco_handle = hfp_connection->nxp_stop_audio_handle;
|
||||||
|
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
hci_send_cmd(&hci_nxp_host_pcm_i2s_audio_config, 0, 0, sco_handle, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if defined (ENABLE_CC256X_ASSISTED_HFP) || defined (ENABLE_BCM_PCM_WBS)
|
#if defined (ENABLE_CC256X_ASSISTED_HFP) || defined (ENABLE_BCM_PCM_WBS)
|
||||||
if (hfp_connection->state == HFP_W4_WBS_SHUTDOWN){
|
if (hfp_connection->state == HFP_W4_WBS_SHUTDOWN){
|
||||||
hfp_finalize_connection_context(hfp_connection);
|
hfp_finalize_connection_context(hfp_connection);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user