From: xue <2144439972@qq.com> Date: Fri, 28 Nov 2025 04:19:19 +0000 (+0800) Subject: 修复编译bug X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c2e83a8ee9ce1f5a81f3962e1dcef622f351a14a;p=mirrors%2FFD230.git 修复编译bug --- diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c index c16ae2fb1..784161661 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c @@ -1386,6 +1386,7 @@ int ln_ws_vad_auth(void) struct AuthInfo auth_info; memset(&auth_info, 0, sizeof(auth_info)); strcpy(auth_info.dmp_token, dmp_token); + int ret = auth_vad(&auth_info); LN_WS_INFO("VAD auth result after login: %d, token: %s, retry_count=%d\n", ret, auth_info.dmp_token, retry_count); task_dmp_auth = 1; diff --git a/code/sdk/zhihui/ppp/include/ppp_cat1_api.h b/code/sdk/zhihui/ppp/include/ppp_cat1_api.h index 43cdf4b0d..00e5b29ce 100644 --- a/code/sdk/zhihui/ppp/include/ppp_cat1_api.h +++ b/code/sdk/zhihui/ppp/include/ppp_cat1_api.h @@ -16,11 +16,65 @@ extern "C" { #include "errcode.h" #include "platform_core.h" -// 前向声明,避免重复定义 -typedef enum _4g_cmd CMD_4G_T; -typedef struct ctl_pin_4g_s ctl_pin_4g_t; -typedef struct time_ctl_funcs_s time_ctl_funcs_t; -typedef errcode_t (*f_cat1_msg_callback)(int msg, void *msg_buf, uint16_t msglen); +// 兼容cat1Service的类型定义 +typedef enum _4g_message { + MESSAGE_4G_POWERON,//无参数 (BOOTUP) + MESSAGE_4G_POWEROFF,//无参数 + MESSAGE_4G_NETWORK_CONNECTED,//无参数 + MESSAGE_4G_NETWORK_DISCONNECTED,//无参数 + MESSAGE_4G_NETWORK_STAT_CHANGED,//含signal,sim,运营商, + MESSAGE_4G_CALL_COMMING,//带电话号 + MESSAGE_4G_CALL_CONNECTED,//带电话号 + MESSAGE_4G_CALL_DISCONNECTED,//带电话号 + MESSAGE_4G_SMS_RECEIVED, //返回值为字符串 + MESSAGE_4G_AT_RECEIVED, //返回值为字符串 + MESSAGE_4G_TIME_SYNCED,//时间同步完成 + MESSAGE_4G_VERSION_SYNCED,//版本同步完成 + MESSAGE_4G_MAX, +} MESSAGE_4G_T; + +typedef enum _4g_cmd { + CMD_4G_POWERON,//无参数 + CMD_4G_POWEROFF,//无参数 + CMD_4G_GET_SIGNAL,//无参数 + CMD_4G_GET_VERSION,//无参数 + CMD_4G_GET_TIME,//无参数 + CMD_4G_MAKE_CALL,//需要输入参数 电话号 + CMD_4G_ANSWER_CALL,//无参数 + CMD_4G_HUNGUP_CALL,//无参数 + CMD_4G_SEND_DTMF, //需要输入参数 DTMF NUM(单个数字) , 包括 0 ~ 9, * , # + CMD_4G_AT, //需要AT指令,要求结尾带\r\n + CMD_4G_MAX, +} CMD_4G_T; + +// 控制引脚配置结构 +typedef struct { + uint8_t bat_pin; //控制Cat1 battery 的gpio,没有控制,设置为 PIN_NONE 即可 + uint8_t bat_pin_en_value; + uint8_t pwr_pin; //控制cat1开机键的gpio + uint8_t pwr_pin_en_value; + uint8_t reset_pin; //控制cat1重置键的gpio + uint8_t reset_pin_en_value; + uint8_t ring_pin; //cat1唤醒蓝牙用的gpio + uint8_t ring_pin_en_value; + uint8_t wakemodem_pin; //蓝牙唤醒cat1用的gpio + uint8_t wakemodem_pin_en_value; +} ctl_pin_4g_t; + +// 时间控制函数类型 +typedef uint16_t (*f_get_timezone)(void); +typedef void (*f_set_timezone)(uint16_t timezone_quarters); +typedef uint32_t (*f_sync_time_utc)(uint32_t timestamp, uint32_t timezone_quarters); + +// 时间控制函数结构 +typedef struct { + f_get_timezone get_timezone; + f_set_timezone set_timezone; + f_sync_time_utc sync_time_utc; +} time_ctl_funcs_t; + +// 消息回调函数类型 +typedef errcode_t (*f_cat1_msg_callback)(MESSAGE_4G_T msg, void *msg_buf, uint16_t msglen); /********************** 主要接口 **********************/ @@ -196,6 +250,11 @@ errcode_t cat1_register_msg_callback(f_cat1_msg_callback func); */ errcode_t cat1_register_time_ctl_functions(time_ctl_funcs_t *funcs); +/** + * @brief 获取Cat1时间 + */ +void cat1_gettime(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/code/sdk/zhihui/ppp/src/ppp_cat1_api.c b/code/sdk/zhihui/ppp/src/ppp_cat1_api.c index 28b4d8fe1..5f62a0dba 100644 --- a/code/sdk/zhihui/ppp/src/ppp_cat1_api.c +++ b/code/sdk/zhihui/ppp/src/ppp_cat1_api.c @@ -509,4 +509,13 @@ errcode_t cat1_register_time_ctl_functions(time_ctl_funcs_t *funcs) // TODO: 实现PPP模块的时间控制函数注册 (void)funcs; return ERRCODE_SUCC; +} + +/** + * @brief 获取Cat1时间 + */ +void cat1_gettime(void) +{ + PPP_DEBUG_PRINT("PPP: cat1_gettime\n"); + cat1_cmd_send(CMD_4G_GET_TIME, NULL, 0); } \ No newline at end of file