hfp_ag: activate all AG indicators upon service level connection establishment

This commit is contained in:
Matthias Ringwald 2022-03-16 10:37:51 +01:00
parent 69640b0415
commit 80702f974d
2 changed files with 9 additions and 2 deletions

View File

@ -12,7 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- GAP: support periodic advertising with ENABLE_LE_PERIODIC_ADVERTISING
### Fixed
- HFP AG: activate all AG indicators upon service level connection establishment
### Changed

View File

@ -648,7 +648,13 @@ static int codecs_exchange_state_machine(hfp_connection_t * hfp_connection){
static void hfp_ag_slc_established(hfp_connection_t * hfp_connection){
hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED;
hfp_emit_slc_connection_event(hfp_connection->local_role, 0, hfp_connection->acl_handle, hfp_connection->remote_addr);
// HFP 4.35: "When [...] a new Service Level Connection is established all indicators are activated by default."
uint16_t i;
for (i=0;i<hfp_connection->ag_indicators_nr;i++){
hfp_connection->ag_indicators[i].enabled = 1;
}
// if active call exist, set per-hfp_connection state active, too (when audio is on)
if (hfp_gsm_call_status() == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
hfp_connection->call_state = HFP_CALL_W4_AUDIO_CONNECTION_FOR_ACTIVE;