V1.5: OTA进度上报改可靠发送(等OK+重试1次),平台升级中标志可置位

This commit is contained in:
helei 2026-08-19 23:20:30 +08:00
parent 2facb017bf
commit 9ee82719ca
2 changed files with 7 additions and 2 deletions

View File

@ -475,10 +475,13 @@ int air780e_mqtt_report(const char *header, const char *ota_id, int val) {
if (!header || !ota_id || !ota_id[0]) return -1;
static char cmd[300];
if (strstr(header, "progress")) {
/* 进度上报:允许丢包,发了就走 */
/* 进度上报:等 OK 确认送达(失败自动重试 1 次),让平台"升级中"可靠置位。
* 10% ~3s */
sprintf(cmd, "AT+MPUB=\"/iot/data/up/%s\",0,0,\"{\\22header\\22:\\22%s\\22,\\22body\\22:{\\22id\\22:\\22%.16s\\22,\\22progress\\22:%d}}\"",
MqttInfoStr.ClientID, header, ota_id, val);
CAT1_printf("%s", cmd);
if (catSendCmd(cmd, "OK", 2, 15) != 0) {
log_warn("> OTA 进度上报无应答: %d%%", val);
}
return 0;
} else {
/* 结果上报:平台据此判定升级完成,必须可靠送达——等 OK 并重试 */

View File

@ -162,3 +162,5 @@
- OTA 闭环(兼容版):回退 W25Q64 结构改动BL/APP 共享结构不能动,现场无法刷 BL
平台任务 id 改存 APP 私有 EEPROM(175~194),新固件首启确认时在可靠连接上补发
result.post(success=1, 任务id) + confirm.post送达后清回 0xFF
- OTA 进度上报改可靠发送progress.post 等 OK 确认(失败自动重试 1 次,每 10% 最多多花 ~3s
平台"升级中"标志可置位;若无应答打印 WARN