hfp_hf: emit initial AG indicators values

This commit is contained in:
Milanka Ringwald 2021-08-31 10:17:19 +02:00
parent 405cbc7653
commit 722a85f3a6
3 changed files with 10 additions and 6 deletions

View File

@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- HFP: API functions return status code if appropriate
- HFP: removed one parameter from hfp_ag/hf_activate_voice_recognition function, instead introduced hfp_ag/hf_deactivate_voice_recognition
- HFP: merged legacy and enhanced Voice Recognition Activation (VRA) API. If available enhanced mode will be preferred.
- HFP: seperate events for acivation (HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED) and deactivation (HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED) instead of combined HFP_SUBEVENT_VOICE_RECOGNITION_STATUS with status field. HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED contains field "enhanced" to indicate if enhanced mode is used.
- HFP: separate events for activation (HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED) and deactivation (HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED) instead of combined HFP_SUBEVENT_VOICE_RECOGNITION_STATUS with status field. HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED contains field "enhanced" to indicate if enhanced mode is used.
- HFP, enhanced VRA: HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED is emitted after VRA is ready and the the audio connection is established. This simplifies HFP HF client logic, i.e. client can call `hfp_hf_enhanced_voice_recognition_report_ready_for_audio directly` upon reception of HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED event.
- AVDTP: media config validator is called with preview of media codec configuration event and configured separately for sink/source
- AVRCP: use PANEL as default unit + subunit info

View File

@ -535,7 +535,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
break;
case HFP_SUBEVENT_AG_INDICATOR_MAPPING:
printf("AG Indicator Mapping | INDEX %d with range [%d, %d] >> NAME '%s'\n",
printf("AG Indicator Mapping | INDEX %d: range [%d, %d], name '%s'\n",
hfp_subevent_ag_indicator_mapping_get_indicator_index(event),
hfp_subevent_ag_indicator_mapping_get_indicator_min_range(event),
hfp_subevent_ag_indicator_mapping_get_indicator_max_range(event),
@ -543,11 +543,9 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
break;
case HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED:
printf("AG_INDICATOR_STATUS_CHANGED | INDEX %d, status %d, range [%d, %d], name '%s'\n",
printf("AG Indicator Status | INDEX %d: status %d, '%s'\n",
hfp_subevent_ag_indicator_status_changed_get_indicator_index(event),
hfp_subevent_ag_indicator_status_changed_get_indicator_status(event),
hfp_subevent_ag_indicator_status_changed_get_indicator_min_range(event),
hfp_subevent_ag_indicator_status_changed_get_indicator_max_range(event),
(const char*) hfp_subevent_ag_indicator_status_changed_get_indicator_name(event));
break;
case HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED:
@ -557,7 +555,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
(char *) hfp_subevent_network_operator_changed_get_network_operator_name(event));
break;
case HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR:
printf("EXTENDED_AUDIO_GATEWAY_ERROR_REPORT, status : 0x%02x\n",
printf("EXTENDED_AUDIO_GATEWAY_ERROR_REPORT, status: 0x%02x\n",
hfp_subevent_extended_audio_gateway_error_get_error(event));
break;
case HFP_SUBEVENT_START_RINGING:

View File

@ -1048,6 +1048,12 @@ static void hfp_ag_slc_established(hfp_connection_t * hfp_connection){
for (i = 0; i < hfp_connection->ag_indicators_nr; i++){
hfp_emit_ag_indicator_mapping_event(hfp_connection, &hfp_connection->ag_indicators[i]);
}
for (i = 0; i < hfp_connection->ag_indicators_nr; i++){
hfp_connection->ag_indicators[i].status_changed = 0;
hfp_emit_ag_indicator_status_event(hfp_connection, &hfp_connection->ag_indicators[i]);
}
// restore volume settings
hfp_connection->speaker_gain = hfp_hf_speaker_gain;
hfp_connection->send_speaker_gain = 1;