Skip to content

Commit

Permalink
更正串口收发时,没转换16进制的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxuuu committed Jun 25, 2019
1 parent d0846af commit b2ef963
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions llcom/DefaultFiles/core_script/head.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,24 @@ end

log = require("log")
sys = require("sys")
uartReceive = function (d) end

--串口数据接收接口
local uartCB = function (d)
if uartReceive then uartReceive(d:fromHex()) end
end

--重写串口数据发送接口
local oldapiSendUartData = apiSendUartData
apiSendUartData = function (s)
local str = s:toHex()
return oldapiSendUartData(str)
end

--协程外部触发
tiggerCB = function (id,type,data)
--log.debug("tigger",id,type,data:toHex())
if type == "uartRev" then--串口消息
uartReceive(data)
uartCB(data)
elseif type == "cmd" then
local result, info = pcall(function ()
load(data)()
Expand Down
4 changes: 2 additions & 2 deletions llcom/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: NeutralResourcesLanguage("zh-CN")]

0 comments on commit b2ef963

Please sign in to comment.