#604 start of total rework of redstone RTUs for relay functionalitiy

This commit is contained in:
Mikayla Fischler
2025-04-21 22:18:09 -04:00
parent 48ec973695
commit 0d7302dc8e
6 changed files with 87 additions and 53 deletions

View File

@@ -477,9 +477,15 @@ function rtu.comms(version, nic, conn_watchdog)
local unit = units[packet.unit_id]
local unit_dbg_tag = " (unit " .. packet.unit_id .. ")"
if unit.name == "redstone_io" then
if unit.type == RTU_UNIT_TYPE.REDSTONE then
-- immediately execute redstone RTU requests
return_code, reply = unit.modbus_io.handle_packet(packet)
if not unit.device then
reply = modbus.reply__srv_device_fail(packet)
return_code = false
else
return_code, reply = unit.modbus_io.handle_packet(packet)
end
if not return_code then
log.warning("requested MODBUS operation failed" .. unit_dbg_tag)
end