完善tcp数据判断

This commit is contained in:
fish 2019-03-23 10:25:23 +08:00
parent 3f7ff4aa81
commit 522c30f400
1 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,7 @@ func yunhorn_wireless(data_buf []byte){
adrh := data_buf[0]
adrl := data_buf[1]
if adrh==0 && adrl==0 {
if (adrh==0 && adrl==0) || (adrh==0 && adrl==1) {
go yunhorn_ys_l_v1(data_buf)
}else{
dataType := data_buf[2]
@ -131,7 +131,6 @@ func yunhorn_ys_l_v1(data_buf []byte) {
demoDevice.DATA["data"+strconv.Itoa(2)] = 0
demoDevice.DATA["data"+strconv.Itoa(3)] = 0
//485
if data_int0[0]==0 && data_int1[0]==0 {
demoDevice.DATA["data"+strconv.Itoa(8)] = data_int[0]
var device Device
@ -140,7 +139,7 @@ func yunhorn_ys_l_v1(data_buf []byte) {
device.VERSION = demoDevice.VERSION
device.ONLINE = demoDevice.ONLINE
device.DATA = make(map[string]interface{})
device.DATA["data7"] = data_int[0]
device.DATA["data8"] = data_int[0]
device.Unlock()
DEVICEDATAS.DATA[demoDevice.VERSION+"_1"] = device
} else {