still queue packets if RTU is busy, determine busy state by queue length rather than flag

This commit is contained in:
Mikayla Fischler
2022-05-17 10:35:55 -04:00
parent 0eff8a3e6a
commit 31ede51c42
3 changed files with 14 additions and 12 deletions

View File

@@ -236,10 +236,8 @@ threads.thread__unit_comms = function (smem, unit)
-- received data
elseif msg.qtype == mqueue.TYPE.PACKET then
-- received a packet
unit.modbus_busy = true
local _, reply = unit.modbus_io.handle_packet(msg.message)
rtu_comms.send_modbus(reply)
unit.modbus_busy = false
end
end