diff --git a/coordinator/coordinator.lua b/coordinator/coordinator.lua index 2a20e06..aa29ee8 100644 --- a/coordinator/coordinator.lua +++ b/coordinator/coordinator.lua @@ -316,7 +316,7 @@ function coordinator.comms(version, nic, num_units, crd_channel, svr_channel, pk -- attempt connection establishment local function _send_establish() - _send_sv(PROTOCOL.SCADA_MGMT, MGMT_TYPE.ESTABLISH, { comms.version, version, DEVICE_TYPE.CRDN }) + _send_sv(PROTOCOL.SCADA_MGMT, MGMT_TYPE.ESTABLISH, { comms.version, version, DEVICE_TYPE.CRD }) end -- keep alive ack diff --git a/scada-common/comms.lua b/scada-common/comms.lua index f01a3e5..081950e 100644 --- a/scada-common/comms.lua +++ b/scada-common/comms.lua @@ -21,7 +21,7 @@ comms.version = "2.3.0" ---@enum PROTOCOL local PROTOCOL = { - MODBUS_TCP = 0, -- our "MODBUS TCP"-esque protocol + MODBUS_TCP = 0, -- the "MODBUS TCP"-esque protocol RPLC = 1, -- reactor PLC protocol SCADA_MGMT = 2, -- SCADA supervisor management, device advertisements, etc SCADA_CRDN = 3 -- data/control packets for coordinators to/from supervisory controllers @@ -74,14 +74,8 @@ local ESTABLISH_ACK = { BAD_VERSION = 3 -- link denied due to comms version mismatch } ----@enum DEVICE_TYPE -local DEVICE_TYPE = { - PLC = 0, -- PLC device type for establish - RTU = 1, -- RTU device type for establish - SV = 2, -- supervisor device type for establish - CRDN = 3, -- coordinator device type for establish - PKT = 4 -- pocket device type for establish -} +---@enum DEVICE_TYPE device types for establish messages +local DEVICE_TYPE = { PLC = 0, RTU = 1, SVR = 2, CRD = 3, PKT = 4 } ---@enum PLC_AUTO_ACK local PLC_AUTO_ACK = { diff --git a/supervisor/supervisor.lua b/supervisor/supervisor.lua index 3c25110..498a51d 100644 --- a/supervisor/supervisor.lua +++ b/supervisor/supervisor.lua @@ -291,7 +291,7 @@ function supervisor.comms(_version, nic, fp_ok) end _send_establish(packet.scada_frame, ESTABLISH_ACK.BAD_VERSION) - elseif dev_type == DEVICE_TYPE.CRDN then + elseif dev_type == DEVICE_TYPE.CRD then -- this is an attempt to establish a new coordinator session local s_id = svsessions.establish_crd_session(src_addr, firmware_v)