review fixes

This commit is contained in:
Mikayla
2025-11-07 23:19:14 +00:00
parent 50dedaa7c8
commit 2ecb662b0a
11 changed files with 46 additions and 42 deletions

View File

@@ -23,7 +23,7 @@ databus.RTU_HW_STATE = RTU_HW_STATE
-- call to toggle heartbeat signal
function databus.heartbeat() databus.ps.toggle("heartbeat") end
-- transmit firmware versions across the bus
-- transmit firmware versions
---@param rtu_v string RTU version
---@param comms_v string comms version
function databus.tx_versions(rtu_v, comms_v)
@@ -31,32 +31,32 @@ function databus.tx_versions(rtu_v, comms_v)
databus.ps.publish("comms_version", comms_v)
end
-- transmit hardware status for the wireless comms modem connection state
---@param has_modem boolean
function databus.tx_hw_wl_modem(has_modem)
databus.ps.publish("has_wl_modem", has_modem)
end
-- transmit hardware status for the wired comms modem connection state
-- transmit hardware status for the wired comms modem
---@param has_modem boolean
function databus.tx_hw_wd_modem(has_modem)
databus.ps.publish("has_wd_modem", has_modem)
end
-- transmit hardware status for the wireless comms modem
---@param has_modem boolean
function databus.tx_hw_wl_modem(has_modem)
databus.ps.publish("has_wl_modem", has_modem)
end
-- transmit the number of speakers connected
---@param count integer
function databus.tx_hw_spkr_count(count)
databus.ps.publish("speaker_count", count)
end
-- transmit unit hardware type across the bus
-- transmit unit hardware type
---@param uid integer unit ID
---@param type RTU_UNIT_TYPE
function databus.tx_unit_hw_type(uid, type)
databus.ps.publish("unit_type_" .. uid, type)
end
-- transmit unit hardware status across the bus
-- transmit unit hardware status
---@param uid integer unit ID
---@param status RTU_HW_STATE
function databus.tx_unit_hw_status(uid, status)
@@ -70,7 +70,7 @@ function databus.tx_rt_status(thread, ok)
databus.ps.publish(util.c("routine__", thread), ok)
end
-- transmit supervisor link state across the bus
-- transmit supervisor link state
---@param state integer
function databus.tx_link_state(state)
databus.ps.publish("link_state", state)

View File

@@ -397,7 +397,6 @@ function rtu.comms(version, nic, conn_watchdog)
s_pkt.make(self.sv_addr, self.seq_num, PROTOCOL.MODBUS_TCP, m_pkt.raw_sendable())
---@diagnostic disable-next-line: need-check-nil
nic.transmit(config.SVR_Channel, config.RTU_Channel, s_pkt)
self.seq_num = self.seq_num + 1
end
@@ -430,8 +429,6 @@ function rtu.comms(version, nic, conn_watchdog)
---@param distance integer
---@return modbus_frame|mgmt_frame|nil packet
function public.parse_packet(side, sender, reply_to, message, distance)
-- unreachable if there isn't a nic
---@diagnostic disable-next-line: need-check-nil
local s_pkt = nic.receive(side, sender, reply_to, message, distance)
local pkt = nil

View File

@@ -118,7 +118,7 @@ local function main()
-- modem and speaker initialization
if not backplane.init(config, __shared_memory) then return end
log.debug("boot> running uinit()")
log.debug("startup> running uinit()")
if uinit(config, __shared_memory) then
-- start UI