fix门磁设备版本

This commit is contained in:
fish 2019-05-09 18:46:02 +08:00
parent 2d7109c45e
commit 7075753b09
2 changed files with 7 additions and 5 deletions

View File

@ -383,7 +383,7 @@ func dealDatav3(data []byte) string{
R_data.CODE = 1005
R_data.ID = "dc390000"
//尿布台
R_data.VERSION = "yunhorn_kq_c_v1"
R_data.VERSION = "yunhorn_door_c_v1"
R_data.ONLINE = true
R_data.DATA = make(map[string]interface{})
R_data.DATA["data"]=int64(data[6])
@ -430,11 +430,13 @@ func dealDatav3(data []byte) string{
sddata := buffer.String()
log.Println("sddata",sddata)
nh3int1 := strconv.FormatInt(int64(data[11]&0xff), 10)
buffer = new(bytes.Buffer)
nh3int1 := strconv.Itoa(int(data[11]))
buffer.WriteString(nh3int1)
buffer.WriteString(".")
nh3int2 := strconv.FormatInt(int64(data[12]&0xff), 10)
if wdfh<10{
nh3int2 := strconv.Itoa(int(data[12]))
if int64(data[12])<10{
buffer.WriteString("0")
}
buffer.WriteString(nh3int2)

View File

@ -84,7 +84,7 @@ func readConn(conn net.Conn, readChan chan<- []byte, stopChan chan<- bool) {
buffer := new(bytes.Buffer)
continueCount := 0
// log.Println("yunhorndeug.push.data.tcp.reqLen|data",reqLen,data)
// log.Println("$$$$$$$$$$$$$$$$$$$$$$$$$",data[:reqLen])
log.Println("$$$$$$$$$$$$$$$$$$$$$$$$$",data[:reqLen])
for i, b := range data[:reqLen] {
if reqLen<7{