修复编译问题 2528/1 2528/head 2529/target/1
authorpenglei <1624952103@qq.com>
Wed, 15 Oct 2025 10:35:02 +0000 (18:35 +0800)
committerpenglei <1624952103@qq.com>
Wed, 15 Oct 2025 10:35:02 +0000 (18:35 +0800)
code/sdk/zhihui/leiniao/factory_test/PPPTestView.cpp

index 2001cc0..9dfc9c2 100644 (file)
@@ -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();