Просмотр исходного кода

add: air103添加ble上行数据到手机的演示

Wendal Chen 4 лет назад
Родитель
Сommit
eea7439d21
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      demo/nimble/Air103/main.lua

+ 9 - 0
demo/nimble/Air103/main.lua

@@ -41,6 +41,15 @@ sys.taskInit(function()
     sys.wait(2000)
     nimble.debug(6)
     nimble.init()
+
+    if nimble.send_msg then
+        while 1 do
+            sys.wait(3000)
+            nimble.send_msg(1, 0, string.char(0x5A, 0xA5, 0x12, 0x34, 0x56))
+        end
+    else
+        log.info("nimble", "no send_msg")
+    end
 end)