hfp_hf: only emit single event for RING and AG Status updates

This commit is contained in:
Matthias Ringwald 2021-03-29 16:01:21 +02:00
parent 7c76cd6112
commit 5a4785c8a7
2 changed files with 9 additions and 7 deletions

View File

@ -33,8 +33,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- AVRCP Target: fix notification changed event
- HFP: Emit Audio Connection Released on SLC Release, e.g. remote power off
- GAP: calculate IO Cap AuthReq Bondable Mode based on `gap_ssp_set_authentication_requirement` and `gap_set_bondable_mode`
- GAP: only store link key for ssp if remote side has set bondable in io cap auth requirements as well
- GAP: only store link key for ssp if remote side has set bondable in io cap auth requirements as well
- HFP HF: only emit single event for RING and AG Status updates
### Changed
- HCI: config I2S for BCM Controllers if `ENABLE_SCO_OVER_PCM`, reduce bit clock to 256/512 kHz
- btstack_uart_posix: supports SLIP frames and replaces `btstack_uart_block_posix`

View File

@ -1092,16 +1092,15 @@ static void hfp_hf_handle_rfcomm_command(hfp_connection_t * hfp_connection){
hfp_hf_emit_type_and_number(hfp_hf_callback, HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION, hfp_connection->bnip_type, hfp_connection->bnip_number);
break;
case HFP_CMD_EXTENDED_AUDIO_GATEWAY_ERROR:
hfp_connection->ok_pending = 0;
hfp_connection->command = HFP_CMD_NONE;
hfp_connection->ok_pending = 0;
hfp_connection->extended_audio_gateway_error = 0;
hfp_emit_event(hfp_connection, HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR, hfp_connection->extended_audio_gateway_error_value);
break;
case HFP_CMD_ERROR:
hfp_connection->command = HFP_CMD_NONE;
hfp_connection->ok_pending = 0;
hfp_reset_context_flags(hfp_connection);
hfp_connection->command = HFP_CMD_NONE;
switch (hfp_connection->state){
case HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED:
switch (hfp_connection->codecs_state){
@ -1120,20 +1119,22 @@ static void hfp_hf_handle_rfcomm_command(hfp_connection_t * hfp_connection){
hfp_hf_switch_on_ok(hfp_connection);
break;
case HFP_CMD_RING:
hfp_connection->command = HFP_CMD_NONE;
hfp_emit_simple_event(hfp_connection, HFP_SUBEVENT_RING);
break;
case HFP_CMD_TRANSFER_AG_INDICATOR_STATUS:
hfp_connection->command = HFP_CMD_NONE;
hfp_hf_handle_transfer_ag_indicator_status(hfp_connection);
break;
case HFP_CMD_RETRIEVE_AG_INDICATORS_STATUS:
hfp_connection->command = HFP_CMD_NONE;
for (i = 0; i < hfp_connection->ag_indicators_nr; i++){
hfp_emit_ag_indicator_event(hfp_hf_callback, hfp_connection->ag_indicators[i]);
}
hfp_connection->command = HFP_CMD_NONE;
break;
case HFP_CMD_AG_SUGGESTED_CODEC:
hfp_connection->command = HFP_CMD_NONE;
hfp_hf_handle_suggested_codec(hfp_connection);
hfp_connection->command = HFP_CMD_NONE;
break;
default:
break;