Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mesh/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)

LOG_DEBUG("Original length - %d ", p->decoded.payload.size);
LOG_DEBUG("Compressed length - %d ", compressed_len);
LOG_DEBUG("Original message - %s ", p->decoded.payload.bytes);
LOG_DEBUG("Original message - %.*s ", (int)p->decoded.payload.size, p->decoded.payload.bytes);

// If the compressed length is greater than or equal to the original size, don't use the compressed form
if (compressed_len >= p->decoded.payload.size) {
Expand Down
6 changes: 3 additions & 3 deletions src/modules/RangeTestModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ProcessMessage RangeTestModuleRadio::handleReceived(const meshtastic_MeshPacket
NodeInfoLite *n = nodeDB->getMeshNode(getFrom(&mp));

LOG_DEBUG("-----------------------------------------");
LOG_DEBUG("p.payload.bytes \"%s\"", p.payload.bytes);
LOG_DEBUG("p.payload.bytes \"%.*s\"", (int)p.payload.size, p.payload.bytes);
LOG_DEBUG("p.payload.size %d", p.payload.size);
LOG_DEBUG("---- Received Packet:");
LOG_DEBUG("mp.from %d", mp.from);
Expand Down Expand Up @@ -192,7 +192,7 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
meshtastic_NodeInfoLite *n = nodeDB->getMeshNode(getFrom(&mp));
/*
LOG_DEBUG("-----------------------------------------");
LOG_DEBUG("p.payload.bytes \"%s\"", p.payload.bytes);
LOG_DEBUG("p.payload.bytes \"%.*s\"", (int)p.payload.size, p.payload.bytes);
LOG_DEBUG("p.payload.size %d", p.payload.size);
LOG_DEBUG("---- Received Packet:");
LOG_DEBUG("mp.from %d", mp.from);
Expand Down Expand Up @@ -307,7 +307,7 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
fileToAppend.printf("%d,", mp.hop_limit); // Packet Hop Limit

// TODO: If quotes are found in the payload, it has to be escaped.
fileToAppend.printf("\"%s\"\n", p.payload.bytes);
fileToAppend.printf("\"%.*s\"\n", (int)p.payload.size, p.payload.bytes);
fileToAppend.printf("%i,", mp.rx_rssi); // RX RSSI
Comment thread
caveman99 marked this conversation as resolved.

fileToAppend.flush();
Expand Down
4 changes: 2 additions & 2 deletions src/modules/SerialModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ ProcessMessage SerialModuleRadio::handleReceived(const meshtastic_MeshPacket &mp
lastRxID = mp.id;
// LOG_DEBUG("* * Message came this device");
// serialPrint->println("* * Message came this device");
serialPrint->printf("%s", p.payload.bytes);
serialPrint->printf("%.*s", (int)p.payload.size, p.payload.bytes);
Comment thread
caveman99 marked this conversation as resolved.
}
}
} else {
Expand All @@ -408,7 +408,7 @@ ProcessMessage SerialModuleRadio::handleReceived(const meshtastic_MeshPacket &mp
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(getFrom(&mp));
const char *sender = nodeInfoLiteHasUser(node) ? node->short_name : "???";
serialPrint->println();
serialPrint->printf("%s: %s", sender, p.payload.bytes);
serialPrint->printf("%s: %.*s", sender, (int)p.payload.size, p.payload.bytes);
serialPrint->println();
} else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA ||
moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO) &&
Expand Down
Loading