mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#350 handle RPS_DISABLE ack packet on supervisor
This commit is contained in:
parent
24d190921d
commit
26dc6ff6d1
@ -390,6 +390,15 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
|
||||
cmd = UNIT_COMMAND.START,
|
||||
ack = ack
|
||||
})
|
||||
elseif pkt.type == RPLC_TYPE.RPS_DISABLE then
|
||||
-- disable acknowledgement
|
||||
local ack = _get_ack(pkt)
|
||||
if ack then
|
||||
self.acks.disable = true
|
||||
self.sDB.control_state = false
|
||||
elseif ack == false then
|
||||
log.debug(log_header .. "disable failed!")
|
||||
end
|
||||
elseif pkt.type == RPLC_TYPE.RPS_SCRAM then
|
||||
-- manual SCRAM acknowledgement
|
||||
local ack = _get_ack(pkt)
|
||||
@ -791,7 +800,7 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
|
||||
-- reactor disable request retry
|
||||
|
||||
if not self.acks.disable then
|
||||
if rtimes.disable_req - util.time() <= 0 then
|
||||
if rtimes.disable_req - util.time() <= 0 then
|
||||
_send(RPLC_TYPE.RPS_DISABLE, {})
|
||||
rtimes.disable_req = util.time() + RETRY_PERIOD
|
||||
end
|
||||
@ -800,7 +809,7 @@ function plc.new_session(id, s_addr, reactor_id, in_queue, out_queue, timeout, f
|
||||
-- SCRAM request retry
|
||||
|
||||
if not self.acks.scram then
|
||||
if rtimes.scram_req - util.time() <= 0 then
|
||||
if rtimes.scram_req - util.time() <= 0 then
|
||||
_send(RPLC_TYPE.RPS_SCRAM, {})
|
||||
rtimes.scram_req = util.time() + RETRY_PERIOD
|
||||
end
|
||||
|
@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
|
||||
|
||||
local svsessions = require("supervisor.session.svsessions")
|
||||
|
||||
local SUPERVISOR_VERSION = "v1.0.7"
|
||||
local SUPERVISOR_VERSION = "v1.0.8"
|
||||
|
||||
local println = util.println
|
||||
local println_ts = util.println_ts
|
||||
|
Loading…
Reference in New Issue
Block a user