diag: add verbose network listener logging to trace command delivery

Manager logs: listener start, every modem_message received, channel
match/mismatch, command acceptance count, handler result.
Client logs: every sendToMaster call with type and commandId.
This commit is contained in:
MayaTheShy
2026-03-29 16:39:29 -04:00
parent 033da0933c
commit 9835556e6f
2 changed files with 18 additions and 1 deletions

View File

@@ -105,10 +105,14 @@ end
-------------------------------------------------
local function sendToMaster(message)
if not networkModem then return end
if not networkModem then
log.warn("NET", "sendToMaster: no modem, dropping %s", tostring(message.type))
return
end
if not message.commandId then
message.commandId = newCommandId()
end
log.info("NET", "TX -> ch %d: type=%s cmdId=%s", ORDER_CHANNEL, tostring(message.type), tostring(message.commandId))
networkModem.transmit(ORDER_CHANNEL, CLIENT_CHANNEL, message)
end