mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#300 comms device type cleanup
This commit is contained in:
@ -316,7 +316,7 @@ function coordinator.comms(version, nic, num_units, crd_channel, svr_channel, pk
|
|||||||
|
|
||||||
-- attempt connection establishment
|
-- attempt connection establishment
|
||||||
local function _send_establish()
|
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
|
end
|
||||||
|
|
||||||
-- keep alive ack
|
-- keep alive ack
|
||||||
|
@ -21,7 +21,7 @@ comms.version = "2.3.0"
|
|||||||
|
|
||||||
---@enum PROTOCOL
|
---@enum PROTOCOL
|
||||||
local PROTOCOL = {
|
local PROTOCOL = {
|
||||||
MODBUS_TCP = 0, -- our "MODBUS TCP"-esque protocol
|
MODBUS_TCP = 0, -- the "MODBUS TCP"-esque protocol
|
||||||
RPLC = 1, -- reactor PLC protocol
|
RPLC = 1, -- reactor PLC protocol
|
||||||
SCADA_MGMT = 2, -- SCADA supervisor management, device advertisements, etc
|
SCADA_MGMT = 2, -- SCADA supervisor management, device advertisements, etc
|
||||||
SCADA_CRDN = 3 -- data/control packets for coordinators to/from supervisory controllers
|
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
|
BAD_VERSION = 3 -- link denied due to comms version mismatch
|
||||||
}
|
}
|
||||||
|
|
||||||
---@enum DEVICE_TYPE
|
---@enum DEVICE_TYPE device types for establish messages
|
||||||
local DEVICE_TYPE = {
|
local DEVICE_TYPE = { PLC = 0, RTU = 1, SVR = 2, CRD = 3, PKT = 4 }
|
||||||
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 PLC_AUTO_ACK
|
---@enum PLC_AUTO_ACK
|
||||||
local PLC_AUTO_ACK = {
|
local PLC_AUTO_ACK = {
|
||||||
|
@ -291,7 +291,7 @@ function supervisor.comms(_version, nic, fp_ok)
|
|||||||
end
|
end
|
||||||
|
|
||||||
_send_establish(packet.scada_frame, ESTABLISH_ACK.BAD_VERSION)
|
_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
|
-- this is an attempt to establish a new coordinator session
|
||||||
local s_id = svsessions.establish_crd_session(src_addr, firmware_v)
|
local s_id = svsessions.establish_crd_session(src_addr, firmware_v)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user