From 9d323908ad2b1fa0659cdacc961af52540dfa756 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Wed, 15 Oct 2025 18:35:02 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E9=97=AE?= =?utf8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../leiniao/factory_test/PPPTestView.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/code/sdk/zhihui/leiniao/factory_test/PPPTestView.cpp b/code/sdk/zhihui/leiniao/factory_test/PPPTestView.cpp index 2001cc014..9dfc9c2a0 100644 --- a/code/sdk/zhihui/leiniao/factory_test/PPPTestView.cpp +++ b/code/sdk/zhihui/leiniao/factory_test/PPPTestView.cpp @@ -507,11 +507,12 @@ static bool g_ppp_init_completed = false; static osTimerId_t g_ppp_update_timer_handle = nullptr; static bool g_ppp_timer_running = false; +#ifdef SUPPORT_PPP_SERVICE // 前向声明 extern "C" { int ppp_test_stop_dial(void); } - +#endif // 更新信号质量信息显示 - 统一格式结构 static void update_signal_quality_display() { if (!g_ppp_init_completed) { @@ -757,26 +758,30 @@ static void update_imei_iccid_display() { // 切换到AT模式并继续后续操作 static void switch_to_at_mode_and_continue() { printf("=== 开始切换到AT模式 ===\n"); - + int ret = 0; +#ifdef SUPPORT_PPP_SERVICE // 调用ppp_test_stop_dial函数切换到AT模式 - int ret = ppp_test_stop_dial(); + ret = ppp_test_stop_dial(); +#endif if (ret == 0) { printf("PPP STOP DIAL: 成功切换到AT模式\n"); // 等待一段时间确保模式切换完成 osal_msleep(1000); - +#ifdef SUPPORT_PPP_SERVICE // 设置AT通信标志为true(解决之前的问题) extern void set_at_communication_and_baudrate_flag(bool flag); set_at_communication_and_baudrate_flag(true); +#endif printf("AT通信标志已设置为true\n"); } else { printf("PPP STOP DIAL: 切换到AT模式失败,错误码: %d\n", ret); - +#ifdef SUPPORT_PPP_SERVICE // 即使失败也尝试设置AT标志 extern void set_at_communication_and_baudrate_flag(bool flag); set_at_communication_and_baudrate_flag(true); +#endif printf("强制设置AT通信标志为true\n"); } @@ -792,11 +797,11 @@ static void ppp_update_timer_callback(void* arg) { } printf("=== 定时器触发:更新信号质量 ===\n"); - +#ifdef SUPPORT_PPP_SERVICE // 确保在AT模式下 extern void set_at_communication_and_baudrate_flag(bool flag); set_at_communication_and_baudrate_flag(true); - +#endif // 更新IMEI和ICCID信息(偶尔更新) static int update_counter = 0; if (update_counter % 10 == 0) { // 每10次更新一次IMEI/ICCID @@ -1143,9 +1148,10 @@ void refresh_ppp_test_data(void) if (g_simple_ppp_container != nullptr && g_ppp_init_completed) { // 确保在AT模式下进行刷新 printf("=== 刷新数据:确保AT模式 ===\n"); +#ifdef SUPPORT_PPP_SERVICE extern void set_at_communication_and_baudrate_flag(bool flag); set_at_communication_and_baudrate_flag(true); - +#endif // 重新获取最新的PPP信息 update_ppp_display_info(); -- 2.17.1