QAUP_Management/doc/requirement/traffic_light_request.md

34 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 红绿灯数据格式说明
### 真实的红绿灯设备上报格式
红绿灯设备通过TCP连接发送的原始数据格式为纯JSON
```json
{"DI-01":0,"DI-02":0,"DI-11":1,"DI-12":0,"DI-13":0,"DI-14":0,"DI-15":0,"DI-16":1,"DI-17":0,"DI-18":0}
```
### 数据字段说明
- **DI-11~13**: 南北向灯的状态
- `DI-11`: 北红灯 (1=亮, 0=灭)
- `DI-12`: 北黄灯 (1=亮, 0=灭)
- `DI-13`: 北绿灯 (1=亮, 0=灭)
- **DI-14~16**: 东西向灯的状态
- `DI-14`: 东红灯 (1=亮, 0=灭)
- `DI-15`: 东黄灯 (1=亮, 0=灭)
- `DI-16`: 东绿灯 (1=亮, 0=灭)
- **其他DI字段**: 通常为0可忽略
### 网络连接信息
- **IP地址和端口**: 从TCP socket连接中获取不包含在JSON数据中
- **上报频率**: 每1秒上报一次
- **监听端口**: 8082
### 注意事项
之前文档中的格式 `('36.113.38.178', 56930) - {...}` 实际上是服务器日志输出格式不是设备的原始数据格式。真实的设备只发送JSON数据IP地址和端口信息需要从socket连接中提取。