#635 comms optimizations
This commit is contained in:
12
rtu/rtu.lua
12
rtu/rtu.lua
@@ -425,18 +425,10 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
local pkt = nil
|
||||
|
||||
if s_pkt then
|
||||
-- get as MODBUS TCP packet
|
||||
if s_pkt.protocol() == PROTOCOL.MODBUS_TCP then
|
||||
local m_pkt = comms.modbus_packet()
|
||||
if m_pkt.decode(s_pkt) then
|
||||
pkt = m_pkt.get()
|
||||
end
|
||||
-- get as SCADA management packet
|
||||
pkt = comms.modbus_packet().decode(s_pkt)
|
||||
elseif s_pkt.protocol() == PROTOCOL.SCADA_MGMT then
|
||||
local mgmt_pkt = comms.mgmt_packet()
|
||||
if mgmt_pkt.decode(s_pkt) then
|
||||
pkt = mgmt_pkt.get()
|
||||
end
|
||||
pkt = comms.mgmt_packet().decode(s_pkt)
|
||||
else
|
||||
log.debug("illegal packet type " .. s_pkt.protocol(), true)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user