#642 updated reactor PLC connection test

This commit is contained in:
Mikayla Fischler
2025-11-08 17:20:24 -05:00
parent 504dce64c2
commit 569358a4e1
5 changed files with 19 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
-- Supervisor Sessions Handler
--
local comms = require("scada-common.comms")
local log = require("scada-common.log")
local mqueue = require("scada-common.mqueue")
local types = require("scada-common.types")
@@ -465,9 +466,12 @@ end
---@param i_seq_num integer initial (most recent) sequence number
---@param for_reactor integer unit ID
---@param version string PLC version
---@return integer|false session_id
---@return integer|boolean session_id session ID, false if unit is already connected, and true if this is a successful connection test
function svsessions.establish_plc_session(nic, source_addr, i_seq_num, for_reactor, version)
if svsessions.get_reactor_session(for_reactor) == nil and for_reactor >= 1 and for_reactor <= self.config.UnitCount then
-- don't actually establish this if it is a connection test
if version == comms.CONN_TEST_FWV then return true end
---@class plc_session_struct
local plc_s = {
s_type = "plc",