#225 work in progress comms changes
This commit is contained in:
@@ -231,32 +231,25 @@ function svsessions.find_plc_session(remote_port)
|
||||
return session
|
||||
end
|
||||
|
||||
-- find a PLC/RTU session by the remote port
|
||||
-- find a coordinator session by the remote port
|
||||
---@nodiscard
|
||||
---@param remote_port integer
|
||||
---@return plc_session_struct|rtu_session_struct|nil
|
||||
function svsessions.find_device_session(remote_port)
|
||||
-- check RTU sessions
|
||||
local session = _find_session(self.sessions.rtu, remote_port)
|
||||
|
||||
-- check PLC sessions
|
||||
if session == nil then session = _find_session(self.sessions.plc, remote_port) end
|
||||
---@cast session plc_session_struct|rtu_session_struct|nil
|
||||
|
||||
---@return coord_session_struct|nil
|
||||
function svsessions.find_coord_session(remote_port)
|
||||
-- check coordinator sessions
|
||||
local session = _find_session(self.sessions.coord, remote_port)
|
||||
---@cast session coord_session_struct|nil
|
||||
return session
|
||||
end
|
||||
|
||||
-- find a coordinator or diagnostic access session by the remote port
|
||||
-- find a pocket diagnostics session by the remote port
|
||||
---@nodiscard
|
||||
---@param remote_port integer
|
||||
---@return coord_session_struct|diag_session_struct|nil
|
||||
function svsessions.find_svctl_session(remote_port)
|
||||
-- check coordinator sessions
|
||||
local session = _find_session(self.sessions.coord, remote_port)
|
||||
|
||||
---@return diag_session_struct|nil
|
||||
function svsessions.find_pdg_session(remote_port)
|
||||
-- check diagnostic sessions
|
||||
if session == nil then session = _find_session(self.sessions.diag, remote_port) end
|
||||
---@cast session coord_session_struct|diag_session_struct|nil
|
||||
local session = _find_session(self.sessions.diag, remote_port)
|
||||
---@cast session diag_session_struct|nil
|
||||
|
||||
return session
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user