完善配置以及打印tcp数据

This commit is contained in:
fish 2019-03-23 15:23:29 +08:00
parent 78473f9b3d
commit 97116ffb1e
2 changed files with 5 additions and 2 deletions

View File

@ -114,7 +114,7 @@
"version":"yunhorn_ys_l_v1",
"flip":true,
"id":"018B5704-55BE-40CA-9D3E-90EF157C2489"
},
}
],
"devices_list": [
["4E5D52DD-EB81-43C0-A2B6-04E432412EBA", "loraport", "yunhorn_kgl_l_v1", "1"],

View File

@ -25,6 +25,7 @@ type Device struct {
//处理通过tcp发送过来的数据
func yunhorn_wireless(data_buf []byte){
//至少5个字节数据
log.Println("wireless.tcp.data.len:",len(data_buf))
if len(data_buf)>4 {
adrh := data_buf[0]
adrl := data_buf[1]
@ -65,7 +66,9 @@ func yunhorn_wireless(data_buf []byte){
}
}
}
}
if(len(data_buf)>8){
go yunhorn_wireless(data_buf[4:])
}
}