reactor PLC queue types refactor and properly report wireless modem connected when another is found

This commit is contained in:
Mikayla
2025-11-06 22:54:48 +00:00
parent 44340f42d4
commit b2baaa2090
3 changed files with 10 additions and 8 deletions

View File

@@ -118,7 +118,7 @@ function backplane.active_nic() return _bp.act_nic end
---@param device table
---@param print_no_fp function
function backplane.attach(iface, type, device, print_no_fp)
local MQ__RPS_CMD = _bp.smem.q_cmds.MQ__RPS_CMD
local MQ__RPS_CMD = _bp.smem.q_types.MQ__RPS_CMD
local wl_nic, wd_nic = _bp.wl_nic, _bp.wd_nic
@@ -217,7 +217,7 @@ end
---@param device table
---@param print_no_fp function
function backplane.detach(iface, type, device, print_no_fp)
local MQ__RPS_CMD = _bp.smem.q_cmds.MQ__RPS_CMD
local MQ__RPS_CMD = _bp.smem.q_types.MQ__RPS_CMD
local wl_nic, wd_nic = _bp.wl_nic, _bp.wd_nic
@@ -266,6 +266,8 @@ function backplane.detach(iface, type, device, print_no_fp)
wl_nic.connect(modem)
log.info("BKPLN: WIRELESS PHY_UP " .. m_iface)
state.wl_modem = true
elseif wd_nic and wd_nic.is_connected() then
_bp.act_nic = wd_nic

View File

@@ -125,8 +125,8 @@ local function main()
mq_comms_rx = mqueue.new()
},
-- message queue commands
q_cmds = {
-- message queue message types
q_types = {
MQ__RPS_CMD = {
SCRAM = 1,
DEGRADED_SCRAM = 2,

View File

@@ -48,8 +48,8 @@ function threads.thread__main(smem)
local plc_comms = smem.plc_sys.plc_comms
local conn_watchdog = smem.plc_sys.conn_watchdog
local MQ__RPS_CMD = smem.q_cmds.MQ__RPS_CMD
local MQ__COMM_CMD = smem.q_cmds.MQ__COMM_CMD
local MQ__RPS_CMD = smem.q_types.MQ__RPS_CMD
local MQ__COMM_CMD = smem.q_types.MQ__COMM_CMD
-- start clock
loop_clock.start()
@@ -204,7 +204,7 @@ function threads.thread__rps(smem)
local rps_queue = smem.q.mq_rps
local MQ__RPS_CMD = smem.q_cmds.MQ__RPS_CMD
local MQ__RPS_CMD = smem.q_types.MQ__RPS_CMD
local was_linked = false
local last_update = util.time()
@@ -339,7 +339,7 @@ function threads.thread__comms_tx(smem)
local plc_state = smem.plc_state
local comms_queue = smem.q.mq_comms_tx
local MQ__COMM_CMD = smem.q_cmds.MQ__COMM_CMD
local MQ__COMM_CMD = smem.q_types.MQ__COMM_CMD
local last_update = util.time()