galjonsfigur 6926c66b16 Polish Lua examples (#2846)
* Add missing globals from luacheck config

* Fix luacheck warnings in all lua files

* Re-enable luacheck in Travis

* Speed up Travis by using preinstalled LuaRocks

* Fix more luacheck warnings in httpserver lua module

* Fix DCC module and add appropriate definitions to luacheck config.

* Change inline comments from ignoring block to only ignore specific line

* Add Luacheck for Windows and enable it for both Windows and Linux

* Change luacheck exceptions and fix errors from 1st round of polishing

* Add retry and timeout params to wget
2020-06-09 22:26:52 +02:00

19 lines
385 B
Lua

do
uart.setup(0, 9600, 8, 0, 1, 0)
local sv = net.createServer(net.TCP, 60)
local global_c = nil
sv:listen(9999, function(c)
if global_c~=nil then
global_c:close()
end
global_c = c
c:on("receive",function(_, pl) uart.write(0, pl) end)
end)
uart.on("data", 4, function(data)
if global_c ~= nil then
global_c:send(data)
end
end, 0)
end