# 头文件目录
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
)
# 包含目录
#include "securec.h"
#include "platform_core.h"
#include <string.h>
+#include "pm_definition.h"
+#include "pm.h"
// 兼容cat1Service的类型定义
typedef enum _4g_message {
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;
+}
+
/********************** 运行时状态获取接口 **********************/
/**
}
}
-/* 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
*/