From 742923a5512707bdfd4c0e2e9adfcb86b453be28 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期日, 13 八月 2023 17:33:18 +0800 Subject: [PATCH] 修复长度大于1的读取结果 --- msg/msg.go | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/msg/msg.go b/msg/msg.go index dce1c24..e4000ff 100644 --- a/msg/msg.go +++ b/msg/msg.go @@ -12,15 +12,6 @@ Details []*PLCAddress `gorm:"-" json:"Details"` } -type PLCResponse struct { - DeviceID string `json:"deviceId"` - DeviceName string `json:"deviceName"` - DeviceIP string `json:"deviceIp"` - Online bool `json:"online"` - Message string `json:"message"` - PLCData []PLCData `json:"plcData"` -} - type PLCAddress struct { StartAddress int `json:"startAddress"` // 鏁版嵁璧峰鍦板潃 Length int `json:"length"` // 鏁版嵁闀垮害 @@ -28,12 +19,21 @@ FieldName string `json:"fieldName"` // 瀵瑰簲绯荤粺瀛楁 } +type PLCResponse struct { + DeviceID string `json:"deviceId"` + DeviceName string `json:"deviceName"` + DeviceIP string `json:"deviceIp"` + Online bool `json:"online"` + PLCData []PLCData `json:"plcData"` +} + 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璇诲彇鐨勫師濮嬫暟鎹� + Message string `json:"message"` } type ApsDeviceApiResponse struct { -- Gitblit v1.8.0