Score
0
Watch 9 Star 51 Fork 5

晨旭 / llcomC#Apache-2.0

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
可运行lua脚本的串口调试工具,可提前预处理要发送的数据,也可以独立运行lua脚本。支持定时器、协程、任务订阅与发送特性。 spread retract

Clone or download
Loading...
README_EN.md

LLCOM

icon

Build Status Build status MIT code-size

A serial port debugger tool, with lua script.

this tool is only Chinese now, you can help me to translate, thanks!

Download

Release page stable version: GitHub

Appveyor snapshot version: Appveyor Artifacts

Functions

  • Basic functions of serial port debugger tools.
  • The log is clear with two colors, display both HEX values and strings at same time.
  • Auto save serial and lua script logs, with time stamp.
  • Auto reconnect serial port after disconnected.
  • Data you want to send can be processed with your own Lua scripts.
  • Quick send bar on the right.
  • Lua scripts can be run independently with timer and co-process task features.(Based on LUAT TASK)

screen screen2 screen3

features' exemples

Use Lua script process data you want to send

  1. end with "\r\n"
return uartData.."\r\n"
  1. send HEX values
return uartData:fromHex()

this script can change 30313233 to 0123.

  1. another script example
json = require("JSON")
t = uartData:split(",")
return JSON:encode({
    key1 = t[1],
    key2 = t[2],
    key3 = t[3],
})

this script can change a,b,c to {"key1":"a","key2":"b","key3":"c"}.

these scripts also work with Quick send bar

independent script auto process uart sand and receive

you can run your own Lua script on the right, such as llcom's example:

--register serial port receiver function
uartReceive = function (data)
    log.info("uartReceive",data)
    sys.publish("UART",data)--publish message
end

--create a task, wait for message
sys.taskInit(function()
    while true do
        local _,udata = sys.waitUntil("UART")--wait for message
        log.info("task waitUntil",udata)
        local sendResult = apiSendUartData("ok!")--send uart data
        log.info("uart send",sendResult)
    end
end)

--reate a task, sleep 1000ms and loop
sys.taskInit(function()
    while true do
        sys.wait(1000)--wait 1000ms
        log.info("task wait",os.time())
    end
end)

--1000ms loop timer
sys.timerLoopStart(log.info,1000,"timer test")

you alse can use xlua to use C# codes

request = CS.System.Net.WebRequest.Create("http://example.com")
request.ContentType = "text/html;charset=UTF-8";
request.Timeout = 5000;
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Vivaldi/2.2.1388.37";

response = request:GetResponse():GetResponseStream()

myStreamReader = CS.System.IO.StreamReader(response, CS.System.Text.Encoding.UTF8);

print(myStreamReader:ReadToEnd())--get body

myStreamReader:Close()
response:Close()

you can make your debug automatic

api document (in Chinese)

you can click here

Known bugs and functions to be added

  • bug:SerialPort The Requested Resource is in Use(.net's bug)

Comments ( 0 )

Sign in for post a comment

C#
1
https://gitee.com/chenxuuu/llcom.git
git@gitee.com:chenxuuu/llcom.git
chenxuuu
llcom
llcom
master

Help Search