#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

@@ -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