From 2446847ae9c545878a3d084704521fa3114dc3dd Mon Sep 17 00:00:00 2001 From: fish Date: Sat, 23 Mar 2019 17:24:39 +0800 Subject: [PATCH] =?UTF-8?q?lora=E8=AE=BE=E5=A4=87=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=BC=94=E7=A4=BA=E5=8F=91=E9=80=81=E5=BF=83=E8=B7=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tcpserver.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tcpserver.go b/tcpserver.go index dbd53a9..ac14a29 100644 --- a/tcpserver.go +++ b/tcpserver.go @@ -47,6 +47,16 @@ func handleConn(conn net.Conn) { stopChan <- true } else { log.Println("write msg success!", conn.RemoteAddr()) + + //暂时写死,演示用 lora心跳包给云端 + var device Device + device.Lock() + device.ID = "6F3A8B2D-B0DF-404A-AA7E-4A4086BD0B56" + device.VERSION = "yunhorn_lora_l_v1" + device.ONLINE = true + device.DATA = make(map[string]interface{}) + device.DATA["data"] = 1 + go send_data(1005, device) } } }