From 0718b07276198334437f52aa5c6c07cca2002225 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期四, 10 八月 2023 18:17:32 +0800 Subject: [PATCH] 完善数据上报程序, 添加测试 --- msg/msg.go | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/msg/msg.go b/msg/msg.go index dce1c24..09d2504 100644 --- a/msg/msg.go +++ b/msg/msg.go @@ -12,6 +12,13 @@ Details []*PLCAddress `gorm:"-" json:"Details"` } +type PLCAddress struct { + StartAddress int `json:"startAddress"` // 鏁版嵁璧峰鍦板潃 + Length int `json:"length"` // 鏁版嵁闀垮害 + Type string `json:"type"` // 鏁版嵁绫诲瀷 + FieldName string `json:"fieldName"` // 瀵瑰簲绯荤粺瀛楁 +} + type PLCResponse struct { DeviceID string `json:"deviceId"` DeviceName string `json:"deviceName"` @@ -21,19 +28,12 @@ PLCData []PLCData `json:"plcData"` } -type PLCAddress struct { - StartAddress int `json:"startAddress"` // 鏁版嵁璧峰鍦板潃 - Length int `json:"length"` // 鏁版嵁闀垮害 - Type string `json:"type"` // 鏁版嵁绫诲瀷 - FieldName string `json:"fieldName"` // 瀵瑰簲绯荤粺瀛楁 -} - type PLCData struct { StartAddress int `json:"startAddress"` // 鏁版嵁璧峰鍦板潃 Length int `json:"length"` // 鏁版嵁闀垮害 Type string `json:"type"` // 鏁版嵁绫诲瀷 FieldName string `json:"fieldName"` // 瀵瑰簲绯荤粺瀛楁 - Data []byte // 浠巔lc璇诲彇鐨勫師濮嬫暟鎹� + RawData []byte `json:"rawData"` // 浠巔lc璇诲彇鐨勫師濮嬫暟鎹� } type ApsDeviceApiResponse struct { -- Gitblit v1.8.0