mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-26 02:37:41 +00:00
hfp_ag: send codec_event(CVSD) if no codec negotation happens. Remove hack in sco_util to fallback to CVSD without codec event
This commit is contained in:
parent
ba3eebad97
commit
d6ff09e13f
@ -374,19 +374,10 @@ static void sco_report(void){
|
|||||||
printf("SCO: sent %u, received %u\n", count_sent, count_received);
|
printf("SCO: sent %u, received %u\n", count_sent, count_received);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sco_assert_codec_set(void){
|
|
||||||
// if SCO is open but we didn't hear about the codec yet, we fall back to CVSD
|
|
||||||
if (!negotiated_codec){
|
|
||||||
sco_demo_set_codec(HFP_CODEC_CVSD);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void sco_demo_send(hci_con_handle_t sco_handle){
|
void sco_demo_send(hci_con_handle_t sco_handle){
|
||||||
|
|
||||||
if (!sco_handle) return;
|
if (!sco_handle) return;
|
||||||
|
|
||||||
sco_assert_codec_set();
|
|
||||||
|
|
||||||
const int sco_packet_length = 24 + 3; // hci_get_sco_packet_length();
|
const int sco_packet_length = 24 + 3; // hci_get_sco_packet_length();
|
||||||
const int sco_payload_length = sco_packet_length - 3;
|
const int sco_payload_length = sco_packet_length - 3;
|
||||||
|
|
||||||
@ -445,8 +436,6 @@ void sco_demo_send(hci_con_handle_t sco_handle){
|
|||||||
*/
|
*/
|
||||||
void sco_demo_receive(uint8_t * packet, uint16_t size){
|
void sco_demo_receive(uint8_t * packet, uint16_t size){
|
||||||
|
|
||||||
sco_assert_codec_set();
|
|
||||||
|
|
||||||
dump_data = 1;
|
dump_data = 1;
|
||||||
|
|
||||||
count_received++;
|
count_received++;
|
||||||
|
@ -2130,8 +2130,10 @@ static void hfp_ag_setup_audio_connection(hfp_connection_t * hfp_connection){
|
|||||||
hfp_connection->establish_audio_connection = 1;
|
hfp_connection->establish_audio_connection = 1;
|
||||||
|
|
||||||
if (!has_codec_negotiation_feature(hfp_connection)){
|
if (!has_codec_negotiation_feature(hfp_connection)){
|
||||||
log_info("hfp_ag_establish_audio_connection - no codec negotiation feature, using defaults");
|
log_info("hfp_ag_establish_audio_connection - no codec negotiation feature, using CVSD");
|
||||||
|
hfp_connection->negotiated_codec = HFP_CODEC_CVSD;
|
||||||
hfp_connection->codecs_state = HFP_CODECS_EXCHANGED;
|
hfp_connection->codecs_state = HFP_CODECS_EXCHANGED;
|
||||||
|
hfp_emit_codec_event(hfp_callback, 0, hfp_connection->negotiated_codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (hfp_connection->codecs_state){
|
switch (hfp_connection->codecs_state){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user