代码拉取完成,页面将自动刷新
local protoc = require "protoc"
-- load schema from text
assert(protoc:loadfile("../proto/zmqmsg.proto"))
--数据采集数据包模拟
--接收到数据包接口
function recvTask(self, uuid, pri, typeName, bytes)
local data = assert(pb.decode(typeName, bytes))
print("数据采集任务:", uuid)
print(require "serpent".block(data))
local execDir
if string.find(uuid, 'CPRIPORT1') ~= nil then
execDir = 'F:\\ISON_Linux\\TestData\\HW\\CDD\\first'
elseif string.find(uuid, 'CPRIPORT2') ~= nil then
execDir = 'F:\\ISON_Linux\\TestData\\HW\\CDD\\second'
else
execDir = 'F:\\ISON_Linux\\TestData\\HW\\CDD\\data'
end
local decoderData = {
collReq = data.cllReq,
execRsltDir = execDir
}
decoderData.collReq.ossName = data.ossNames[1]
print("Decoder:")
print(require "serpent".block(decoderData))
--生成解码任务
local decoderBytes = assert(pb.encode("zmqmsg.DataDecodeReq", decoderData))
self:sendRequest( "HW_DECODER", uuid..".Decoder", pri, "zmqmsg.DataDecodeReq", decoderBytes)
local repData = {taskName = data.taskName, code = pb.enum("zmqmsg.taskReply.type", "SUCCESS")}
local bytes = assert(pb.encode("zmqmsg.taskReply", repData))
return bytes
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。