From fa19af308d4eda964c362aedd8ff9e7e1fd7d57e Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 23 Apr 2022 20:46:01 -0400 Subject: [PATCH] bugfix and use timestamp in packet --- supervisor/session/plc.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/supervisor/session/plc.lua b/supervisor/session/plc.lua index 7b17feb..7694ef4 100644 --- a/supervisor/session/plc.lua +++ b/supervisor/session/plc.lua @@ -35,7 +35,7 @@ function new_session(id, for_reactor, in_queue, out_queue) last_rtt = 0, -- when to next retry one of these requests periodics = { - last_update = 0 + last_update = 0, keep_alive = 0 }, retry_times = { @@ -45,6 +45,7 @@ function new_session(id, for_reactor, in_queue, out_queue) }, -- session database sDB = { + last_status_update = 0, control_state = false, overridden = false, degraded = false, @@ -200,7 +201,7 @@ function new_session(id, for_reactor, in_queue, out_queue) elseif rplc_pkt.type == RPLC_TYPES.STATUS then -- status packet received, update data if rplc_pkt.length >= 5 then - -- @todo [1] is timestamp, determine how this will be used (if at all) + self.sDB.last_status_update = rplc_pkt.data[1] self.sDB.control_state = rplc_pkt.data[2] self.sDB.overridden = rplc_pkt.data[3] self.sDB.degraded = rplc_pkt.data[4]