feat(vd960DBN): MQTT/TCP report_config 支持完整7参数配置

- 新增 ReportConfig 结构体 (sensor_type/enable/once/env_eval/interval/ack_required/timeout)
- net_srv.c: MQTT report_config handler — 查询/设置均返回完整配置JSON
- tcp_json_srv.c: TCP JSON handle_report_config 同步升级,兼容旧 active_report
- iot_mqtt_srv.c: g_report_active → g_report_cfg.enable
- g_report_active 全局变量替换为 g_report_cfg 结构体
This commit is contained in:
wangfq
2026-07-07 18:39:45 +08:00
parent cd92f3e0c3
commit a7de4dfcde
4 changed files with 162 additions and 26 deletions
@@ -58,6 +58,19 @@ typedef struct {
uint32_t deadline; // ms deadline for timeout
} TcpJsonPending;
/*===========================================================================
* Report Config
*===========================================================================*/
typedef struct {
uint8_t enable; // 0=off, 1=on
uint8_t sensor_type; // Sensor type, default 12
uint8_t once; // 0=periodic, 1=single report
uint8_t env_eval; // 0=skip, 1=environment evaluation
uint16_t interval; // Report interval in seconds
uint8_t ack_required; // 0=fire-and-forget, 1=ACK required
uint16_t timeout; // Timeout in ms
} ReportConfig;
/*===========================================================================
* Externs
*===========================================================================*/
@@ -70,7 +83,7 @@ extern uint32_t g_json_last_comm_ts; // Last communication timestamp (ms)
extern uint32_t g_json_last_connect_ts; // Last client connect timestamp (ms)
extern uint8_t g_json_restart_count; // Auto-restart counter
extern uint32_t g_json_restart_cooldown; // Cooldown deadline (ms)
extern uint8_t g_report_active; // 0=inactive 1=active report
extern ReportConfig g_report_cfg; // Active report configuration
/*===========================================================================
* API