code cleanup
This commit is contained in:
@@ -15,10 +15,10 @@ databus.ps = psil.create()
|
||||
function databus.heartbeat() databus.ps.toggle("heartbeat") end
|
||||
|
||||
-- transmit firmware versions across the bus
|
||||
---@param plc_v string supervisor version
|
||||
---@param sv_v string supervisor version
|
||||
---@param comms_v string comms version
|
||||
function databus.tx_versions(plc_v, comms_v)
|
||||
databus.ps.publish("version", plc_v)
|
||||
function databus.tx_versions(sv_v, comms_v)
|
||||
databus.ps.publish("version", sv_v)
|
||||
databus.ps.publish("comms_version", comms_v)
|
||||
end
|
||||
|
||||
@@ -38,7 +38,7 @@ function databus.tx_plc_connected(reactor_id, fw, channel)
|
||||
databus.ps.publish("plc_" .. reactor_id .. "_chan", tostring(channel))
|
||||
end
|
||||
|
||||
-- transmit PLC session connection state
|
||||
-- transmit PLC disconnected
|
||||
---@param reactor_id integer reactor unit ID
|
||||
function databus.tx_plc_disconnected(reactor_id)
|
||||
databus.ps.publish("plc_" .. reactor_id .. "_fw", " ------- ")
|
||||
@@ -110,7 +110,7 @@ function databus.tx_crd_connected(fw, channel)
|
||||
databus.ps.publish("crd_chan", tostring(channel))
|
||||
end
|
||||
|
||||
-- transmit coordinator session connection state
|
||||
-- transmit coordinator disconnected
|
||||
function databus.tx_crd_disconnected()
|
||||
databus.ps.publish("crd_fw", " ------- ")
|
||||
databus.ps.publish("crd_conn", false)
|
||||
@@ -133,7 +133,7 @@ function databus.tx_crd_rtt(rtt)
|
||||
end
|
||||
end
|
||||
|
||||
-- transmit PDG firmware version and session connection state
|
||||
-- transmit PKT firmware version and PDG session connection state
|
||||
---@param session_id integer PDG session
|
||||
---@param fw string firmware version
|
||||
---@param channel integer PDG remote port
|
||||
@@ -143,7 +143,7 @@ function databus.tx_pdg_connected(session_id, fw, channel)
|
||||
pgi.create_pdg_entry(session_id)
|
||||
end
|
||||
|
||||
-- transmit PDG disconnected
|
||||
-- transmit PDG session disconnected
|
||||
---@param session_id integer PDG session
|
||||
function databus.tx_pdg_disconnected(session_id)
|
||||
pgi.delete_pdg_entry(session_id)
|
||||
|
||||
@@ -195,7 +195,7 @@ local function main()
|
||||
|
||||
-- check for termination request
|
||||
if event == "terminate" or ppm.should_terminate() then
|
||||
println_ts("closing sesssions...")
|
||||
println_ts("closing sessions...")
|
||||
log.info("terminate requested, closing sessions...")
|
||||
svsessions.close_all()
|
||||
log.info("sessions closed")
|
||||
|
||||
@@ -308,7 +308,7 @@ function supervisor.comms(_version, num_reactors, cooling_conf, modem, dev_liste
|
||||
-- this is an attempt to establish a new pocket diagnostic session
|
||||
local s_id = svsessions.establish_pdg_session(l_port, r_port, firmware_v)
|
||||
|
||||
println(util.c("PDG (", firmware_v, ") [:", r_port, "] \xbb connected"))
|
||||
println(util.c("PKT (", firmware_v, ") [:", r_port, "] \xbb connected"))
|
||||
log.info(util.c("SVCTL_ESTABLISH: pocket (", firmware_v, ") [:", r_port, "] connected with session ID ", s_id))
|
||||
|
||||
_send_svctl_establish(next_seq_id, r_port, { ESTABLISH_ACK.ALLOW })
|
||||
|
||||
Reference in New Issue
Block a user