#157 fixed bug with RTU remount messages

This commit is contained in:
Mikayla Fischler
2023-02-12 13:06:44 -05:00
parent 42ff61a8a1
commit 4d40d08a7a
8 changed files with 49 additions and 16 deletions

View File

@@ -265,7 +265,7 @@ function rtu.new_session(id, in_queue, out_queue, advertisement, facility)
_handle_advertisement()
elseif pkt.type == SCADA_MGMT_TYPES.RTU_DEV_REMOUNT then
if pkt.length == 1 then
local unit_id = pkt[1]
local unit_id = pkt.data[1]
if self.units[unit_id] ~= nil then
local unit = self.units[unit_id] ---@type unit_session
unit.invalidate_cache()

View File

@@ -137,6 +137,8 @@ function boilerv.new(session_id, unit_id, advert, out_queue)
-- load in data if correct length
if m_pkt.length == 1 then
self.db.formed = m_pkt.data[1]
if not self.db.formed then self.has_build = false end
else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end

View File

@@ -124,6 +124,8 @@ function imatrix.new(session_id, unit_id, advert, out_queue)
-- load in data if correct length
if m_pkt.length == 1 then
self.db.formed = m_pkt.data[1]
if not self.db.formed then self.has_build = false end
else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end

View File

@@ -129,6 +129,8 @@ function sps.new(session_id, unit_id, advert, out_queue)
-- load in data if correct length
if m_pkt.length == 1 then
self.db.formed = m_pkt.data[1]
if not self.db.formed then self.has_build = false end
else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end

View File

@@ -166,6 +166,8 @@ function turbinev.new(session_id, unit_id, advert, out_queue)
-- load in data if correct length
if m_pkt.length == 1 then
self.db.formed = m_pkt.data[1]
if not self.db.formed then self.has_build = false end
else
log.debug(log_tag .. "MODBUS transaction reply length mismatch (" .. TXN_TAGS[txn_type] .. ")")
end

View File

@@ -14,7 +14,7 @@ local svsessions = require("supervisor.session.svsessions")
local config = require("supervisor.config")
local supervisor = require("supervisor.supervisor")
local SUPERVISOR_VERSION = "beta-v0.11.0"
local SUPERVISOR_VERSION = "beta-v0.11.1"
local print = util.print
local println = util.println