Skip to content

Commit b9b848d

Browse files
committed
更新readme
1 parent 93097d3 commit b9b848d

File tree

2 files changed

+131
-4
lines changed

2 files changed

+131
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# LLCOM
22

3+
[English readme click here](/README_EN.md)
4+
35
![icon](/llcom/llcom.ico)
46

57
[![Build Status](https://chenxuuu.visualstudio.com/llcom/_apis/build/status/chenxuuu.llcom?branchName=master&jobName=Job)](https://chenxuuu.visualstudio.com/llcom/_build/latest?definitionId=1&branchName=master)
@@ -122,10 +124,7 @@ response:Close()
122124

123125
## 已知问题与待添加的功能(请大家反馈,谢谢!)
124126

125-
- [x] ~~bug:快速大量lua任务回调会有概率性报错(主分支)~~
126-
- [x] ~~bug:使用nlua作为框架时,会在调用协程代码时报错(nlua分支代码)~~
127-
- [x] ~~bug:使用vJine.Lua作为框架时,会出现加载失败的情况,原因不明(主分支)~~
128-
- [ ] bug:某些条件下(比如Air720重启),COM口消失后不会被释放,导致无法再次开启该COM口,只能重启软件
127+
- [ ] bug:某些条件下(比如Air720重启),COM口消失后不会被释放,导致无法再次开启该COM口,只能重启软件([.net 框架的bug,微软的人在看了](https://github.com/dotnet/corefx/issues/39464)
129128

130129
## 常见问题
131130

README_EN.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# LLCOM
2+
3+
![icon](/llcom/llcom.ico)
4+
5+
[![Build Status](https://chenxuuu.visualstudio.com/llcom/_apis/build/status/chenxuuu.llcom?branchName=master&jobName=Job)](https://chenxuuu.visualstudio.com/llcom/_build/latest?definitionId=1&branchName=master)
6+
[![Build status](https://ci.appveyor.com/api/projects/status/telji5j8r0v5001c?svg=true)](https://ci.appveyor.com/project/chenxuuu/llcom)
7+
[![MIT](https://img.shields.io/static/v1.svg?label=license&message=Apache+2&color=blue)](https://github.com/chenxuuu/llcom/blob/master/LICENSE)
8+
[![code-size](https://img.shields.io/github/languages/code-size/chenxuuu/llcom.svg)](https://github.com/chenxuuu/llcom/archive/master.zip)
9+
10+
A serial port debugger tool, with lua script.
11+
12+
> this tools is only Chinese now, you can help me to translate, thanks!
13+
14+
## Download
15+
16+
Release page stable version: [GitHub](https://github.com/chenxuuu/llcom/releases/latest)
17+
18+
Appveyor snapshot version: [Appveyor Artifacts](https://ci.appveyor.com/project/chenxuuu/llcom/build/artifacts)
19+
20+
## Functions
21+
22+
- Basic functions of serial port debugger tools.
23+
- The log is clear with two colors, display both HEX values and strings at same time.
24+
- Auto save serial and lua script logs, with time stamp.
25+
- Auto reconnect serial port after disconnected.
26+
- Data you want to send can be processed with your own Lua scripts.
27+
- Quick send bar on the right.
28+
- Lua scripts can be run independently with timer and co-process task features.([Based on LUAT TASK](http://wiki.openluat.com/doc/luatFramework/))
29+
30+
![screen](/screen.png)
31+
![screen2](/screen2.jpg)
32+
![screen3](/screen3.png)
33+
34+
## features' exemplary
35+
36+
### Use Lua script process data you want to send
37+
38+
1. end with "\r\n"
39+
40+
```lua
41+
return uartData.."\r\n"
42+
```
43+
44+
2. send HEX values
45+
46+
```lua
47+
return uartData:fromHex()
48+
```
49+
50+
this script can change `30313233` to `0123`.
51+
52+
3. another script example
53+
54+
```lua
55+
json = require("JSON")
56+
t = uartData:split(",")
57+
return JSON:encode({
58+
key1 = t[1],
59+
key2 = t[2],
60+
key3 = t[3],
61+
})
62+
```
63+
64+
this script can change `a,b,c` to `{"key1":"a","key2":"b","key3":"c"}`.
65+
66+
**these scripts also work with Quick send bar**
67+
68+
### independent script auto process uart sand and receive
69+
70+
you can run your own Lua script on the right, such as llcom's example:
71+
72+
```lua
73+
--register serial port receiver function
74+
uartReceive = function (data)
75+
log.info("uartReceive",data)
76+
sys.publish("UART",data)--publish message
77+
end
78+
79+
--create a task, wait for message
80+
sys.taskInit(function()
81+
while true do
82+
local _,udata = sys.waitUntil("UART")--wait for message
83+
log.info("task waitUntil",udata)
84+
local sendResult = apiSendUartData("ok!")--send uart data
85+
log.info("uart send",sendResult)
86+
end
87+
end)
88+
89+
--reate a task, sleep 1000ms and loop
90+
sys.taskInit(function()
91+
while true do
92+
sys.wait(1000)--wait 1000ms
93+
log.info("task wait",os.time())
94+
end
95+
end)
96+
97+
--1000ms loop timer
98+
sys.timerLoopStart(log.info,1000,"timer test")
99+
```
100+
101+
you alse can use `xlua` to use C# codes
102+
103+
```lua
104+
request = CS.System.Net.WebRequest.Create("http://example.com")
105+
request.ContentType = "text/html;charset=UTF-8";
106+
request.Timeout = 5000;
107+
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";
108+
109+
response = request:GetResponse():GetResponseStream()
110+
111+
myStreamReader = CS.System.IO.StreamReader(response, CS.System.Text.Encoding.UTF8);
112+
113+
print(myStreamReader:ReadToEnd())--get body
114+
115+
myStreamReader:Close()
116+
response:Close()
117+
```
118+
119+
you can make your debug automatic
120+
121+
## api document (in Chinese)
122+
123+
you can [click here](https://github.com/chenxuuu/llcom/blob/master/LuaApi.md)
124+
125+
## Known bugs and functions to be added
126+
127+
- [ ] bug:SerialPort The Requested Resource is in Use([.net's bug](https://github.com/dotnet/corefx/issues/39464))
128+

0 commit comments

Comments
 (0)