Browse Source

remove: 移除script目录,里面是些很老的测试脚本

Wendal Chen 4 years ago
parent
commit
01a7885772

+ 2 - 97
docs/README.md

@@ -1,98 +1,3 @@
-<p align="center"><a href="#" target="_blank" rel="noopener noreferrer"><img width="100" src="logo.jpg" alt="LuatOS logo"></a></p>
+# LuatOS文档大全
 
-[![license](https://img.shields.io/github/license/openLuat/LuatOS)](/LICENSE)
-
-LuatOS是运行在嵌入式硬件,用户编写lua代码就可完成各种功能
-
-1. 基于Lua 5.3.x
-2. 低内存需求, 最低32kb, 96kb flash空间
-3. 硬件抽象层兼容M3/arm/risc-v等
-4. 可测试,可模拟(qemu)
-5. 在线升级
-6. 可裁剪,可扩展
-
-----------------------------------------------------------------------------------
-
-## 代码示例节选
-
-做一个灯神(点亮并闪烁一个LED灯)
-
-```lua
-local sys = require("sys")
-
--- 把GPIO19设置为输出模式,上拉,初始电平为低电平(0代表低电平,1代表高电平)
-local netled = gpio.setup(19, 0, gpio.PULLUP)
-
-sys.taskInit(function()
-    while 1 do
-        netled(1) -- 输出高电平
-        sys.wait(500) -- 等待500ms
-        netled(0) -- 输出低电平
-        sys.wait(500) -- 等待500ms
-    end
-end)
-
--- 主循环, 必须加
-sys.run()
-```
-
-## 如何使用LuatOS
-
-1. 首先, 购买开发板([Wifi](https://item.taobao.com/item.htm?id=590724913462) / [NB-IOT](https://item.taobao.com/item.htm?id=625893281770&ns=1))
-2. 然后, 下载[固件包](https://gitee.com/openLuat/LuatOS/releases),按压缩包里的文档进行刷机
-3. 开始愉快地玩耍(或者放着积灰...)
-
-有任何疑问? 加 **QQ群: 1061642968** , 很多大佬哦
-
-----------------------------------------------------------------------------------
-## 资源
-
-* [预编译固件](https://github.com/openLuat/LuatOS/releases) 固件,示例,文档,都会一起发布
-* [Lua 5.3中文手册](https://www.runoob.com/manual/lua53doc/) 官方手册的中文版
-* [Lua 入门教程(5.1版)](https://wiki.openluat.com/doc/luaStart) 注意与5.3有语法差异
-* [合宙官网](http://www.openluat.com) 一家有理想的物联网公司
-* [合宙商城](http://m.openluat.com) 合宙官方商城
-* [联盛德W600/合宙Air640W专属说明](bsp/air640w/README.md) wifi模块,便宜,耐操
-* [合宙Air302专属说明](bsp/air302/README.md) NB-IOT模块,二次开发的首选
-* [Lua API文档](docs/api/lua/README.md) LuatOS的Lua API文档
-* [如何编译-Wifi固件](bsp/air640w/userdoc/how_to_build.md) 自行编译wifi模块
-* [如何编译-NBIOT固件](bsp/air302/userdoc/build_from_sdk.md) 自行编译nbiot模块
-* [收发16进制数据](http://doc.openluat.com/article/583/0) 二进制数据随意收发
-* [临时官网](https://luatos.vue2.cn/) 官网域名备案中
-
-----------------------------------------------------------------------------------
-
-## 使用到的开源项目
-
-* [lua](https://www.lua.org/) Lua官网
-* [rt-thread](https://github.com/RT-Thread/rt-thread) 国产rtos, 非常好用
-* [rtt-ds18b20](https://github.com/willianchanlovegithub/ds18b20) 在RT-Thread环境下读取ds18b20
-* [LuaTask](https://github.com/openLuat/Luat_2G_RDA_8955) 合宙LuaTask
-* [iRTU](https://github.com/hotdll/iRTU) 基于Luat的DTU, 稀饭大神
-* [airkissOpen](https://github.com/heyuanjie87/airkissOpen) 参考其实现思路
-* [minmea](https://github.com/kosma/minmea) 解析nmea
-* [u8g2_wqy](https://github.com/larryli/u8g2_wqy) u8g2的中文字体
-* [printf](https://github.com/mpaland/printf) A printf / sprintf Implementation for Embedded Systems
-* [YMODEM for Python](https://github.com/alexwoo1900/ymodem) YMODEM 用于下载脚本
-* [elua](http://www.eluaproject.net/) eLua 虽然已经停更多年,但精神犹在
-
-## 免费服务
-
-* [NetLab](https://netlab.luatos.io/index.html) TCP/UDP透传调试,公网IP, HEX值收发, Tab式多客户端. [备用地址](https://netlab.luatos.io/index.html)
-* [DevLog](udp://devlog.luatos.io:9072) 设备日志记录,格式兼容errDump.lua 查看日志请登录LuatOS官网.
-
-## 更多项目
-
-* [iRTU](https://gitee.com/hotdll/iRTU) 开源DTU/RTU解决方案
-* [Luat_CSDK_Air724U](https://gitee.com/openLuat/Luat_CSDK_Air724U) 市面上最畅销的4G Cat.1模块的开发包
-* [llcom](https://github.com/chenxuuu/llcom) 可运行lua脚本的高自由度串口调试工具
-* [irtu-gps](https://gitee.com/wendal/irtu-gps) 基于iRTU项目,实现GPS数据的接收和展示
-
-
-## 总体架构
-
-![总体架构](system.jpg)
-
-## 授权协议
-
-[MIT License](LICENSE)
+请到 https://wiki.luatos.com 查阅

+ 0 - 49
script/test/1.memheap_gc/main.lua

@@ -1,49 +0,0 @@
-
--- 本测试不需要sys也能跑
-
-local t = 0
-local pre = [[
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-]]
-while t < 10000 do
-    local tab = {os.date(), pre, tostring(t)}
-    log.info("main", table.concat(tab))
-    t = t + 1
-    --collectgarbage()
-    timer.mdelay(5)
-end

+ 0 - 40
script/test/2.netc_leak/main.lua

@@ -1,40 +0,0 @@
-
-local sys = require("sys")
-
-wlan.setMode("wlan0", 1)
-wlan.connect("uiot", "124567890")
-
-local count = 0
-local netc_a, netc_b, netc_c, netc_d
-sys.taskInit(function()
-    while count < 10000 do
-        if wlan.ready() == 1 then
-            -- 新建4个连接对象, 但不连接
-            netc_a = socket.tcp()
-            netc_b = socket.tcp()
-            netc_c = socket.tcp()
-            netc_d = socket.tcp()
-
-            netc_a:host("site0.cn")
-            netc_b:host("www.baidu.com")
-            netc_c:host("nutz.cn")
-            netc_d:host("qq.com")
-
-            netc_a:port(80)
-            netc_b:port(80)
-            netc_c:port(80)
-            netc_d:port(80)
-
-            netc_a:on("close", function() log.info("test", "netc_a close event") end)
-            netc_b:on("close", function() log.info("test", "netc_b close event") end)
-            netc_c:on("close", function() log.info("test", "netc_c close event") end)
-            netc_d:on("close", function() log.info("test", "netc_d close event") end)
-        end
-        sys.wait(100)
-        collectgarbage()
-        count = count + 1
-    end
-end)
-
-sys.run()
-

+ 0 - 34
script/test/3.netc_leak_connect/main.lua

@@ -1,34 +0,0 @@
-
-local sys = require "sys"
-
--- 如果是wifi,那就连一下wifi咯
-if wlan ~= nil then
-    wlan.connect("uiotabc", "12345678")
-end
-
-local tcount = 0        -- 当前测试完成数
-local testcount = 10000 -- 总测试次数
-sys.taskInit(function()
-    -- 做个大的循环
-    while tcount < testcount do
-        while not socket.isReady() then sys.waitUntil("NET_READY", 1000) end
-        local netc = socket.tcp()
-        netc:host("wwww.baidu.com")
-        netc:port(80)
-        netc:on("connect", function(id, re)
-            if re == 0 then
-                netc:send("GET / HTTP/1.0\r\n\r\n")
-            end
-        end)
-        netc:on("recv", function(id, data)
-            log.info("netc", "data recv", data)
-        end)
-        if netc:start() == 0 then
-            while netc:closed() == 0 then sys.waitUntil("NETC_END_" .. s:id(), 1000) end
-        end
-        netc:close()
-        sys.wait(1000) -- 等待1秒后继续测试
-    end
-end)
-
-sys.run()

+ 0 - 64
script/test/4.w600_128k_check/main.lua

@@ -1,64 +0,0 @@
-
---local sys = require("sys")
-
-local pre = [[
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-    1234567890
-]]
-
-local count = 0
---sys.taskInit(
-function t()
-    while count < 1000000 do
-        local tab = {os.date(), pre, tostring(count)}
-        --log.info("main", table.concat(tab))
-        local data = table.concat(tab)
-        log.info("main", data)
-        count = count + 1
-        --utest.w600_mem_check()
-        --sys.wait(100)
-        timer.mdelay(1)
-        --collectgarbage()
-    end
-    print("PASS")
-end
---)
-
-err, result, any, any2 = pcall(t)
-print(err, result, any, any2)
-
---sys.run()

+ 0 - 35
script/test/5.uart_leak/main.lua

@@ -1,35 +0,0 @@
-local sys = require "sys"
-log.info("main", "uart demo")
-local uartid = 1
-local recvBuff = {{}, {}}
---初始化
-local result = uart.setup(
-    uartid,--串口id
-    115200,--波特率
-    8,--数据位
-    1--停止位
-)
-local function read(uid)
-    log.info("uart", "buff table", #recvBuff[uid])
-    local s = table.concat(recvBuff[uid])
-    log.info("uart", "buff string", #s)
-    recvBuff[uid] = {}
-    uart.write(uartid,s)
-end
-sys.timerLoopStart(function()
-    log.info("RAM:", _G.collectgarbage("count"))-- 打印占用的RAM
-end, 1000)
-local function taskRead()
-    uart.on(
-        1,
-        'receive',
-        function(uid, length)
-            --table.insert(recvBuff[uid], uart.read(uid, length or 1024))
-            --sys.timerStart(sys.publish, 50, 'UART_RECV_WAIT_', uid)
-            uart.write(uid, uart.read(uid, length or 1024))
-        end
-    )
-end
-sys.subscribe('UART_RECV_WAIT_', read)
-sys.taskInit(taskRead)
-sys.run()