From 1250fc5d6decfd64b1d3c7ecd166f37b38362fb2 Mon Sep 17 00:00:00 2001 From: yu Date: Wed, 29 May 2019 10:21:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=B0=BF=E5=B8=83=E5=8F=B0?= =?UTF-8?q?=E5=92=8C=E5=90=B8=E9=A1=B6=E7=9A=84=E8=AE=BE=E5=A4=87=E5=9E=8B?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/router.go b/router.go index 86a6080..c7ae89c 100644 --- a/router.go +++ b/router.go @@ -143,7 +143,7 @@ func dealDatav3(data []byte) string{ strs := data - buffer := new(bytes.Buffer) + buffer := new(bytes.Buffer) for _, b := range data[:4] { s := strconv.FormatInt(int64(b&0xff), 16) if len(s) == 1 { @@ -169,7 +169,7 @@ func dealDatav3(data []byte) string{ R_data.CODE = 1008 R_data.ID = adr //尿布台 - R_data.VERSION = "yunhorn_2_v1" + R_data.VERSION = "sts_hps_3ir" R_data.ONLINE = true R_data.DATA = make(map[string]interface{}) R_data.DATA["cs2001"]=cs2001 @@ -194,7 +194,7 @@ func dealDatav3(data []byte) string{ if newdtype==1{ tof = data[7] - R_data.VERSION = "yunhorn_1_v1" + R_data.VERSION = "sts_lts_01" R_data.DATA["tof"]=tof tofTmp := strconv.FormatInt(int64(data[7]&0xff), 10) readyData.WriteString("*") @@ -669,11 +669,17 @@ type Seat_data struct { func seat_api(c *gin.Context) { DEVICEDATAS.RLock() type_id := c.Param("id") + //locationCode := c.Param("locationCode") var data Seat_data var conf_data [][]interface{} //conf.GATEWAY_INFO.CONFIG 采集器配置信息 // log.Println("DEVICEDATAS.data:",DEVICEDATAS.DATA) for _, i := range conf.GATEWAY_INFO.CONFIG { + + //if i.LOCATION_CODE != locationCode{ + // continue + //} + arr := get_seat_device_data(i.ID) //获取到设备版本 version, num := arr[0], arr[1]