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) {
// 切换到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");
}
}
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
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();