#201 supervisor pocket diagnostics session
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user