#604 new redstone initialization logic
This commit is contained in:
17
rtu/rtu.lua
17
rtu/rtu.lua
@@ -338,13 +338,7 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
local unit = units[i]
|
||||
|
||||
if unit.type ~= nil then
|
||||
local advert = { unit.type, unit.index, unit.reactor }
|
||||
|
||||
if unit.type == RTU_UNIT_TYPE.REDSTONE then
|
||||
insert(advert, unit.device)
|
||||
end
|
||||
|
||||
insert(advertisement, advert)
|
||||
insert(advertisement, { unit.type, unit.index, unit.reactor or -1, unit.rs_conns })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -479,12 +473,7 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
|
||||
if unit.type == RTU_UNIT_TYPE.REDSTONE then
|
||||
-- immediately execute redstone RTU requests
|
||||
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
|
||||
return_code, reply = unit.modbus_io.handle_packet(packet)
|
||||
|
||||
if not return_code then
|
||||
log.warning("requested MODBUS operation failed" .. unit_dbg_tag)
|
||||
@@ -502,7 +491,7 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
unit.pkt_queue.push_packet(packet)
|
||||
end
|
||||
else
|
||||
log.warning("cannot perform requested MODBUS operation" .. unit_dbg_tag)
|
||||
log.warning("requested MODBUS operation failed" .. unit_dbg_tag)
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user