1. 解决本地注册设备的流程无法正常控制设备的问题

2. 修改之前的 版本固件命名不对的问题
3. 增加debug kit,但是默认不开启(还在调试中)
This commit is contained in:
2025-11-04 21:24:15 +08:00
parent 21c6d05bad
commit 8270708ef2
27 changed files with 893 additions and 34 deletions

View File

@@ -1304,39 +1304,29 @@ static void start_report_task(uint32_t report_mask)
}
}
static int device_online = 0;
// 修改handle_device_online函数
void handle_device_online(void)
// 设备注册事件:仅处理配网相关(绑定标志、退出配网)
void handle_device_register(void)
{
if(device_online)
{
return;
}
e_printf("device online!\r\n");
g_device_control.is_net_configured = true;//设备上线后,认为设备已经配网成功,就取消标记为新设备,终生只存在这一次标记
e_printf("device registered!\r\n");
g_device_control.is_net_configured = true; // 视为完成一次配网流程
if (!g_device_control.is_bound) {
e_printf("设备首次上线,记录配网状态\r\n");
e_printf("设备首次注册,记录配网状态\r\n");
g_device_control.is_bound = true;
// g_device_control.power_on_cnt = 0; // 重置上电计数
stop_breath_timer(); // 停止呼吸灯
stop_breath_timer();
set_light2net_cfg_done();
req_save_device_data();
}
// 重置配网状态
g_net_breath_state = NET_CFG_IDLE;
g_net_cfg_start_time = 0;
// 启动状态上报任务,上报所有服务状态
start_report_task(REPORT_ALL);
device_online = 1;
}
void handle_device_offline(void)
// 设备注销事件仅清理配网行为不涉及online/offline状态
void handle_device_unregister(void)
{
if (!device_online) {
return;
}
device_online = 0;
e_printf("device offline!\r\n");
e_printf("device unregistered!\r\n");
stop_breath_timer();
g_net_breath_state = NET_CFG_IDLE;
g_net_cfg_start_time = 0;
}
// 处理设备解绑