#118 refactoring of comms types

This commit is contained in:
Mikayla Fischler
2023-02-21 11:05:57 -05:00
parent 34cac6a8b8
commit 6e0dde3f30
20 changed files with 354 additions and 357 deletions

View File

@@ -7,7 +7,7 @@ local unit_session = require("supervisor.session.rtu.unit_session")
local sna = {}
local RTU_UNIT_TYPES = comms.RTU_UNIT_TYPES
local RTU_UNIT_TYPE = comms.RTU_UNIT_TYPE
local MODBUS_FCODE = types.MODBUS_FCODE
local TXN_TYPES = {
@@ -35,7 +35,7 @@ local PERIODICS = {
---@param out_queue mqueue RTU unit message out queue
function sna.new(session_id, unit_id, advert, out_queue)
-- type check
if advert.type ~= RTU_UNIT_TYPES.SNA then
if advert.type ~= RTU_UNIT_TYPE.SNA then
log.error("attempt to instantiate sna RTU for type '" .. advert.type .. "'. this is a bug.")
return nil
end