#580 comment updates, rtu listen fix, and trusted range init change
This commit is contained in:
20
rtu/rtu.lua
20
rtu/rtu.lua
@@ -306,7 +306,15 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
|
||||
local insert = table.insert
|
||||
|
||||
-- PRIVATE FUNCTIONS --
|
||||
if config.WirelessModem then
|
||||
comms.set_trusted_range(config.TrustedRange)
|
||||
end
|
||||
|
||||
-- configure network channels
|
||||
nic.closeAll()
|
||||
nic.open(config.RTU_Channel)
|
||||
|
||||
--#region PRIVATE FUNCTIONS --
|
||||
|
||||
-- send a scada management packet
|
||||
---@param msg_type MGMT_TYPE
|
||||
@@ -347,7 +355,9 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
return advertisement
|
||||
end
|
||||
|
||||
-- PUBLIC FUNCTIONS --
|
||||
--#endregion
|
||||
|
||||
--#region PUBLIC FUNCTIONS --
|
||||
|
||||
---@class rtu_comms
|
||||
local public = {}
|
||||
@@ -357,10 +367,6 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
function public.switch_nic(_nic)
|
||||
nic.closeAll()
|
||||
|
||||
if _nic.isWireless() then
|
||||
comms.set_trusted_range(config.TrustedRange)
|
||||
end
|
||||
|
||||
-- configure receive channels
|
||||
_nic.closeAll()
|
||||
_nic.open(config.RTU_Channel)
|
||||
@@ -617,6 +623,8 @@ function rtu.comms(version, nic, conn_watchdog)
|
||||
end
|
||||
end
|
||||
|
||||
--#endregion
|
||||
|
||||
return public
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user