Ensure full repeater packet logging

This commit is contained in:
mikecarper
2026-08-19 16:20:24 -07:00
parent 1e4fee0750
commit a52d4e1cba
4 changed files with 10 additions and 17 deletions
+4 -15
View File
@@ -178,8 +178,10 @@ bool Dispatcher::startOutboundTransmit() {
outbound_expiry = futureMillis(max_airtime);
#if MESH_PACKET_LOGGING
logPacketStart("TX", outbound, len);
logPacketEnd(outbound);
if (isUsbLoggingEnabled()) {
logPacketStart("TX", outbound, len);
logPacketEnd(outbound);
}
#endif
return true;
}
@@ -220,23 +222,13 @@ uint32_t Dispatcher::getCADFailMaxDuration() const {
#if MESH_PACKET_LOGGING
void Dispatcher::logPacketStart(const char* direction, const Packet* packet, int len) {
if (!isUsbLoggingEnabled()) return;
#if defined(MESH_COMPACT_PACKET_LOGGING)
(void)packet;
Serial.printf("%s %d\n", direction, len);
#else
Serial.print(getLogDateTime());
Serial.printf(": %s, len=%d (type=%d, route=%s, payload_len=%d)",
direction, len, packet->getPayloadType(),
packet->isRouteDirect() ? "D" : "F", packet->payload_len);
#endif
}
void Dispatcher::logPacketEnd(const Packet* packet) {
if (!isUsbLoggingEnabled()) return;
#if defined(MESH_COMPACT_PACKET_LOGGING)
(void)packet;
#else
const uint8_t type = packet->getPayloadType();
if (packet->payload_len >= 2
&& (type == PAYLOAD_TYPE_PATH || type == PAYLOAD_TYPE_REQ
@@ -246,7 +238,6 @@ void Dispatcher::logPacketEnd(const Packet* packet) {
} else {
Serial.write((uint8_t)'\n');
}
#endif
}
#endif
@@ -602,7 +593,6 @@ void Dispatcher::checkRecv() {
#if MESH_PACKET_LOGGING
if (isUsbLoggingEnabled()) {
logPacketStart("RX", pkt, pkt->getRawLength());
#if !defined(MESH_COMPACT_PACKET_LOGGING)
Serial.printf(" SNR=%d RSSI=%d score=%d time=%d", (int)pkt->getSNR(),
(int)rssi, (int)(score * 1000), air_time);
@@ -611,7 +601,6 @@ void Dispatcher::checkRecv() {
Serial.print(" hash=");
mesh::Utils::printHex(Serial, packet_hash, MAX_HASH_SIZE);
logPacketEnd(pkt);
#endif
}
#endif
logRx(pkt, pkt->getRawLength(), score); // hook for custom logging