From a9e632e9130abf3d16ab069ece35e9853dcc0762 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 18 Aug 2021 00:24:17 +0200 Subject: [PATCH] hfp: rename VRA events to match the API functions --- example/hfp_ag_demo.c | 23 ++++++++++++----------- example/hfp_hf_demo.c | 21 +++++++++++---------- src/btstack_defines.h | 4 ++-- src/btstack_event.h | 20 ++++++++++---------- src/classic/hfp.c | 5 +++-- 5 files changed, 38 insertions(+), 35 deletions(-) diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index c7ac8226f..2ae0a6192 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -109,7 +109,7 @@ static hfp_generic_status_indicator_t hf_indicators[] = { }; static hfp_voice_recognition_message_t msg = { - 0xABCD, HFP_TEXT_TYPE_MESSAGE_FROM_AG, HFP_TEXT_OPERATION_REPLACE, "test message" + 0xABCD, HFP_TEXT_TYPE_MESSAGE_FROM_AG, HFP_TEXT_OPERATION_REPLACE, "The temperature in Munich" }; #define INQUIRY_INTERVAL 5 @@ -595,30 +595,30 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even hfp_ag_send_dtmf_code_done(acl_handle); break; - case HFP_SUBEVENT_VOICE_RECOGNITION_ENABLED: - status = hfp_subevent_voice_recognition_enabled_get_status(event); + case HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED: + status = hfp_subevent_voice_recognition_activated_get_status(event); if (status != ERROR_CODE_SUCCESS){ - printf("Voice Recognition Enable command failed\n"); + printf("Voice Recognition Activate command failed\n"); break; } - switch (hfp_subevent_voice_recognition_enabled_get_enhanced(event)){ + switch (hfp_subevent_voice_recognition_activated_get_enhanced(event)){ case 1: - printf("\nVoice recognition status ENABLED\n\n"); + printf("\nVoice recognition ACTVATED\n\n"); break; default: - printf("\nEnhanced voice recognition status ENABLED\n\n"); + printf("\nEnhanced voice recognition ACTVATED\n\n"); break; } break; - case HFP_SUBEVENT_VOICE_RECOGNITION_DISABLED: - status = hfp_subevent_voice_recognition_disabled_get_status(event); + case HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED: + status = hfp_subevent_voice_recognition_deactivated_get_status(event); if (status != ERROR_CODE_SUCCESS){ - printf("Voice Recognition Disable command failed\n"); + printf("Voice Recognition Deactivate command failed\n"); break; } - printf("Voice Recognition DISABLED\n"); + printf("Voice Recognition DEACTIVATED\n"); break; case HFP_SUBEVENT_ENHANCED_VOICE_RECOGNITION_HF_READY_FOR_AUDIO: @@ -717,6 +717,7 @@ int btstack_main(int argc, const char * argv[]){ (1<acl_handle); event[5] = status; // 0:success @@ -373,7 +373,7 @@ void hfp_emit_voice_recognition_disabled(hfp_connection_t * hfp_connection, uint uint8_t event[6]; event[0] = HCI_EVENT_HFP_META; event[1] = sizeof(event) - 2; - event[2] = HFP_SUBEVENT_VOICE_RECOGNITION_DISABLED; + event[2] = HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED; little_endian_store_16(event, 3, hfp_connection->acl_handle); event[5] = status; // 0:success @@ -1703,6 +1703,7 @@ static void parse_sequence(hfp_connection_t * hfp_connection){ break; case 5: hfp_connection->ag_vra_msg_length = hfp_connection->line_size; + log_info("VRA message of length %d", hfp_connection->ag_vra_msg_length); break; default: break;