fix grammer

This commit is contained in:
fish 2019-03-23 10:11:14 +08:00
parent 3e1836e367
commit 017b31c23e
1 changed files with 6 additions and 5 deletions

View File

@ -30,16 +30,16 @@ func yunhorn_wireless(data_buf []byte){
adrl := data_buf[1]
if adrh==0 && adrl==0 {
go yunhorn_ys_l_v1(readStr)
go yunhorn_ys_l_v1(data_buf)
}else{
dataType := data_buf[2]
data_int := Bytes2Bits(data_buf[3:4])
data := data_int[0]
//第3个字节表示本数据帧的类型00表示NPN数据类型01表示磁开关数据类型02表示485传感器上报数据类型03表示485传感器数据采集类型
if dataType !=3 {
for _,item range conf.WIRELESSSLAVEDEVICES{
for _,item := range conf.WIRELESSSLAVEDEVICES{
//数据是否需要反转,检测到有信号是1的情况
if item.flip{
if item.FLIP{
if data==0{
data = 1
}else{
@ -49,11 +49,12 @@ func yunhorn_wireless(data_buf []byte){
var device Device
//TODO 配置device
device.ID = item.id
device.ID = item.ID
device.VERSION = item.VERSION
device.ONLINE = true
device.DATA = data
device.DATA = make(map[string]interface{})
device.DATA["data"] = data
send_data(1005, device)
}
}