hfp_hf: send HF Indicator update only if enabled by AG

This commit is contained in:
Matthias Ringwald 2024-07-18 14:57:12 +02:00
parent 745e7a2fc2
commit 4431fb7a03
2 changed files with 10 additions and 9 deletions

View File

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- HIOS Client: emit disconnected event on HCI disconnect and free connection struct
- Scan Parameter Service Client: emit disconnected event on HCI disconnect and free connection struct
- PBAP Client: fix PBAP_SUBEVENT_OPERATION_COMPLETED with OBEX_DISCONNECTED for pbap_disconnect
- HFP HF: send HF Indicator update only if enabled by AG
### Changed
- GAP: return command disallowed if disconnect already requested

View File

@ -1116,6 +1116,15 @@ void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
bd_addr_copy(hfp_connection->remote_addr, event_addr);
hfp_connection->state = HFP_EXCHANGE_SUPPORTED_FEATURES;
if (local_role == HFP_ROLE_HF) {
// setup HF Indicators
uint8_t i;
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 = 0;
}
}
rfcomm_request_can_send_now_event(hfp_connection->rfcomm_cid);
break;
@ -1893,15 +1902,6 @@ 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);