添加串口打开开关openserial

This commit is contained in:
fish 2019-03-20 09:47:22 +08:00
parent 8be2e7e1fc
commit d4a24b9112
4 changed files with 25 additions and 5 deletions

View File

@ -4,7 +4,23 @@
"version": "yunhorn_gw_c_v1",
"location": [113.960347, 22.54143],
"单位": "深圳市云兴科技",
"config": [{
"config": [
{
"id": "deb03e28-ddcb-4e5d-aa31-d870a1f0f09b",
"version": "yunhorn_kgl_c8_v1",
"data": [
["女厕位", 1],
["女厕位", 2],
["女厕位", 3],
["女厕位", 4],
["女厕位", 5],
["女厕位", 6],
["男厕位", 7],
["男厕位", 8]
]
},
{
"id": "EC13C2D9-6A93-4894-BB5B-89BDAA786D8A",
"version": "yunhorn_kgl_c8_v1",
"data": [
@ -14,8 +30,8 @@
["男厕位", 4],
["男厕位", 5],
["男厕位", 6],
["男厕位", 7],
["男厕位", 8]
["纸巾卷", 7],
["纸巾抽", 8]
]
}, {
"id": "82BF7B5E-EC0D-4DB6-807F-B097C3C84073",
@ -173,5 +189,6 @@
"iconurl": "http://192.168.3.188/icons/",
"websocketurl": ["192.168.3.216:8080", "/echo"],
"post_to_server": "https://smartoilets.cn/socketServer/statis/push",
"debug": true
"debug": true,
"openserial":false
}

Binary file not shown.

View File

@ -13,6 +13,7 @@ func main() {
go gw_router()
go serial_run()
c := cron.New()
send_data(1001)
c.AddFunc("0, *, *, *, *, *", func() {
send_data(1001)
})

View File

@ -6,6 +6,7 @@ import (
"log"
"strconv"
"sync"
"math/rand"
)
type Devicedatas struct {
@ -41,12 +42,13 @@ func yunhorn_ys_l_v1(data_buf []byte){
device.VERSION=demoDevice.VERSION
device.ONLINE=demoDevice.ONLINE
demoDevice.DATA["data"+strconv.Itoa(7)]=data_int[0]
demoDevice.DATA["data"+strconv.Itoa(8)]=rand.Intn(2)
device.DATA=demoDevice.DATA
if conf.DEBUG {
log.Println(device)
}
send_data(1005, device)
send_data(1005, device)
}