feat: 协议 V1.04 — 主动上报增加继电器输出次数 (misc_type=3)

- loop_uart_proto.h: LUP_CoilSensor.misc 联合体新增 relay_count
- tcp_json_srv.c: format_sensor_json 处理 misc_type=3 → relay_count
- docs: 更新协议文档至 V1.04
This commit is contained in:
wangfq
2026-07-02 16:50:06 +08:00
parent 8033bca949
commit 2163b89d28
3 changed files with 9 additions and 5 deletions

View File

@@ -96,13 +96,14 @@ typedef struct {
uint8_t condition : 4; // 环境状态评估值(0=正常, 值越大干扰越大)
uint8_t loop_state : 1; // 0=正常, 1=断开
uint8_t car_state : 1; // 0=无车, 1=有车
uint8_t misc_type : 2; // 0=时间量, 1=断开次数, 2=车流量
uint8_t misc_type : 2; // 0=时间量, 1=断开次数, 2=车流量, 3=继电器输出次数
uint32_t freq; // 频率 (3 bytes, little-endian)
uint16_t variation; // 变化量 (2 bytes, little-endian)
union {
uint32_t passtime_ms5; // 通过时间/车间距, 5ms单位 (misc_type=0)
uint32_t cut_amount; // 线圈断开次数 (misc_type=1)
uint32_t flow_amount; // 车流量数 (misc_type=2)
uint32_t relay_count; // 继电器输出次数 (misc_type=3)
} misc;
} LUP_CoilSensor;