avoid 3 bytes again

This commit is contained in:
richonguzman 2024-06-08 15:50:55 -04:00
parent 7537c1ee50
commit 49cffe7d0c
2 changed files with 15 additions and 3 deletions

View file

@ -107,10 +107,14 @@ namespace APRS_IS_Utils {
}
String buildPacketToUpload(const String& packet) {
String payload = packet.substring(packet.indexOf(":"));
if (payload.indexOf("\x3c\xff\x01") != -1) {
payload = payload.substring(0, payload.indexOf("\x3c\xff\x01"));
}
if (!(Config.aprs_is.active && Config.digi.mode == 0)) { // Check if NOT only IGate
return packet.substring(3, packet.indexOf(":")) + ",qAR," + Config.callsign + packet.substring(packet.indexOf(":"));
return packet.substring(3, packet.indexOf(":")) + ",qAR," + Config.callsign + payload;
} else {
return packet.substring(3, packet.indexOf(":")) + ",qAO," + Config.callsign + packet.substring(packet.indexOf(":"));
return packet.substring(3, packet.indexOf(":")) + ",qAO," + Config.callsign + payload;
}
}
@ -202,6 +206,9 @@ namespace APRS_IS_Utils {
Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
Addressee.trim();
if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me!
if (AddresseeAndMessage.indexOf("\x3c\xff\x01") != -1) {
AddresseeAndMessage = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf("\x3c\xff\x01"));
}
queryMessage = processReceivedLoRaMessage(Sender, AddresseeAndMessage);
}
if (!queryMessage) {

View file

@ -43,7 +43,12 @@ namespace DIGI_Utils {
repeatedPacket += temp0.substring(0, temp0.indexOf(",")); // tocall
repeatedPacket += ",";
repeatedPacket += path;
repeatedPacket += packet.substring(packet.indexOf(":"));
String payload = packet.substring(packet.indexOf(":"));
if (payload.indexOf("\x3c\xff\x01") != -1) {
payload = payload.substring(0, payload.indexOf("\x3c\xff\x01"));
}
repeatedPacket += payload;
return repeatedPacket;
} else {
return "";