#358 fixed non-networked PLC operation
This commit is contained in:
parent
670ca78a5b
commit
86e8feaabc
@ -54,13 +54,17 @@ function plc.load_config()
|
|||||||
cfv.assert_type_bool(config.Networked)
|
cfv.assert_type_bool(config.Networked)
|
||||||
cfv.assert_type_int(config.UnitID)
|
cfv.assert_type_int(config.UnitID)
|
||||||
cfv.assert_type_bool(config.EmerCoolEnable)
|
cfv.assert_type_bool(config.EmerCoolEnable)
|
||||||
cfv.assert_channel(config.SVR_Channel)
|
|
||||||
cfv.assert_channel(config.PLC_Channel)
|
if config.Networked == true then
|
||||||
cfv.assert_type_int(config.ConnTimeout)
|
cfv.assert_channel(config.SVR_Channel)
|
||||||
cfv.assert_min(config.ConnTimeout, 2)
|
cfv.assert_channel(config.PLC_Channel)
|
||||||
cfv.assert_type_num(config.TrustedRange)
|
cfv.assert_type_int(config.ConnTimeout)
|
||||||
cfv.assert_min(config.TrustedRange, 0)
|
cfv.assert_min(config.ConnTimeout, 2)
|
||||||
cfv.assert_type_str(config.AuthKey)
|
cfv.assert_type_num(config.TrustedRange)
|
||||||
|
cfv.assert_min(config.TrustedRange, 0)
|
||||||
|
cfv.assert_type_str(config.AuthKey)
|
||||||
|
end
|
||||||
|
|
||||||
cfv.assert_type_int(config.LogMode)
|
cfv.assert_type_int(config.LogMode)
|
||||||
cfv.assert_type_str(config.LogPath)
|
cfv.assert_type_str(config.LogPath)
|
||||||
cfv.assert_type_bool(config.LogDebug)
|
cfv.assert_type_bool(config.LogDebug)
|
||||||
|
|||||||
@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
|
|||||||
local renderer = require("reactor-plc.renderer")
|
local renderer = require("reactor-plc.renderer")
|
||||||
local threads = require("reactor-plc.threads")
|
local threads = require("reactor-plc.threads")
|
||||||
|
|
||||||
local R_PLC_VERSION = "v1.6.0"
|
local R_PLC_VERSION = "v1.6.1"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
@ -69,7 +69,7 @@ local function main()
|
|||||||
ppm.mount_all()
|
ppm.mount_all()
|
||||||
|
|
||||||
-- message authentication init
|
-- message authentication init
|
||||||
if string.len(config.AuthKey) > 0 then
|
if type(config.AuthKey) == "string" and string.len(config.AuthKey) > 0 then
|
||||||
network.init_mac(config.AuthKey)
|
network.init_mac(config.AuthKey)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user