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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user