#define SIO_IRQ_PROCESS_TASK_PRIO 24 // 处理线程优先级
#define SIO_IRQ_PROCESS_STACK_SIZE 4096 // 处理线程栈大小
+/* CAT1 vote 管理配置(与PPP保持一致) */
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+#define SIO_CAT1_VOTE_IDLE_MS 3000 // 3秒空闲后移除CAT1 vote
+#endif
+
/* 乒乓缓冲区状态 */
typedef enum {
SIO_BUFFER_STATE_EMPTY = 0, // 空闲,可以写入
/* 数据处理回调函数指针 - 用于将数据传递给SLIP */
static void (*g_sio_data_callback)(const uint8_t *data, uint32_t len) = NULL;
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+/* CAT1 vote 状态管理(与PPP保持一致) */
+static volatile bool g_sio_cat1_vote_added = false;
+static volatile uint32_t g_sio_last_rx_time_ms = 0; // 最后接收数据时间
+
+/* 外部函数声明(CAT1 API) */
+extern void cat1_api_add_cat1_vote(void);
+extern void cat1_api_remove_cat1_vote(void);
+#endif
+
/* 内部函数声明 */
static uint32_t sio_get_current_time_ms(void);
static errcode_t sio_flush_buffer(uint8_t buffer_index);
// ⚠️ 更新全局时间戳(供ISR使用,ISR中不能调用时间函数)
g_sio_timer_timestamp_ms = current_time;
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // ✅ CAT1 vote 管理:检测 idle 状态,超过阈值时移除 vote
+ if (g_sio_cat1_vote_added) {
+ if (g_sio_last_rx_time_ms > 0) {
+ uint32_t idle_time = current_time - g_sio_last_rx_time_ms;
+ if (idle_time >= SIO_CAT1_VOTE_IDLE_MS) {
+ // 空闲时间超过阈值,移除 vote 允许 CAT1 休眠
+ cat1_api_remove_cat1_vote();
+ g_sio_cat1_vote_added = false;
+ printf("[SIO_CAT1_VOTE] Removed vote after %ums idle\n", idle_time);
+ }
+ }
+ }
+#endif
+
if (g_sio_ping_pong_buffers == NULL) {
goto restart_timer;
}
g_sio_stats.total_interrupts++;
g_sio_stats.total_bytes_received += length;
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // ✅ 更新最后接收时间(用于空闲检测)
+ g_sio_last_rx_time_ms = g_sio_timer_timestamp_ms;
+
+ // ✅ CAT1 vote 管理:接收数据时添加 vote(保持 CAT1 唤醒)
+ if (!g_sio_cat1_vote_added) {
+ cat1_api_add_cat1_vote();
+ g_sio_cat1_vote_added = true;
+ }
+#endif
+
uint8_t current_idx = g_sio_current_buffer_index;
sio_ping_pong_buffer_t *current_buffer = &g_sio_ping_pong_buffers[current_idx];
}
g_sio_current_buffer_index = 0;
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // 初始化 CAT1 vote 状态
+ g_sio_cat1_vote_added = false;
+ g_sio_last_rx_time_ms = 0;
+#endif
+
printf("[SIO] Allocated %d x %d bytes = %.2f KB total\n",
SIO_PING_PONG_BUFFER_COUNT, SIO_PING_PONG_BUFFER_SIZE,
(SIO_PING_PONG_BUFFER_COUNT * SIO_PING_PONG_BUFFER_SIZE) / 1024.0);
// 5. 清零统计
memset(&g_sio_stats, 0, sizeof(sio_stats_t));
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // 6. 清理 CAT1 vote(如果之前添加过)
+ if (g_sio_cat1_vote_added) {
+ cat1_api_remove_cat1_vote();
+ g_sio_cat1_vote_added = false;
+ printf("[SIO] CAT1 vote removed during disable\n");
+ }
+ g_sio_last_rx_time_ms = 0;
+#endif
+
g_sio_interrupt_enabled = false;
g_sio_irq_process_task = 0;
g_sio_data_callback = NULL;
{
printf("=== SIO Interrupt Statistics (Ping-Pong Mode) ===\n");
printf("Interrupt Status: %s\n", g_sio_interrupt_enabled ? "ENABLED" : "DISABLED");
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ printf("CAT1 Vote Status: %s\n",
+ g_sio_cat1_vote_added ? "ADDED (awake)" : "REMOVED (sleep)");
+ if (g_sio_last_rx_time_ms > 0) {
+ uint32_t idle_time = sio_get_current_time_ms() - g_sio_last_rx_time_ms;
+ printf("RX Idle Time: %u ms\n", idle_time);
+ }
+#endif
printf("Ping-Pong Buffers: %d x %d bytes = %d KB total\n",
SIO_PING_PONG_BUFFER_COUNT, SIO_PING_PONG_BUFFER_SIZE,
(SIO_PING_PONG_BUFFER_COUNT * SIO_PING_PONG_BUFFER_SIZE) / 1024);
LWIP_DEBUGF(SNTP_DEBUG_STATE, ("ble connected, skip sntp_request.\n"));
return;
}
- uapi_cat1_wakeup_cat1(1);
/* initialize SNTP server address */
#if SNTP_SERVER_DNS
if (sntp_servers[sntp_current_server].name) {
if (err == ERR_INPROGRESS) {
/* DNS request sent, wait for sntp_dns_found being called */
LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_request: Waiting for server address to be resolved.\n"));
- uapi_cat1_wakeup_cat1(0);
return;
} else if (err == ERR_OK) {
sntp_servers[sntp_current_server].addr = sntp_server_address;
sys_untimeout(sntp_try_next_server, NULL);
sys_timeout((u32_t)SNTP_RETRY_TIMEOUT, sntp_try_next_server, NULL);
}
- uapi_cat1_wakeup_cat1(0);
}
/**
cat1_api_add_cat1_vote();
//中断会在此添加休眠投票,在收到cat1的消息后,会移除投票进入休眠。
//之前的5秒后移除投票延迟太久,与5秒更新一次信号强度
- #ifdef USE_CAT1_SLEEP_TIMER
- restart_sleep_cat1_timer();
- #endif
+
}
static uint8_t cat1_keepon_wakeup = 0;
return ;
}
- cat1_api_wakeup_cat1(1);
// uart_port_register_irq(UART_BUS_0);
osal_irq_enable(UART_1_IRQN);
}
- cat1_api_wakeup_cat1(0);
}
#define BOOTMSG_HEADER_STR "BOOTUP"
cat1_print_err("Error cat1 poweroff tcp skipp send data\n");
return ;
}
- cat1_api_wakeup_cat1(1);
// uart_port_register_irq(UART_BUS_0);
osal_irq_enable(UART_1_IRQN);
udp_send_response(station_tx_buffer,mode,cmd, content);
}
- cat1_api_wakeup_cat1(0);
}
// LWIP_DEBUGF(SNTP_DEBUG_STATE, ("ble connected, skip sntp_request.\n"));
// return;
// }
- cat1_api_wakeup_cat1(1);
/* initialize SNTP server address */
#if SNTP_SERVER_DNS
if (sntp_servers[sntp_current_server].name) {
if (err == ERR_INPROGRESS) {
/* DNS request sent, wait for sntp_dns_found being called */
LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_request: Waiting for server address to be resolved.\n"));
- cat1_api_wakeup_cat1(0);
return;
} else if (err == ERR_OK) {
sntp_servers[sntp_current_server].addr = sntp_server_address;
sys_untimeout(sntp_try_next_server, NULL);
sys_timeout((u32_t)SNTP_RETRY_TIMEOUT, sntp_try_next_server, NULL);
}
- cat1_api_wakeup_cat1(0);
}
/**
if(enabled == 0)
{
cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
}
else
{
cat1_api_keep_wakeup(1);
- cat1_api_wakeup_cat1(1);
}
cat1_print_info("CAT1TEST ATCMD keepwakeup cat1 enabled = %d\n",enabled);
cat1_print_err("CAT1TEST ATCMD Convert Command Failed\n");
return ERRCODE_FAIL;
}
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
u32_t sret= OsShellPing( argc, (const char *)argv[0]);
cat1_print_info("CAT1TEST ATCMD ping ret = 0x%X\n",sret);
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
return ERRCODE_SUCC;
}
static uint32_t cat1_ifconfig(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
//通讯开始,唤醒cat1
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(1);
//httpc_connection_t settings = {0};
//通讯结束,休眠cat1
g_http_download_started = 0;
cat1_api_remove_cat1_vote();
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
cat1_api_disable_cat1_cmd(0);
return ERRCODE_SUCC;
}
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 网络保活处理 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(300);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 保活 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 保活 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
// CAT1 保活
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 保活 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 网络保活处理 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(500); // 等待模块就绪
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 保活 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(500);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 网络保活处理 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(500);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 保活 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 保活 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* CAT1 网络保活处理 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(500);
#endif
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(200);
#endif
#ifdef SUPPORT_CAT1_SERVICE
/* 4. 保活CAT1,准备网络 */
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0);
LOS_Msleep(500);
#endif
// 注册音频数据写入回调
AI_RegisterWriteAudioDataCallback(ln_ws_audio_write_callback);
- cat1_api_keep_wakeup(1);
- cat1_api_wakeup_cat1(1);
return 0;
}
int enabled = atoi((char*)argv[0]);
if(enabled == 0)
{
- // cat1_api_keep_wakeup(0);
- // cat1_api_wakeup_cat1(0);
+ cat1_api_keep_wakeup(0);
+ cat1_api_wakeup_cat1(0);
}
else
{
- // cat1_api_keep_wakeup(1);
- // cat1_api_wakeup_cat1(1);
+ cat1_api_keep_wakeup(1);
+ cat1_api_wakeup_cat1(1);
}
ppp_print_info("CAT1TEST ATCMD keepwakeup cat1 enabled = %d\n",enabled);
ppp_print_err("CAT1TEST ATCMD Convert Command Failed\n");
return ERRCODE_FAIL;
}
- // cat1_api_wakeup_cat1(1);
- // cat1_api_keep_wakeup(1);
u32_t sret= OsShellPing( argc, (const char *)argv[0]);
ppp_print_info("CAT1TEST ATCMD ping ret = 0x%X\n",sret);
- // cat1_api_keep_wakeup(0);
- // cat1_api_wakeup_cat1(0);
return ERRCODE_SUCC;
}
static uint32_t cat1_ifconfig(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
#include <stdbool.h>
/* PPP配置参数 - UART配置统一使用SIO (在lwipopts_default.h中定义) */
+#define PPP_LOW_POWER_MODE 1
/* SIO设备号配置 - 与SLIP区分开 */
#define PPP_IFNUM 0 // PPP使用的SIO设备号,与SLIP_IFNUM(0)区分
// 唤醒4G模块
PPP_DEBUG_PRINT("Waking up 4G module...\n");
- cat1_api_wakeup_cat1(true);
} else {
PPP_DEBUG_PRINT("Sleeping 4G module power...\n");
// 唤醒4G模块
- cat1_api_wakeup_cat1(false);
- osal_msleep(500);
// 启用4G电源
PPP_DEBUG_PRINT("Disabling 4G module power...\n");
cat1_api_enable_cat1(false);
#define PPP_SAFE_SWITCH_IDLE_MS 5000 // 5秒空闲才安全切换
#define PPP_LIGHT_THRESHOLD_BPS 100 // 100 bps以下为轻量传输
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+#define PPP_CAT1_VOTE_IDLE_MS 3000 // 3秒空闲后移除CAT1 vote
+/* CAT1 vote 状态管理 */
+static volatile bool g_ppp_cat1_vote_added = false; // CAT1 vote 状态标志
+#endif
+
/* 外部函数声明(在ppp_lwip.c中实现) */
extern ppp_pcb* ppp_lwip_get_pcb(void);
extern bool ppp_lwip_is_initialized(void);
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+/* 外部函数声明(CAT1 API) */
+extern void cat1_api_add_cat1_vote(void);
+extern void cat1_api_remove_cat1_vote(void);
+#endif
+
/* 内部函数声明 */
static uint32_t ppp_get_current_time_ms(void);
static ppp_error_t ppp_flush_buffer(uint8_t buffer_index);
last_rate_update_time = current_time;
}
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // ✅ CAT1 vote 管理:检测 idle 状态,超过阈值时移除 vote
+ if (g_ppp_cat1_vote_added) {
+ if (g_ppp_data_state.last_rx_time_ms > 0) {
+ uint32_t idle_time = current_time - g_ppp_data_state.last_rx_time_ms;
+ if (idle_time >= PPP_CAT1_VOTE_IDLE_MS) {
+ // 空闲时间超过阈值,移除 vote 允许 CAT1 休眠
+ cat1_api_remove_cat1_vote();
+ g_ppp_cat1_vote_added = false;
+ PPP_DEBUG_INFO("[CAT1_VOTE] Removed vote after %ums idle", idle_time);
+ }
+ }
+ }
+#endif
+
uint8_t current_idx = g_current_buffer_index; // 读取一次,避免重复读取
// ⚠️ 检查内存是否已分配
g_ppp_data_state.last_rx_time_ms = g_timer_timestamp_ms;
g_ppp_data_state.rx_bytes_this_second += length;
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // ✅ CAT1 vote 管理:接收数据时添加 vote(保持 CAT1 唤醒)
+ if (!g_ppp_cat1_vote_added) {
+ cat1_api_add_cat1_vote();
+ g_ppp_cat1_vote_added = true;
+ }
+#endif
+
// 获取当前buffer
uint8_t current_idx = g_current_buffer_index;
ppp_ping_pong_buffer_t *current_buffer = &g_ping_pong_buffers[current_idx];
}
g_current_buffer_index = 0;
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // 2.1 初始化 CAT1 vote 状态
+ g_ppp_cat1_vote_added = false;
+#endif
+
PPP_DEBUG_INFO("Ping-pong buffers initialized: %d x %d bytes = %d KB total",
PPP_PING_PONG_BUFFER_COUNT, PPP_PING_PONG_BUFFER_SIZE,
(PPP_PING_PONG_BUFFER_COUNT * PPP_PING_PONG_BUFFER_SIZE) / 1024);
memset(&g_ppp_interrupt_stats, 0, sizeof(ppp_interrupt_stats_t));
memset(&g_pingpong_stats, 0, sizeof(ppp_pingpong_stats_t));
memset(&g_uart_error_stats, 0, sizeof(ppp_uart_error_stats_t));
+ memset(&g_ppp_data_state, 0, sizeof(ppp_data_state_t));
+
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ // 9. 清理 CAT1 vote(如果之前添加过)
+ if (g_ppp_cat1_vote_added) {
+ cat1_api_remove_cat1_vote();
+ g_ppp_cat1_vote_added = false;
+ PPP_DEBUG_INFO("CAT1 vote removed during PPP interrupt disable");
+ }
+#endif
g_ppp_interrupt_enabled = false;
g_ppp_irq_process_task = 0;
ppp_lwip_is_connected() ? "YES" : "NO ");
PPP_DEBUG_WARN("║ RX Idle Time: %u ms ║", idle_ms);
PPP_DEBUG_WARN("║ RX Rate: %u bytes/sec ║", g_ppp_data_state.rx_rate_bps);
+#ifdef SUPPORT_PPP_SERVICE_INTERRUPT
+ PPP_DEBUG_WARN("║ CAT1 Vote: %s ║",
+ g_ppp_cat1_vote_added ? "ADDED (awake)" : "REMOVED (sleep)");
+#endif
PPP_DEBUG_WARN("║ Safe for +++: %s ║",
ppp_interrupt_is_safe_for_command_switch() ? "YES ✓" : "NO ✗");
PPP_DEBUG_WARN("╠═══════════════════════════════════════╣");
gpio_level_t val = uapi_gpio_get_val(pin);
if (val == GPIO_LEVEL_HIGH) {
PPP_DEBUG_PRINT("PPP: Cat1 ring interrupt on pin %d high \n", pin);
- #ifdef PPP_LOW_POWER_MODE
- ppp_api_wakeup_cat1(true);
- #endif
+ cat1_api_add_cat1_vote();
} else {
PPP_DEBUG_PRINT("PPP: Cat1 ring interrupt on pin %d low\n", pin);
- #ifdef PPP_LOW_POWER_MODE
- ppp_api_wakeup_cat1(false);
- #endif
+ //idle后 remove
+ // cat1_api_remove_cat1_vote();
}
uapi_gpio_clear_interrupt(pin);
}
}
PPP_DEBUG_DEBUG("=== PPP Serial Write Start ===");
- #ifdef PPP_LOW_POWER_MODE
+ #if defined(PPP_LOW_POWER_MODE) && (PPP_LOW_POWER_MODE == 1)
ppp_api_wakeup_cat1(true);
osal_msleep(1);
#endif
result == PPP_ERR_OK ? "SUCCESS" : "FAILED", result);
PPP_DEBUG_INFO("Statistics: tx_bytes=%u, tx_errors=%u", g_serial_ctx.tx_bytes, g_serial_ctx.tx_errors);
PPP_DEBUG_INFO("=== PPP Serial Write End ===");
- #ifdef PPP_LOW_POWER_MODE
+ #if defined(PPP_LOW_POWER_MODE) && (PPP_LOW_POWER_MODE == 1)
ppp_api_wakeup_cat1(false);
#endif
if (!g_serial_ctx.initialized || !buffer || !bytes_read || buffer_size == 0) {
return PPP_ERR_INVALID_PARAM;
}
+ #if defined(PPP_LOW_POWER_MODE) && (PPP_LOW_POWER_MODE == 1)
+ ppp_api_wakeup_cat1(true);
+ osal_msleep(1);
+ #endif
*bytes_read = 0;
ppp_error_t result = PPP_ERR_OK;
// 读取错误
if (total_read == 0) {
PPP_DEBUG_ERROR("PPP UART Read: Error %d", read_result);
- return PPP_ERR_UART;
+ result = PPP_ERR_UART;
+ break;
}
break;
}
if (total_read > 0) {
PPP_DEBUG_DEBUG("PPP optimized read: %u bytes in %u batches", total_read, batch_count);
- return PPP_ERR_OK;
+ result = PPP_ERR_OK;
+ break;
} else {
- return PPP_ERR_OK; // 无数据但无错误
+ result = PPP_ERR_OK;
+ break; // 无数据但无错误
}
}
break;
break;
}
+ #if defined(PPP_LOW_POWER_MODE) && (PPP_LOW_POWER_MODE == 1)
+ ppp_api_wakeup_cat1(false);
+ osal_msleep(1);
+ #endif
return result;
}
// HTTP请求失败,清理CAT1资源
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_remove_cat1_vote();
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
cat1_api_disable_cat1_cmd(0);
#endif
}
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_remove_cat1_vote();
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
cat1_api_disable_cat1_cmd(0);
#endif
//通讯开始,唤醒cat1
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_add_cat1_vote();
- cat1_api_wakeup_cat1(1);
- cat1_api_keep_wakeup(1);
cat1_api_disable_cat1_cmd(0); // 修改:允许CAT1命令,确保DNS查询可用
#endif
// 等待CAT1就绪
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_remove_cat1_vote();
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
cat1_api_disable_cat1_cmd(0);
#endif
// 下载取消,清理CAT1资源
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_remove_cat1_vote();
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
cat1_api_disable_cat1_cmd(0);
#endif
return -1;
// 下载取消,清理CAT1资源
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_remove_cat1_vote();
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
cat1_api_disable_cat1_cmd(0);
#endif
return -1;
// 清理CAT1资源
#ifdef SUPPORT_CAT1_SERVICE
cat1_api_remove_cat1_vote();
- cat1_api_keep_wakeup(0);
- cat1_api_wakeup_cat1(0);
cat1_api_disable_cat1_cmd(0);
PRINT("CAT1 resources cleaned up\r\n");
#endif
};
(void)uapi_create_osThread_custom_with_args(&main_task);
}
- cat1_api_keep_wakeup(1);
- cat1_api_wakeup_cat1(1);
return 0;
}