From ba154fb3e1636de7dee103416420c6992e16738c Mon Sep 17 00:00:00 2001 From: yangfeng Date: Fri, 27 Mar 2026 10:51:39 +0800 Subject: [PATCH] fix(bt/example): Fixed the HFP printing issue in the CI test --- .../bluedroid/classic_bt/hfp_ag/main/Kconfig.projbuild | 6 ++++++ examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/main.c | 4 ++++ .../bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.all | 1 + .../bluedroid/classic_bt/hfp_ag/sdkconfig.ci.vohci | 1 + .../bluedroid/classic_bt/hfp_hf/main/Kconfig.projbuild | 6 ++++++ examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/main.c | 4 ++++ .../bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.all | 1 + .../bluedroid/classic_bt/hfp_hf/sdkconfig.ci.vohci | 1 + 8 files changed, 24 insertions(+) diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/Kconfig.projbuild index 5d40e1962d..2964c97b8c 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/Kconfig.projbuild @@ -4,4 +4,10 @@ menu "HFP Example Configuration" default "ESP_HFP_AG" help Use this option to set local device name. + + config EXAMPLE_ENABLE_CONSOLE_REPL + bool "Enable UART interactive console (REPL)" + default y + help + Enable UART interactive console (REPL) endmenu diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/main.c b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/main.c index 0e30854b20..eadb52f870 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/main.c +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/main.c @@ -22,7 +22,9 @@ #include "esp_hf_ag_api.h" #include "bt_app_hf.h" #include "gpio_pcm_config.h" +#if CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL #include "esp_console.h" +#endif #include "app_hf_msg_set.h" #define BT_HF_AG_TAG "HF_AG_DEMO_MAIN" @@ -131,6 +133,7 @@ void app_main(void) app_gpio_aec_io_cfg(); #endif /* ACOUSTIC_ECHO_CANCELLATION_ENABLE */ +#if CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL esp_console_repl_t *repl = NULL; esp_console_repl_config_t repl_config = ESP_CONSOLE_REPL_CONFIG_DEFAULT(); esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT(); @@ -152,4 +155,5 @@ void app_main(void) // start console REPL ESP_ERROR_CHECK(esp_console_start_repl(repl)); +#endif } diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.all b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.all index 1d7593af05..476154d9bb 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.all +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.all @@ -1,2 +1,3 @@ CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI=y CONFIG_EXAMPLE_LOCAL_DEVICE_NAME="${CI_PIPELINE_ID}_HFP" +CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL=n diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.vohci b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.vohci index 6b57232479..379a69c8b3 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.vohci +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/sdkconfig.ci.vohci @@ -9,3 +9,4 @@ CONFIG_BT_CLASSIC_ENABLED=y CONFIG_BT_HFP_ENABLE=y CONFIG_BT_HFP_AG_ENABLE=y CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI=y +CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL=n diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/Kconfig.projbuild index 65e04f08e6..dd98f3b64c 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/Kconfig.projbuild @@ -12,4 +12,10 @@ menu "HFP Example Configuration" default "ESP_HFP_AG" help Use this option to set target device name to connect. + + config EXAMPLE_ENABLE_CONSOLE_REPL + bool "Enable UART interactive console (REPL)" + default y + help + Enable UART interactive console (REPL) endmenu diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/main.c b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/main.c index 019566fb6e..230b72c9d2 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/main.c +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/main/main.c @@ -24,7 +24,9 @@ #include "esp_pbac_api.h" #include "bt_app_hf.h" #include "gpio_pcm_config.h" +#if CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL #include "esp_console.h" +#endif #include "app_hf_msg_set.h" #include "bt_app_pbac.h" @@ -216,6 +218,7 @@ void app_main(void) #if ACOUSTIC_ECHO_CANCELLATION_ENABLE app_gpio_aec_io_cfg(); #endif /* ACOUSTIC_ECHO_CANCELLATION_ENABLE */ +#if CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL esp_console_repl_t *repl = NULL; esp_console_repl_config_t repl_config = ESP_CONSOLE_REPL_CONFIG_DEFAULT(); esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT(); @@ -237,6 +240,7 @@ void app_main(void) // start console REPL ESP_ERROR_CHECK(esp_console_start_repl(repl)); +#endif } diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.all b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.all index 94fafd42ea..de5a2348c9 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.all +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.all @@ -1,2 +1,3 @@ CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI=y CONFIG_EXAMPLE_PEER_DEVICE_NAME="${CI_PIPELINE_ID}_HFP" +CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL=n diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.vohci b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.vohci index 6116dfe13c..d519f996e0 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.vohci +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_hf/sdkconfig.ci.vohci @@ -9,3 +9,4 @@ CONFIG_BT_CLASSIC_ENABLED=y CONFIG_BT_HFP_ENABLE=y CONFIG_BT_HFP_CLIENT_ENABLE=y CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI=y +CONFIG_EXAMPLE_ENABLE_CONSOLE_REPL=n