#201 supervisor pocket diagnostics session

This commit is contained in:
Mikayla Fischler
2023-04-18 13:49:59 -04:00
parent d295c2b3c3
commit 449e393b73
7 changed files with 314 additions and 77 deletions

View File

@@ -47,7 +47,7 @@ function rtu.new_session(id, in_queue, out_queue, timeout, advertisement, facili
seq_num = 0,
r_seq_num = nil,
connected = true,
rtu_conn_watchdog = util.new_watchdog(timeout),
conn_watchdog = util.new_watchdog(timeout),
last_rtt = 0,
-- periodic messages
periodics = {
@@ -174,7 +174,7 @@ function rtu.new_session(id, in_queue, out_queue, timeout, advertisement, facili
-- mark this RTU session as closed, stop watchdog
local function _close()
self.rtu_conn_watchdog.cancel()
self.conn_watchdog.cancel()
self.connected = false
-- mark all RTU unit sessions as closed so the reactor unit knows
@@ -222,7 +222,7 @@ function rtu.new_session(id, in_queue, out_queue, timeout, advertisement, facili
end
-- feed watchdog
self.rtu_conn_watchdog.feed()
self.conn_watchdog.feed()
-- process packet
if pkt.scada_frame.protocol() == PROTOCOL.MODBUS_TCP then
@@ -286,7 +286,7 @@ function rtu.new_session(id, in_queue, out_queue, timeout, advertisement, facili
---@nodiscard
---@param timer number
function public.check_wd(timer)
return self.rtu_conn_watchdog.is_timer(timer) and self.connected
return self.conn_watchdog.is_timer(timer) and self.connected
end
-- close the connection