From 3d2764b55fe9016c6e71ea56c77ac33d8d59711b Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Tue, 13 Jul 2021 11:31:53 +0200 Subject: [PATCH] hfp_demo: enable Echo Canceling and Noise reduction --- example/hfp_ag_demo.c | 13 +++++++++++++ example/hfp_hf_demo.c | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index cd02fee18..fd831120c 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -446,6 +446,14 @@ static void stdin_process(char cmd){ } #endif +static void report_status(uint8_t status, const char * message){ + if (status != ERROR_CODE_SUCCESS){ + printf("%s command failed, status 0x%02x\n", message, status); + } else { + printf("%s command successful\n", message); + } +} + static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * event, uint16_t event_size){ UNUSED(channel); bd_addr_t addr; @@ -636,6 +644,10 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even break; } printf("\nEnhanced Voice recognition: AG SEND MSG \'%s\'\n\n", msg.text); + + case HFP_SUBEVENT_ECHO_CANCELING_AND_NOISE_REDUCTION_DEACTIVATE: + status = hfp_subevent_echo_canceling_and_noise_reduction_deactivate_get_status(event); + report_status(status, "Echo Canceling and Noise Reduction Deactivate"); break; default: @@ -690,6 +702,7 @@ int btstack_main(int argc, const char * argv[]){ (1<