#245 fixed coordinator missing pocket packets and connection timeouts
This commit is contained in:
parent
0b939be412
commit
38fc7189ba
@ -335,12 +335,13 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
|||||||
tick_dmesg_waiting(math.max(0, timeout_s - (util.time_s() - start)))
|
tick_dmesg_waiting(math.max(0, timeout_s - (util.time_s() - start)))
|
||||||
_send_establish()
|
_send_establish()
|
||||||
clock.start()
|
clock.start()
|
||||||
|
elseif event == "timer" then
|
||||||
|
-- keep checking watchdog timers
|
||||||
|
apisessions.check_all_watchdogs(p1)
|
||||||
elseif event == "modem_message" then
|
elseif event == "modem_message" then
|
||||||
-- handle message
|
-- handle message
|
||||||
local packet = public.parse_packet(p1, p2, p3, p4, p5)
|
local packet = public.parse_packet(p1, p2, p3, p4, p5)
|
||||||
if packet ~= nil and packet.type == SCADA_MGMT_TYPE.ESTABLISH then
|
|
||||||
public.handle_packet(packet)
|
public.handle_packet(packet)
|
||||||
end
|
|
||||||
elseif event == "terminate" then
|
elseif event == "terminate" then
|
||||||
terminated = true
|
terminated = true
|
||||||
break
|
break
|
||||||
|
|||||||
@ -117,8 +117,6 @@ function api.new_session(id, in_queue, out_queue, timeout)
|
|||||||
-- process packet
|
-- process packet
|
||||||
if pkt.scada_frame.protocol() == PROTOCOL.COORD_API then
|
if pkt.scada_frame.protocol() == PROTOCOL.COORD_API then
|
||||||
---@cast pkt capi_frame
|
---@cast pkt capi_frame
|
||||||
-- feed watchdog
|
|
||||||
self.conn_watchdog.feed()
|
|
||||||
|
|
||||||
-- handle packet by type
|
-- handle packet by type
|
||||||
if pkt.type == nil then
|
if pkt.type == nil then
|
||||||
|
|||||||
@ -20,7 +20,7 @@ local sounder = require("coordinator.sounder")
|
|||||||
|
|
||||||
local apisessions = require("coordinator.session.apisessions")
|
local apisessions = require("coordinator.session.apisessions")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "v0.15.7"
|
local COORDINATOR_VERSION = "v0.15.8"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user