#300 comms device type cleanup

This commit is contained in:
Mikayla 2023-08-30 21:15:42 +00:00
parent cfc6479dd5
commit f267a4e569
3 changed files with 5 additions and 11 deletions

View File

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

View File

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

View File

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