#338 resolved diagnostic warnings

This commit is contained in:
Mikayla Fischler
2023-09-03 17:54:39 -04:00
parent b9073153b3
commit 5585088e3a
15 changed files with 25 additions and 42 deletions

View File

@@ -55,7 +55,7 @@ function txnctrl.new()
-- mark a transaction as resolved to get its transaction type
---@nodiscard
---@param txn_id integer
---@return integer txn_type
---@return integer|nil txn_type
function public.resolve(txn_id)
local txn_type = nil

View File

@@ -73,7 +73,13 @@ function unit_session.new(session_id, unit_id, advert, out_queue, log_tag, txn_t
if m_pkt.scada_frame.protocol() == PROTOCOL.MODBUS_TCP then
if m_pkt.unit_id == unit_id then
local txn_type = self.transaction_controller.resolve(m_pkt.txn_id)
local txn_tag = " (" .. util.strval(txn_tags[txn_type]) .. ")"
local txn_tag = util.c(" (", txn_tags[txn_type], ")")
if txn_type == nil then
-- couldn't find this transaction
log.debug(log_tag .. "MODBUS: expired or spurious transaction reply (txn_id " .. m_pkt.txn_id .. ")")
return false, m_pkt.txn_id
end
if bit.band(m_pkt.func_code, MODBUS_FCODE.ERROR_FLAG) ~= 0 then
-- transaction incomplete or failed

View File

@@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v1.0.3"
local SUPERVISOR_VERSION = "v1.0.4"
local println = util.println
local println_ts = util.println_ts