return ERRCODE_SUCC;
}
-//设置4G能力开关是否开启
+
+void cat1_api_suspend_protocol(void)
+{
+ #ifdef SUPPORT_LWIP
+ tcpip_thread_suspend();
+ slipif_loop_thread_suspend();
+ #endif
+}
+
+/**
+ * @brief 恢复SLIP协议栈 (SLIP模式专用实现)
+ *
+ * 注意:
+ * - 本函数仅在 SLIP 模式下编译使用
+ * - PPP 模式下,该函数在 ppp_cat1_api.c 中实现
+ *
+ * 功能:
+ * 1. 恢复lwIP tcpip线程
+ * 2. 恢复SLIP接收线程
+ */
+void cat1_api_resume_protocol(void)
+{
+ #ifdef SUPPORT_LWIP
+ tcpip_thread_resume();
+ slipif_loop_thread_resume();
+ #endif
+
+}
+
+/**
+ * @brief 设置4G能力开关是否开启 (SLIP模式专用实现)
+ *
+ * 注意:
+ * - 本函数仅在 SLIP 模式下编译使用
+ * - PPP 模式下,该函数在 ppp_cat1_api.c 中实现
+ *
+ * @param isopen true=开机, false=关机
+ */
void cat1_api_enable_cat1(bool isopen)
{
errcode_t ret = 0;
if(cat1_api_runtime_get_cat1_powerstat())
return;
-#ifdef SUPPORT_LWIP
- tcpip_thread_resume();
- slipif_loop_thread_resume();
-#endif
+ cat1_api_resume_protocol();
cat1_api_power_on_cat1();
// if(!cat1_api_runtime_get_saveele_status())
{
{
// if(!cat1_api_runtime_get_cat1_powerstat())
// return;
-#ifdef SUPPORT_LWIP
- tcpip_thread_suspend();
- slipif_loop_thread_suspend();
-#endif
+
+ cat1_api_suspend_protocol();
cat1_api_power_off_cat1();
// if(!cat1_api_runtime_get_saveele_status())
{
}
-
static bool g_enable_uart_rx = true;
/**
* return uart enable flag
//来电
int cat1_handle_call_incomming(char * msg);
+void cat1_api_suspend_protocol(void);
+void cat1_api_resume_protocol(void);
errcode_t permition_verify(void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include <math.h>
#include "cat1_log.h"
#include "osal_task.h"
+#include "cat1_utils.h" // For cat1_api_suspend_protocol/cat1_api_resume_protocol
#ifdef __cplusplus
#endif
}
+/**
+ * @brief AT^CAT1SUSPEND - 挂起CAT1协议栈
+ *
+ * 功能:调用cat1_api_suspend_protocol()挂起:
+ * - lwIP tcpip线程
+ * - SLIP/PPP接收线程
+ *
+ * 用途:系统进入休眠前调用
+ */
+static errcode_t at_cat1_suspend_protocol(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ UNUSED(para);
+ UNUSED(paraLen);
+ UNUSED(strCommonCmd);
+
+ cat1_print_info("=== AT^CAT1SUSPEND: Suspending CAT1 protocol stack ===\n");
+
+ // 调用 cat1_api_suspend_protocol,它会根据编译宏自动选择:
+ // #ifdef SUPPORT_PPP_SERVICE -> ppp_suspend()
+ // #else -> slipif_loop_thread_suspend()
+ // 同时挂起 lwIP tcpip 线程
+ cat1_api_suspend_protocol();
+
+ cat1_print_info("AT^CAT1SUSPEND: CAT1 protocol stack suspended successfully\n");
+ cat1_print_info(" - lwIP tcpip thread suspended\n");
+ cat1_print_info(" - Network threads suspended\n");
+ cat1_print_info(" - System ready for deep sleep\n");
+
+ return ERRCODE_SUCC;
+}
+
+/**
+ * @brief AT^CAT1RESUME - 恢复CAT1协议栈
+ *
+ * 功能:调用cat1_api_resume_protocol()恢复:
+ * - lwIP tcpip线程
+ * - SLIP/PPP接收线程
+ *
+ * 用途:系统从休眠恢复后调用
+ */
+static errcode_t at_cat1_resume_protocol(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ UNUSED(para);
+ UNUSED(paraLen);
+ UNUSED(strCommonCmd);
+
+ cat1_print_info("=== AT^CAT1RESUME: Resuming CAT1 protocol stack ===\n");
+
+ // 调用 cat1_api_resume_protocol,它会根据编译宏自动选择:
+ // #ifdef SUPPORT_PPP_SERVICE -> ppp_resume()
+ // #else -> slipif_loop_thread_resume()
+ // 同时恢复 lwIP tcpip 线程
+ cat1_api_resume_protocol();
+
+ cat1_print_info("AT^CAT1RESUME: CAT1 protocol stack resumed successfully\n");
+ cat1_print_info(" - lwIP tcpip thread resumed\n");
+ cat1_print_info(" - Network threads resumed\n");
+ cat1_print_info(" - System ready for normal operation\n");
+
+ return ERRCODE_SUCC;
+}
+
static const at_cmd_table_t g_cat1_cmd[] = {
{ (char *)"AT^CAT1POWER", cat1_power, (char *)"1" },
{ (char *)"AT^CAT1DIAL", at_cat1_dial, (char *)"1" },
{ (char *)"AT^SENDDTMF", at_cat1_senddtmf, (char *)"1" },
{ (char *)"AT^HTTPDOWNLOAD", custom_start_ota_download, (char *)" " },
{ (char *)"AT^CAT1LOGLEVEL", custom_enable_cat1_debug_log, (char *)" " },
+ /* CAT1休眠/唤醒控制指令 (支持PPP和SLIP两种协议) */
+ { (char *)"AT^CAT1SUSPEND", at_cat1_suspend_protocol, (char *)" " },
+ { (char *)"AT^CAT1RESUME", at_cat1_resume_protocol, (char *)" " },
#ifdef SUPPORT_ZHIHUI_WEBSOCKET
{ (char *)"AT^WEBSOCKETTEST", at_websocket_test_start, (char *)"serverip,port,test_time" },
{ (char *)"AT^STOPWEBSOCKET", at_websocket_test_stop, (char *)" " },
// 定时器相关变量
static osTimerId_t g_ppp_update_timer_handle = nullptr;
-static bool g_ppp_timer_running = false;
+static bool g_ppp_test_timer_running = false;
#ifdef SUPPORT_PPP_SERVICE
// 前向声明
static void ppp_update_timer_callback(void* arg) {
(void)arg; // 未使用的参数
- if (!g_ppp_init_completed || !g_ppp_timer_running) {
+ if (!g_ppp_init_completed || !g_ppp_test_timer_running) {
return;
}
// 启动定时器
static void start_ppp_update_timer() {
- if (g_ppp_timer_running) {
+ if (g_ppp_test_timer_running) {
printf("PPP更新定时器已经在运行\n");
return;
}
if (g_ppp_update_timer_handle != nullptr) {
osStatus_t status = osTimerStart(g_ppp_update_timer_handle, 3000); // 3秒间隔
if (status == osOK) {
- g_ppp_timer_running = true;
+ g_ppp_test_timer_running = true;
printf("PPP更新定时器启动成功,间隔3秒\n");
} else {
printf("PPP更新定时器启动失败: %d\n", status);
// 停止定时器
static void stop_ppp_update_timer() {
- if (!g_ppp_timer_running || g_ppp_update_timer_handle == nullptr) {
+ if (!g_ppp_test_timer_running || g_ppp_update_timer_handle == nullptr) {
printf("PPP更新定时器未运行\n");
return;
}
printf("PPP更新定时器停止失败: %d\n", status);
}
- g_ppp_timer_running = false;
+ g_ppp_test_timer_running = false;
g_ppp_update_timer_handle = nullptr;
}
#include "ConfigModelC.h"
#include "osal_task.h"
#include "custom_utils.h" // 添加:用于uapi_create_osThread_custom_with_args
+#include "cat1_utils.h" // 添加:用于cat1_api_suspend/resume_protocol
return ERRCODE_SUCC;
}
+/**
+ * @brief AT^PPPSUSPEND - 挂起PPP和CAT1协议栈
+ *
+ * 功能:调用cat1_api_suspend_protocol()挂起:
+ * - lwIP tcpip线程
+ * - SLIP/PPP接收线程
+ *
+ * 用途:系统进入休眠前调用
+ */
+static errcode_t at_ppp_suspend_protocol(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ UNUSED(para);
+ UNUSED(paraLen);
+ UNUSED(strCommonCmd);
+
+ ppp_print_info("=== AT^PPPSUSPEND: Suspending protocol stack ===\n");
+
+ // 调用CAT1的suspend函数,它会根据宏定义调用对应的suspend
+ // #ifdef SUPPORT_PPP_SERVICE -> ppp_suspend()
+ // #else -> slipif_loop_thread_suspend()
+ cat1_api_suspend_protocol();
+
+ ppp_print_info("AT^PPPSUSPEND: Protocol stack suspended successfully\n");
+ ppp_print_info(" - lwIP tcpip thread suspended\n");
+ ppp_print_info(" - PPP/SLIP receive thread suspended\n");
+ ppp_print_info(" - System ready for deep sleep\n");
+
+ return ERRCODE_SUCC;
+}
+
+/**
+ * @brief AT^PPPRESUME - 恢复PPP和CAT1协议栈
+ *
+ * 功能:调用cat1_api_resume_protocol()恢复:
+ * - lwIP tcpip线程
+ * - SLIP/PPP接收线程
+ *
+ * 用途:系统从休眠恢复后调用
+ */
+static errcode_t at_ppp_resume_protocol(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ UNUSED(para);
+ UNUSED(paraLen);
+ UNUSED(strCommonCmd);
+
+ ppp_print_info("=== AT^PPPRESUME: Resuming protocol stack ===\n");
+
+ // 调用CAT1的resume函数,它会根据宏定义调用对应的resume
+ // #ifdef SUPPORT_PPP_SERVICE -> ppp_resume()
+ // #else -> slipif_loop_thread_resume()
+ cat1_api_resume_protocol();
+
+ ppp_print_info("AT^PPPRESUME: Protocol stack resumed successfully\n");
+ ppp_print_info(" - lwIP tcpip thread resumed\n");
+ ppp_print_info(" - PPP/SLIP receive thread resumed\n");
+ ppp_print_info(" - System ready for normal operation\n");
+
+ return ERRCODE_SUCC;
+}
+
static const at_cmd_table_t g_ppp_cmd[] = {
{ (char *)"AT^CAT1POWER", cat1_power, (char *)"1" },
{ (char *)"AT^CAT1GETSIGNAL", at_cat1_getsignal, (char *)"1" },
{ (char *)"AT^CAT1AT", at_cat1_atcmd, (char *)"1" },
{ (char *)"AT^HTTPDOWNLOAD", custom_start_ota_download, (char *)" " },
{ (char *)"AT^CAT1LOGLEVEL", custom_enable_cat1_debug_log, (char *)" " },
+ /* PPP休眠/唤醒控制指令 (仅在PPP模式下可用) */
+ { (char *)"AT^CAT1SUSPEND", at_ppp_suspend_protocol, (char *)" " },
+ { (char *)"AT^cAT1RESUME", at_ppp_resume_protocol, (char *)" " },
/* PPP串口测试指令 */
{ (char *)"AT^PPPSTATUS", at_ppp_status, (char *)" " },
{ (char *)"AT^PPPTRANS", at_ppp_transparent, (char *)"AT_COMMAND" },
*/
void ppp_lwip_print_mru_status(void);
+
+
+/**
+ * @brief PPP模块挂起
+ */
+void ppp_suspend(void);
+
+/**
+ * @brief PPP模块恢复
+ */
+void ppp_resume(void);
+
#ifdef __cplusplus
}
#endif
*/
void ppp_api_keep_wakeup(uint8_t keep_wakeup);
-/**
- * @brief PPP模块挂起
- */
-void ppp_suspend(void);
-
-/**
- * @brief PPP模块恢复
- */
-void ppp_resume(void);
/**
* @brief PPP模块注册4G控制引脚配置
#include "schedule/osal_task.h"
#include "securec.h"
#include "ppp_log.h"
+#include "custom_utils.h" // 添加线程挂起/恢复API
// lwIP头文件,用于访问netif结构体和系统抽象层
#ifdef LWIP_PPP_SUPPORT
PPP_DEBUG_CRITICAL("=== End Signal Summary ===");
return ERRCODE_SUCC;
+}
+
+
+/**
+ * @brief PPP模块挂起 - 用于系统休眠,暂停线程和定时器
+ *
+ * 实现说明(参考slipif_loop_thread_suspend):
+ * 1. 设置运行标志为false(线程会进入长时间休眠)
+ * 2. 停止定时器
+ * 3. 挂起线程(使用系统API)
+ * 4. 不操作4G模块(只在需要发送数据时才唤醒)
+ */
+void ppp_suspend(void)
+{
+ PPP_DEBUG_CRITICAL("=== PPP Suspend Started ===");
+
+#if PPP_USE_INTERRUPT_MODE
+ // 中断模式:暂停IRQ处理线程
+ extern volatile bool g_ppp_irq_task_running;
+ extern uint32_t g_ppp_irq_process_task;
+ extern volatile bool g_ppp_timer_running;
+ extern osal_timer g_ppp_timeout_timer;
+
+ // 1. 设置运行标志为false
+ g_ppp_irq_task_running = false;
+
+ // 2. 停止定时器
+ if (g_ppp_timer_running) {
+ g_ppp_timer_running = false;
+ osal_timer_stop(&g_ppp_timeout_timer);
+ PPP_DEBUG_INFO("PPP timeout timer stopped");
+ }
+
+ // 3. 挂起线程
+ if (g_ppp_irq_process_task != 0) {
+ int ret = uapi_suspend_thread((unsigned long)g_ppp_irq_process_task);
+ if (ret != ERRCODE_SUCC) {
+ PPP_DEBUG_ERROR("Failed to suspend IRQ process thread: %d", ret);
+ } else {
+ PPP_DEBUG_INFO("PPP IRQ process thread suspended");
+ }
+ }
+#else
+ // 轮询模式:暂停接收线程和处理线程
+ extern volatile bool g_ppp_rx_thread_running;
+ extern volatile bool g_ppp_process_thread_running;
+ extern uint32_t g_ppp_rx_thread_handle;
+ extern uint32_t g_ppp_process_thread_handle;
+ extern volatile bool g_ppp_timer_running;
+ extern osal_timer g_ppp_timeout_timer;
+
+ // 1. 设置运行标志为false
+ g_ppp_rx_thread_running = false;
+ g_ppp_process_thread_running = false;
+
+ // 2. 停止定时器
+ if (g_ppp_timer_running) {
+ g_ppp_timer_running = false;
+ osal_timer_stop(&g_ppp_timeout_timer);
+ PPP_DEBUG_INFO("PPP timeout timer stopped");
+ }
+
+ // 3. 挂起接收线程
+ if (g_ppp_rx_thread_handle != 0) {
+ int ret = uapi_suspend_thread((unsigned long)g_ppp_rx_thread_handle);
+ if (ret != ERRCODE_SUCC) {
+ PPP_DEBUG_ERROR("Failed to suspend RX thread: %d", ret);
+ } else {
+ PPP_DEBUG_INFO("PPP receive thread suspended");
+ }
+ }
+
+ // 4. 挂起处理线程
+ if (g_ppp_process_thread_handle != 0) {
+ int ret = uapi_suspend_thread((unsigned long)g_ppp_process_thread_handle);
+ if (ret != ERRCODE_SUCC) {
+ PPP_DEBUG_ERROR("Failed to suspend process thread: %d", ret);
+ } else {
+ PPP_DEBUG_INFO("PPP process thread suspended");
+ }
+ }
+#endif
+
+ PPP_DEBUG_CRITICAL("=== PPP Suspended (threads and timer stopped) ===");
+ PPP_DEBUG_INFO("Note: 4G module not affected, will be woken up when data needs to be sent");
+}
+
+/**
+ * @brief PPP模块恢复 - 从系统休眠恢复,重启线程和定时器
+ *
+ * 实现说明(参考slipif_loop_thread_resume):
+ * 1. 设置运行标志为true
+ * 2. 恢复线程
+ * 3. 重启定时器
+ * 4. 不操作4G模块
+ */
+void ppp_resume(void)
+{
+ PPP_DEBUG_CRITICAL("=== PPP Resume Started ===");
+
+#if PPP_USE_INTERRUPT_MODE
+ // 中断模式:恢复IRQ处理线程
+ extern volatile bool g_ppp_irq_task_running;
+ extern uint32_t g_ppp_irq_process_task;
+ extern volatile bool g_ppp_timer_running;
+ extern osal_timer g_ppp_timeout_timer;
+
+ // 1. 设置运行标志为true
+ g_ppp_irq_task_running = true;
+
+ // 2. 恢复线程
+ if (g_ppp_irq_process_task != 0) {
+ int ret = uapi_resume_thread((unsigned long)g_ppp_irq_process_task);
+ if (ret != ERRCODE_SUCC) {
+ PPP_DEBUG_ERROR("Failed to resume IRQ process thread: %d", ret);
+ } else {
+ PPP_DEBUG_INFO("PPP IRQ process thread resumed");
+ }
+ }
+
+ // 3. 重启定时器
+ if (!g_ppp_timer_running) {
+ g_ppp_timer_running = true;
+ int ret = osal_timer_start(&g_ppp_timeout_timer);
+ if (ret != OSAL_SUCCESS) {
+ PPP_DEBUG_ERROR("Failed to restart timeout timer: 0x%x", ret);
+ g_ppp_timer_running = false;
+ } else {
+ PPP_DEBUG_INFO("PPP timeout timer restarted");
+ }
+ }
+#else
+ // 轮询模式:恢复接收线程和处理线程
+ extern volatile bool g_ppp_rx_thread_running;
+ extern volatile bool g_ppp_process_thread_running;
+ extern uint32_t g_ppp_rx_thread_handle;
+ extern uint32_t g_ppp_process_thread_handle;
+ extern volatile bool g_ppp_timer_running;
+ extern osal_timer g_ppp_timeout_timer;
+
+ // 1. 设置运行标志为true
+ g_ppp_rx_thread_running = true;
+ g_ppp_process_thread_running = true;
+
+ // 2. 恢复处理线程
+ if (g_ppp_process_thread_handle != 0) {
+ int ret = uapi_resume_thread((unsigned long)g_ppp_process_thread_handle);
+ if (ret != ERRCODE_SUCC) {
+ PPP_DEBUG_ERROR("Failed to resume process thread: %d", ret);
+ } else {
+ PPP_DEBUG_INFO("PPP process thread resumed");
+ }
+ }
+
+ // 3. 恢复接收线程
+ if (g_ppp_rx_thread_handle != 0) {
+ int ret = uapi_resume_thread((unsigned long)g_ppp_rx_thread_handle);
+ if (ret != ERRCODE_SUCC) {
+ PPP_DEBUG_ERROR("Failed to resume RX thread: %d", ret);
+ } else {
+ PPP_DEBUG_INFO("PPP receive thread resumed");
+ }
+ }
+
+ // 4. 重启定时器
+ if (!g_ppp_timer_running) {
+ g_ppp_timer_running = true;
+ int ret = osal_timer_start(&g_ppp_timeout_timer);
+ if (ret != OSAL_SUCCESS) {
+ PPP_DEBUG_ERROR("Failed to restart timeout timer: 0x%x", ret);
+ g_ppp_timer_running = false;
+ } else {
+ PPP_DEBUG_INFO("PPP timeout timer restarted");
+ }
+ }
+#endif
+
+ PPP_DEBUG_CRITICAL("=== PPP Resumed (threads and timer restarted) ===");
+ PPP_DEBUG_INFO("Note: 4G module will be woken up when data needs to be sent");
}
\ No newline at end of file
ppp_ring_isr_callback(pin, param);
}
+/********************** 协议栈休眠/唤醒接口 (PPP专用) **********************/
+
+/**
+ * @brief 挂起PPP协议栈 (PPP模式专用实现)
+ *
+ * 功能:
+ * 1. 挂起lwIP tcpip线程
+ * 2. 挂起PPP接收/处理线程
+ * 3. 停止PPP定时器
+ */
+void cat1_api_suspend_protocol(void)
+{
+ PPP_DEBUG_INFO("=== PPP: cat1_api_suspend_protocol (PPP mode) ===\n");
+
+ // 1. 挂起lwIP tcpip线程
+ #ifdef SUPPORT_LWIP
+ tcpip_thread_suspend();
+ PPP_DEBUG_INFO("PPP: lwIP tcpip thread suspended\n");
+ #endif
+
+ // 2. 挂起PPP协议栈 (PPP专用)
+ extern void ppp_suspend(void);
+ ppp_suspend();
+ PPP_DEBUG_INFO("PPP: PPP protocol stack suspended\n");
+
+ PPP_DEBUG_INFO("=== PPP: Protocol stack suspended successfully ===\n");
+}
+
+/**
+ * @brief 恢复PPP协议栈 (PPP模式专用实现)
+ *
+ * 功能:
+ * 1. 恢复lwIP tcpip线程
+ * 2. 恢复PPP接收/处理线程
+ * 3. 重启PPP定时器
+ */
+void cat1_api_resume_protocol(void)
+{
+ PPP_DEBUG_INFO("=== PPP: cat1_api_resume_protocol (PPP mode) ===\n");
+
+ // 1. 恢复lwIP tcpip线程
+ #ifdef SUPPORT_LWIP
+ tcpip_thread_resume();
+ PPP_DEBUG_INFO("PPP: lwIP tcpip thread resumed\n");
+ #endif
+
+ // 2. 恢复PPP协议栈 (PPP专用)
+ extern void ppp_resume(void);
+ ppp_resume();
+ PPP_DEBUG_INFO("PPP: PPP protocol stack resumed\n");
+
+ PPP_DEBUG_INFO("=== PPP: Protocol stack resumed successfully ===\n");
+}
+
/********************** 其他接口(暂时返回默认值或空实现) **********************/
/**
static volatile bool g_ppp_interrupt_enabled = false;
/* 处理线程相关 */
-static uint32_t g_ppp_irq_process_task = 0; // 改为uint32_t以配合uapi_create_osThread_custom
+// 中断模式全局变量(供 ppp_suspend/resume 访问)
+uint32_t g_ppp_irq_process_task = 0; // 改为uint32_t以配合uapi_create_osThread_custom
static unsigned long g_ppp_irq_msg_queue = 0; // 消息队列ID (OSAL使用unsigned long)
-static volatile bool g_ppp_irq_task_running = false;
+volatile bool g_ppp_irq_task_running = false; // 移除 static,供外部访问
/* 乒乓缓冲区(动态分配,避免占用DTCM) */
static ppp_ping_pong_buffer_t *g_ping_pong_buffers = NULL; // 改为指针,通过malloc动态分配
static volatile uint32_t g_timer_timestamp_ms = 0;
/* 定时器相关 */
-static osal_timer g_ppp_timeout_timer;
-static volatile bool g_ppp_timer_running = false;
+// Timer 全局变量(供 ppp_suspend/resume 访问)
+osal_timer g_ppp_timeout_timer; // 移除 static
+volatile bool g_ppp_timer_running = false; // 移除 static
/* 统计信息 */
static ppp_interrupt_stats_t g_ppp_interrupt_stats = {0};
} ppp_msg_t;
/* PPP线程相关 */
-static uint32_t g_ppp_rx_thread_handle = 0; // 接收线程句柄
-static uint32_t g_ppp_process_thread_handle = 0; // 处理线程句柄
-static volatile bool g_ppp_rx_thread_running = false;
-static volatile bool g_ppp_process_thread_running = false;
+// 轮询模式全局变量(供 ppp_suspend/resume 访问)
+uint32_t g_ppp_rx_thread_handle = 0; // 接收线程句柄,移除 static
+uint32_t g_ppp_process_thread_handle = 0; // 处理线程句柄,移除 static
+volatile bool g_ppp_rx_thread_running = false; // 移除 static,供外部访问
+volatile bool g_ppp_process_thread_running = false; // 移除 static,供外部访问
static volatile bool g_ppp_rx_thread_completed = false;
static volatile bool g_ppp_process_thread_completed = false;
static ppp_ping_pong_buffer_t g_ping_pong_buffers[PPP_PING_PONG_BUFFER_COUNT];
static volatile uint8_t g_current_buffer_index = 0; // ⚠️ volatile不保证原子性,但单字节写入在ARM上通常是原子的
-/* 定时器相关 */
-static osal_timer g_ppp_timeout_timer;
-static volatile bool g_ppp_timer_running = false;
+/* 定时器相关(轮询模式使用,但在中断模式下也需要,所以放在 ppp_api.c 中统一定义) */
+// Timer 变量在 ppp_interrupt.c 中定义(中断模式)
+// 轮询模式和中断模式共享这些变量
+extern osal_timer g_ppp_timeout_timer;
+extern volatile bool g_ppp_timer_running;
/* 统计信息 */
typedef struct {
PPP_DEBUG_PRINT("PPP: Keep wakeup Cat1: %d\n", keep_wakeup);
}
-/**
- * @brief PPP模块挂起
- */
-void ppp_suspend(void)
-{
- PPP_DEBUG_PRINT("PPP: Module suspended\n");
-}
-
-/**
- * @brief PPP模块恢复
- */
-void ppp_resume(void)
-{
- PPP_DEBUG_PRINT("PPP: Module resumed\n");
-}
-
/**
* @brief PPP模块注册4G控制引脚配置
*/