wangfq
3e28174b40
feat(mqtt): 设备时钟同步方案B — 平台经 report_config 下发 Unix ts (协议V1.05)
设备无RTC/SNTP, 原上行 ts=mstick()/1000(上电秒数)。方案B:
- net_srv.c 新增 dev_time_sync()/dev_time_now(): 门槛≥1600000000挡上电秒数,
已校准返回真Unix, 未校准退回上电秒数; 无符号相减处理mstick 49.7天回绕
- manage_mqtt_recv_message 从下行命令信封 ts 校准 (report_config主同步点)
- 全部上行 ts (14处命令响应+initialize+loop_data+event_report) 改 dev_time_now()
heartbeat uptime 字段保留 mstick()/1000 (运行时长非时间戳)
- 协议 V1.05 §2.3 时间同步 + report_config 兼任同步点职责
- tests/test_dev_time_sync.c 6组全过
平台侧配合: 收到 initialize 后下发 report_config 时 ts 填当前 Unix 时间
2026-07-15 15:25:44 +08:00
..
2026-07-15 15:25:44 +08:00
2026-06-25 16:21:57 +08:00
2026-06-25 16:21:57 +08:00
2026-06-25 16:21:57 +08:00
2026-06-25 16:21:57 +08:00