#574 possible fix for RTU formed checking
This commit is contained in:
@@ -242,7 +242,7 @@ function ppm.mount_all()
|
||||
end
|
||||
end
|
||||
|
||||
-- mount a particular device
|
||||
-- mount a specified device
|
||||
---@nodiscard
|
||||
---@param iface string CC peripheral interface
|
||||
---@return string|nil type, table|nil device
|
||||
@@ -266,6 +266,33 @@ function ppm.mount(iface)
|
||||
return pm_type, pm_dev
|
||||
end
|
||||
|
||||
-- unmount and remount a specified device
|
||||
---@nodiscard
|
||||
---@param iface string CC peripheral interface
|
||||
---@return string|nil type, table|nil device
|
||||
function ppm.remount(iface)
|
||||
local ifaces = peripheral.getNames()
|
||||
local pm_dev = nil
|
||||
local pm_type = nil
|
||||
|
||||
for i = 1, #ifaces do
|
||||
if iface == ifaces[i] then
|
||||
log.info(util.c("PPM: remount(", iface, ") -> is a ", pm_type))
|
||||
ppm.unmount(ppm_sys.mounts[iface].dev)
|
||||
|
||||
ppm_sys.mounts[iface] = peri_init(iface)
|
||||
|
||||
pm_type = ppm_sys.mounts[iface].type
|
||||
pm_dev = ppm_sys.mounts[iface].dev
|
||||
|
||||
log.info(util.c("PPM: remount(", iface, ") -> remounted a ", pm_type))
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
return pm_type, pm_dev
|
||||
end
|
||||
|
||||
-- mount a virtual, placeholder device (specifically designed for RTU startup with missing devices)
|
||||
---@nodiscard
|
||||
---@return string type, table device
|
||||
|
||||
@@ -24,7 +24,7 @@ local t_pack = table.pack
|
||||
local util = {}
|
||||
|
||||
-- scada-common version
|
||||
util.version = "1.4.6"
|
||||
util.version = "1.4.7"
|
||||
|
||||
util.TICK_TIME_S = 0.05
|
||||
util.TICK_TIME_MS = 50
|
||||
|
||||
Reference in New Issue
Block a user