forked from iarv/LoRa_APRS_iGate
Compare commits
2 Commits
V3.1.6.2
...
decodingFix
| Author | SHA1 | Date | |
|---|---|---|---|
| ff8c7581fa | |||
| 449a8557d2 |
@@ -67,8 +67,8 @@ ___________________________________________________________________*/
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
String versionDate = "2025-12-22";
|
String versionDate = "2025-12-28";
|
||||||
String versionNumber = "3.1.6.2";
|
String versionNumber = "3.1.6.3";
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
WiFiClient aprsIsClient;
|
WiFiClient aprsIsClient;
|
||||||
WiFiClient mqttClient;
|
WiFiClient mqttClient;
|
||||||
|
|||||||
+29
-22
@@ -138,30 +138,37 @@ namespace GPS_Utils {
|
|||||||
|
|
||||||
String getDistanceAndComment(const String& packet) {
|
String getDistanceAndComment(const String& packet) {
|
||||||
int indexOfAt = packet.indexOf(":@");
|
int indexOfAt = packet.indexOf(":@");
|
||||||
if (indexOfAt > 10) {
|
if (indexOfAt > 10) return getReceivedGPS(packet);
|
||||||
return getReceivedGPS(packet);
|
|
||||||
} else {
|
|
||||||
const uint8_t ENCODED_BYTE_OFFSET = 14; // Offset for encoded data in the packet
|
|
||||||
int indexOfExclamation = packet.indexOf(":!");
|
|
||||||
int indexOfEqual = packet.indexOf(":=");
|
|
||||||
uint8_t encodedBytePosition = 0;
|
|
||||||
if (indexOfExclamation > 10) { // Determine the position where encoded data starts
|
|
||||||
encodedBytePosition = indexOfExclamation + ENCODED_BYTE_OFFSET;
|
|
||||||
} else if (indexOfEqual > 10) {
|
|
||||||
encodedBytePosition = indexOfEqual + ENCODED_BYTE_OFFSET;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (encodedBytePosition != 0) {
|
const uint8_t nonEncondedLatitudeOffset = 9; // "N" / "S"
|
||||||
char currentChar = packet[encodedBytePosition];
|
const uint8_t nonEncondedLongitudeOffset = 19; // "E" / "W"
|
||||||
if (currentChar == 'G' || currentChar == 'Q' || currentChar == '[' || currentChar == 'H' || currentChar == 'X' || currentChar == '3') {
|
const uint8_t encondedByteOffset = 14;
|
||||||
return decodeEncodedGPS(packet); // If valid encoded data position is found, decode it
|
|
||||||
} else {
|
int indexOfExclamation = packet.indexOf(":!");
|
||||||
return getReceivedGPS(packet);
|
int indexOfEqual = packet.indexOf(":=");
|
||||||
}
|
int baseIndex = - 1;
|
||||||
} else {
|
if (indexOfExclamation > 10) {
|
||||||
return " _ / _ / _ ";
|
baseIndex = indexOfExclamation;
|
||||||
}
|
} else if (indexOfEqual > 10) {
|
||||||
|
baseIndex = indexOfEqual;
|
||||||
}
|
}
|
||||||
|
if (baseIndex == -1) return " _ / _ / _ ";
|
||||||
|
|
||||||
|
int latitudeIndex = baseIndex + nonEncondedLatitudeOffset;
|
||||||
|
int longitudeIndex = baseIndex + nonEncondedLongitudeOffset;
|
||||||
|
int encondedByteIndex = baseIndex + encondedByteOffset;
|
||||||
|
int packetLength = packet.length();
|
||||||
|
|
||||||
|
if (latitudeIndex >= packetLength || longitudeIndex >= packetLength || encondedByteIndex >= packetLength) return " _ / _ / _ ";
|
||||||
|
|
||||||
|
char latChar = packet[latitudeIndex];
|
||||||
|
char lngChar = packet[longitudeIndex];
|
||||||
|
if ((latChar == 'N' || latChar == 'S') && (lngChar == 'E' || lngChar == 'W')) return getReceivedGPS(packet);
|
||||||
|
|
||||||
|
char byteChar = packet[encondedByteIndex];
|
||||||
|
if (byteChar == 'G' || byteChar == 'Q' || byteChar == '[' || byteChar == 'H' || byteChar == 'X' || byteChar == '3') return decodeEncodedGPS(packet);
|
||||||
|
|
||||||
|
return " _ / _ / _ ";
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ build_flags =
|
|||||||
-D RADIOLIB_EXCLUDE_SX127X=1
|
-D RADIOLIB_EXCLUDE_SX127X=1
|
||||||
-D RADIOLIB_EXCLUDE_SX128X=1
|
-D RADIOLIB_EXCLUDE_SX128X=1
|
||||||
-D HELTEC_VM_E290
|
-D HELTEC_VM_E290
|
||||||
-D Vision_Master_E290 ; Todd Herbert eink display driver constructor
|
-D Vision_Master_E290
|
||||||
-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
|
||||||
-D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted
|
|
||||||
-D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${common.lib_deps}
|
${common.lib_deps}
|
||||||
https://github.com/todd-herbert/heltec-eink-modules.git
|
https://github.com/todd-herbert/heltec-eink-modules.git
|
||||||
Reference in New Issue
Block a user