添加新类型设备接口
This commit is contained in:
parent
f72c769a25
commit
433d480754
18
worker.go
18
worker.go
|
@ -21,6 +21,24 @@ type Device struct {
|
||||||
DATA map[string]interface{} `json:"data"`
|
DATA map[string]interface{} `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func yunhorn_ys_l_v1(data_buf []byte){
|
||||||
|
//log.Println(data_buf)
|
||||||
|
log.Println(data_buf[3:4])
|
||||||
|
data_int := Bytes2Bits(data_buf[3:4])
|
||||||
|
var device Device
|
||||||
|
device.ID="deb03e28-ddcb-4e5d-aa31-d870a1f0f09b"
|
||||||
|
device.VERSION="yunhorn_ys_l_v1"
|
||||||
|
device.ONLINE=true
|
||||||
|
device.DATA=make(map[string]interface{})
|
||||||
|
device.DATA["data"]=data_int[0]
|
||||||
|
if conf.DEBUG {
|
||||||
|
log.Println(device)
|
||||||
|
}
|
||||||
|
|
||||||
|
send_data(1005, device)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func yunhorn_lorawan_l_v1(s *serial.Port) {
|
func yunhorn_lorawan_l_v1(s *serial.Port) {
|
||||||
for {
|
for {
|
||||||
buf := make([]byte, 128)
|
buf := make([]byte, 128)
|
||||||
|
|
Loading…
Reference in New Issue