Skip to content

Commit

Permalink
Remove UBX parser
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulZC committed Sep 19, 2024
1 parent a3e5a24 commit 735ccd7
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 209 deletions.
25 changes: 1 addition & 24 deletions Firmware/RTK_mosaic-T_Firmware/GpsMessageParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ enum
SENTENCE_TYPE_NMEA,
SENTENCE_TYPE_RTCM,
SENTENCE_TYPE_SBF,
SENTENCE_TYPE_UBX,
// Add new sentence types above this line
};

Expand Down Expand Up @@ -53,13 +52,11 @@ typedef struct _PARSE_STATE
uint16_t bytesRemaining; // Bytes remaining in RTCM CRC calculation
uint16_t length; // Message length including line termination
uint16_t maxLength; // Maximum message length including line termination
uint16_t message; // RTCM message number. UBX Class & ID. SBF ID
uint16_t message; // RTCM message number. SBF ID
uint16_t nmeaLength; // Length of the NMEA message without line termination
uint8_t buffer[PARSE_BUFFER_LENGTH]; // Buffer containing the message
uint8_t nmeaMessageName[16]; // Message name
uint8_t nmeaMessageNameLength; // Length of the message name
uint8_t ck_a; // U-blox checksum byte 1
uint8_t ck_b; // U-blox checksum byte 2
uint16_t sbfCrcExpected; // Expected SBF CRC - from the block header
uint16_t sbfCrcComputed; // SBF CRC - calculated from the ID to the end of the block
} PARSE_STATE;
Expand All @@ -80,18 +77,11 @@ typedef struct _PARSE_STATE
#define RTCM_PREAMBLE
#endif // PARSE_RTCM_MESSAGES

#ifdef PARSE_UBLOX_MESSAGES
#define UBLOX_PREAMBLE ubloxPreamble,
#else
#define UBLOX_PREAMBLE
#endif // PARSE_UBLOX_MESSAGES

#define GPS_PARSE_TABLE \
PARSE_ROUTINE const gpsParseTable[] = \
{ \
NMEA_SBF_PREAMBLE \
RTCM_PREAMBLE \
UBLOX_PREAMBLE \
}; \
\
const int gpsParseTableEntries = sizeof(gpsParseTable) / sizeof(gpsParseTable[0]);
Expand Down Expand Up @@ -142,23 +132,10 @@ uint8_t rtcmReadMessage2(PARSE_STATE *parse, uint8_t data);
uint8_t rtcmReadData(PARSE_STATE *parse, uint8_t data);
uint8_t rtcmReadCrc(PARSE_STATE *parse, uint8_t data);

// u-blox parse routines
uint8_t ubloxPreamble(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxSync2(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxClass(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxId(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxLength1(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxLength2(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxPayload(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxCkA(PARSE_STATE *parse, uint8_t data);
uint8_t ubloxCkB(PARSE_STATE *parse, uint8_t data);

// External print routines
void printNmeaChecksumError(PARSE_STATE *parse);
void printRtcmChecksumError(PARSE_STATE *parse);
void printRtcmMaxLength(PARSE_STATE *parse);
void printUbloxChecksumError(PARSE_STATE *parse);
void printUbloxInvalidData(PARSE_STATE *parse);
void printSbfChecksumError(PARSE_STATE *parse);
void printSbfInvalidData(PARSE_STATE *parse);

Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_mosaic-T_Firmware/NVM.ino
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ bool parseLine(char *str, Settings *settings)
// If user sets sizeOfSettings to -1 in config file, RTK Surveyor will factory reset
if (d == -1)
{
// Erase file system, erase settings file, reset u-blox module, display message on OLED
// Erase file system, erase settings file, reset GNSS module, display message on OLED
factoryReset(true); // We already have the SD semaphore
}

Expand Down
155 changes: 0 additions & 155 deletions Firmware/RTK_mosaic-T_Firmware/Parse_UBLOX.ino

This file was deleted.

2 changes: 0 additions & 2 deletions Firmware/RTK_mosaic-T_Firmware/RTK_mosaic-T_Firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ IPAddress gnssIP = IPAddress((uint32_t)0);
// Define the parsers that get included
#define PARSE_NMEA_MESSAGES
#define PARSE_RTCM_MESSAGES
#define PARSE_UBLOX_MESSAGES
#define PARSE_SBF_MESSAGES

// Build the GPS_PARSE_TABLE macro
Expand Down Expand Up @@ -230,7 +229,6 @@ unsigned long startTime = 0; // Used for checking longest running func
TaskHandle_t idleTaskHandle[MAX_CPU_CORES];
uint32_t max_idle_count = MAX_IDLE_TIME_COUNT;

uint16_t failedParserMessages_UBX = 0;
uint16_t failedParserMessages_RTCM = 0;
uint16_t failedParserMessages_NMEA = 0;
uint16_t failedParserMessages_SBF = 0;
Expand Down
8 changes: 1 addition & 7 deletions Firmware/RTK_mosaic-T_Firmware/Tasks.ino
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void gnssReadTask(void *e)
}

// Process a complete message incoming from parser
// If we get a complete NMEA/UBX/RTCM message, pass it on to the consumers
// If we get a complete NMEA/RTCM message, pass it on to the consumers
void processUart1Message(PARSE_STATE *parse, uint8_t type)
{
int32_t bytesToCopy;
Expand All @@ -166,12 +166,6 @@ void processUart1Message(PARSE_STATE *parse, uint8_t type)
case SENTENCE_TYPE_SBF:
systemPrintf("%s SBF %d, %2d bytes\r\n", parse->parserName, parse->message & 0x1FFF, parse->length);
break;

case SENTENCE_TYPE_UBX:
systemPrintf("%s UBX %d.%d, %2d bytes\r\n", parse->parserName, parse->message >> 8, parse->message & 0xff,
parse->length);
break;

}
}

Expand Down
4 changes: 2 additions & 2 deletions Firmware/RTK_mosaic-T_Firmware/menuMain.ino
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ void menuMain()
systemPrintf("%d %02d:%02d:%02d.%03lld\r\n", uptimeDays, uptimeHours, uptimeMinutes, uptimeSeconds,
uptimeMilliseconds);

systemPrintf("Rejected by parser: %d NMEA / %d RTCM / %d UBX / %d SBF\r\n", failedParserMessages_NMEA,
failedParserMessages_RTCM, failedParserMessages_UBX, failedParserMessages_SBF);
systemPrintf("Rejected by parser: %d NMEA / %d RTCM / %d SBF\r\n", failedParserMessages_NMEA,
failedParserMessages_RTCM, failedParserMessages_SBF);

systemPrintln("Menu: Main");

Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_mosaic-T_Firmware/menuSystem.ino
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ void menuOperation()
{
systemPrint("Enter the PI I term: ");
double i = getDouble();
if (i <= 0.0 || i >= 10.0) // Arbitrary limits
if (i < 0.0 || i >= 10.0) // Arbitrary limits
systemPrintln("Error: term is out of range");
else
{
Expand Down
17 changes: 0 additions & 17 deletions Firmware/RTK_mosaic-T_Firmware/support.ino
Original file line number Diff line number Diff line change
Expand Up @@ -630,23 +630,6 @@ void printRtcmMaxLength(PARSE_STATE *parse)
systemPrintf("RTCM parser error maxLength: %d bytes\r\n", parse->maxLength);
}

// Print the u-blox checksum error
void printUbloxChecksumError(PARSE_STATE *parse)
{
printTimeStamp();
systemPrintf(" %s u-blox %d.%d, %2d bytes, bad checksum, expecting 0x%02X%02X, computed: 0x%02X%02X\r\n",
parse->parserName, parse->message >> 8, parse->message & 0xff, parse->length,
parse->buffer[parse->nmeaLength - 2], parse->buffer[parse->nmeaLength - 1], parse->ck_a,
parse->ck_b);
}

// Print the u-blox invalid data error
void printUbloxInvalidData(PARSE_STATE *parse)
{
dumpBuffer(parse->buffer, parse->length - 1);
systemPrintf(" %s Invalid UBX data, %d bytes\r\n", parse->parserName, parse->length - 1);
}

// Print the SBF checksum error
void printSbfChecksumError(PARSE_STATE *parse)
{
Expand Down

0 comments on commit 735ccd7

Please sign in to comment.