mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
eliminate main source of multiline logging
This commit is contained in:
@@ -241,47 +241,48 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr)
|
||||
|
||||
void printPacket(const char *prefix, const meshtastic_MeshPacket *p)
|
||||
{
|
||||
LOG_DEBUG("%s (id=0x%08x fr=0x%02x to=0x%02x, WantAck=%d, HopLim=%d Ch=0x%x", prefix, p->id, p->from & 0xff, p->to & 0xff,
|
||||
p->want_ack, p->hop_limit, p->channel);
|
||||
std::string out = DEBUG_PORT.mt_sprintf("%s (id=0x%08x fr=0x%02x to=0x%02x, WantAck=%d, HopLim=%d Ch=0x%x", prefix, p->id,
|
||||
p->from & 0xff, p->to & 0xff, p->want_ack, p->hop_limit, p->channel);
|
||||
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
||||
auto &s = p->decoded;
|
||||
|
||||
LOG_DEBUG(" Portnum=%d", s.portnum);
|
||||
out += DEBUG_PORT.mt_sprintf(" Portnum=%d", s.portnum);
|
||||
|
||||
if (s.want_response)
|
||||
LOG_DEBUG(" WANTRESP");
|
||||
out += DEBUG_PORT.mt_sprintf(" WANTRESP");
|
||||
|
||||
if (s.source != 0)
|
||||
LOG_DEBUG(" source=%08x", s.source);
|
||||
out += DEBUG_PORT.mt_sprintf(" source=%08x", s.source);
|
||||
|
||||
if (s.dest != 0)
|
||||
LOG_DEBUG(" dest=%08x", s.dest);
|
||||
out += DEBUG_PORT.mt_sprintf(" dest=%08x", s.dest);
|
||||
|
||||
if (s.request_id)
|
||||
LOG_DEBUG(" requestId=%0x", s.request_id);
|
||||
out += DEBUG_PORT.mt_sprintf(" requestId=%0x", s.request_id);
|
||||
|
||||
/* now inside Data and therefore kinda opaque
|
||||
if (s.which_ackVariant == SubPacket_success_id_tag)
|
||||
LOG_DEBUG(" successId=%08x", s.ackVariant.success_id);
|
||||
out += DEBUG_PORT.mt_sprintf(" successId=%08x", s.ackVariant.success_id);
|
||||
else if (s.which_ackVariant == SubPacket_fail_id_tag)
|
||||
LOG_DEBUG(" failId=%08x", s.ackVariant.fail_id); */
|
||||
out += DEBUG_PORT.mt_sprintf(" failId=%08x", s.ackVariant.fail_id); */
|
||||
} else {
|
||||
LOG_DEBUG(" encrypted");
|
||||
out += " encrypted";
|
||||
}
|
||||
|
||||
if (p->rx_time != 0) {
|
||||
LOG_DEBUG(" rxtime=%u", p->rx_time);
|
||||
out += DEBUG_PORT.mt_sprintf(" rxtime=%u", p->rx_time);
|
||||
}
|
||||
if (p->rx_snr != 0.0) {
|
||||
LOG_DEBUG(" rxSNR=%g", p->rx_snr);
|
||||
out += DEBUG_PORT.mt_sprintf(" rxSNR=%g", p->rx_snr);
|
||||
}
|
||||
if (p->rx_rssi != 0) {
|
||||
LOG_DEBUG(" rxRSSI=%i", p->rx_rssi);
|
||||
out += DEBUG_PORT.mt_sprintf(" rxRSSI=%i", p->rx_rssi);
|
||||
}
|
||||
if (p->priority != 0)
|
||||
LOG_DEBUG(" priority=%d", p->priority);
|
||||
out += DEBUG_PORT.mt_sprintf(" priority=%d", p->priority);
|
||||
|
||||
LOG_DEBUG(")\n");
|
||||
out + ")\n";
|
||||
LOG_DEBUG("%s", out.c_str());
|
||||
}
|
||||
|
||||
RadioInterface::RadioInterface()
|
||||
|
||||
Reference in New Issue
Block a user