hfp_hf: send HF Indicator update only if enabled by AG

This commit is contained in:
Matthias Ringwald 2024-01-08 15:43:48 +01:00
parent 21df969ba0
commit 94af8b0e57
3 changed files with 10 additions and 5 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased
### Added
### Fixed
- HFP HF: send HF Indicator update only if enabled by AG
### Changed

View File

@ -1887,6 +1887,15 @@ uint8_t hfp_establish_service_level_connection(bd_addr_t bd_addr, uint16_t servi
bd_addr_copy(connection->remote_addr, bd_addr);
connection->service_uuid = service_uuid;
if (local_role == HFP_ROLE_HF) {
// setup HF Indicators
uint8_t i;
for (i=0; i < hfp_hf_indicators_nr; i++){
connection->generic_status_indicators[i].uuid = hfp_hf_indicators[i];
connection->generic_status_indicators[i].state = 0;
}
}
hfp_sdp_query_request.callback = &hfp_handle_start_sdp_client_query;
// ignore ERROR_CODE_COMMAND_DISALLOWED because in that case, we already have requested an SDP callback
(void) sdp_client_register_query_callback(&hfp_sdp_query_request);

View File

@ -1122,11 +1122,6 @@ static void hfp_hf_slc_established(hfp_connection_t * hfp_connection){
hfp_connection->microphone_gain = hfp_hf_microphone_gain;
hfp_connection->send_microphone_gain = 1;
hfp_emit_event(hfp_connection, HFP_SUBEVENT_MICROPHONE_VOLUME, hfp_hf_microphone_gain);
// enable all indicators
for (i=0; i < hfp_hf_indicators_nr; i++){
hfp_connection->generic_status_indicators[i].uuid = hfp_hf_indicators[i];
hfp_connection->generic_status_indicators[i].state = 1;
}
}
static void hfp_hf_handle_suggested_codec(hfp_connection_t * hfp_connection){