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]