修复leiniao编译问题 2251/1 2251/head
author孙春阳 <snickersun@163.com>
Tue, 16 Sep 2025 01:35:06 +0000 (09:35 +0800)
committer孙春阳 <snickersun@163.com>
Tue, 16 Sep 2025 01:35:16 +0000 (09:35 +0800)
code/sdk/zhihui/ppp/CMakeLists.txt
code/sdk/zhihui/ppp/src/ppp_cat1_api.c
code/sdk/zhihui/ppp/src/ppp_lwip.c
code/sdk/zhihui/ppp/src/ppp_lwip_thread.c

index 9611043..ec64279 100644 (file)
@@ -26,18 +26,11 @@ set(SOURCES
 
 # 头文件目录
 set(PUBLIC_HEADER
-    include/ppp_api.h
-    include/ppp_config.h
-    include/ppp_types.h
-    include/ppp_power_ctl.h
-    include/ppp_cat1_api.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/include
 )
 
 set(PRIVATE_HEADER
-    include/ppp_at_handler.h
-    include/ppp_serial.h
-    include/ppp_lwip.h
-    include/ppp_debug.h
+    ${ROOT_DIR}/middleware/chips/brandy/pm/include
 )
 
 # 包含目录
index 29a21d1..4aa5640 100644 (file)
@@ -11,6 +11,8 @@
 #include "securec.h"
 #include "platform_core.h"
 #include <string.h>
+#include "pm_definition.h"
+#include "pm.h"
 
 // 兼容cat1Service的类型定义
 typedef enum _4g_message {
@@ -179,6 +181,33 @@ bool cat1_api_custom_is_cmd_rx_enabled(void)
     return true;
 }
 
+void cat1_api_remove_cat1_vote(void)
+{
+    uint8_t cnt = pm_veto_get_id_cnt(PM_ID_CAT1);
+    if (cnt == 1) {
+        uapi_pm_remove_sleep_veto(PM_ID_CAT1);
+    } else {
+        // PPP_DEBUG_PRINT("CAT1 SERVICE MCU has delete pm_id_cat1 vote\r\n");
+    }
+    PPP_DEBUG_PRINT("\r\nCAT1 SERVICE MCU SLEEP SUCCESS\r\n");
+}
+
+void cat1_api_add_cat1_vote(void)
+{
+    uint8_t cnt = pm_veto_get_id_cnt(PM_ID_CAT1);
+    if (cnt == 0) {
+        uapi_pm_add_sleep_veto(PM_ID_CAT1);
+    } else {
+        // PPP_DEBUG_PRINT("CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n");
+    }
+    PPP_DEBUG_PRINT("\r\nCAT1 SERVICE MCU WAKEUP SUCCESS\r\n");
+}
+
+errcode_t cat1_api_disable_cat1_cmd(uint8_t disable_cmd)
+{
+    return ERRCODE_SUCC;
+}
+
 /********************** 运行时状态获取接口 **********************/
 
 /**
index f105f00..d8978d5 100644 (file)
@@ -716,39 +716,6 @@ static void ppp_lwip_netif_status_callback(struct netif *netif)
     }
 }
 
-/* PPP协议解析辅助函数 */
-static const char* ppp_get_protocol_name(uint16_t protocol)
-{
-    switch (protocol) {
-        case 0xC021: return "LCP";
-        case 0x8021: return "IPCP";
-        case 0xC023: return "PAP";
-        case 0xC223: return "CHAP";
-        case 0x0021: return "IP";
-        case 0x002D: return "VJ_COMP_TCP";
-        case 0x002F: return "VJ_UNCOMP_TCP";
-        default: return "UNKNOWN";
-    }
-}
-
-static const char* ppp_get_lcp_code_name(uint8_t code)
-{
-    switch (code) {
-        case 1: return "Configure-Request";
-        case 2: return "Configure-Ack";
-        case 3: return "Configure-Nak";
-        case 4: return "Configure-Reject";
-        case 5: return "Terminate-Request";
-        case 6: return "Terminate-Ack";
-        case 7: return "Code-Reject";
-        case 8: return "Protocol-Reject";
-        case 9: return "Echo-Request";
-        case 10: return "Echo-Reply";
-        case 11: return "Discard-Request";
-        default: return "Unknown";
-    }
-}
-
 /**
  * @brief PPP输出回调函数 - 使用自定义串口接口,不依赖SIO
  */
index 9acbfc0..a267379 100644 (file)
@@ -230,6 +230,8 @@ ppp_error_t ppp_lwip_stop_receive_thread(void)
     PPP_DEBUG_INFO("PPP lwIP receive thread stopped");
     return PPP_ERR_OK;
 }
+
+/**
  * @brief 检查PPP接收线程是否运行
  */
 bool ppp_lwip_is_receive_thread_running(void)