Add logNMEA and an example

This commit is contained in:
PaulZC
2021-04-13 11:56:45 +01:00
parent 63d8b60f42
commit cc2e75fa27
4 changed files with 261 additions and 0 deletions
@@ -1259,6 +1259,10 @@ void SFE_UBLOX_GNSS::processNMEA(char incoming)
//If user has assigned an output port then pipe the characters there
if (_nmeaOutputPort != NULL)
_nmeaOutputPort->write(incoming); //Echo this byte to the serial port
//If _logNMEA is true, attempt to store incoming in the file buffer
if (_logNMEA)
storeFileBytes((uint8_t *)&incoming, 1);
}
//We need to be able to identify an RTCM packet and then the length
@@ -9073,6 +9077,14 @@ void SFE_UBLOX_GNSS::logHNRPVT(boolean enabled)
packetUBXHNRPVT->automaticFlags.flags.bits.addToFileBuffer = (uint8_t)enabled;
}
// ***** Helper Functions for NMEA Logging
//Log NMEA data in file buffer - if it exists! User needs to call setFileBufferSize before .begin
void SFE_UBLOX_GNSS::logNMEA(boolean enabled)
{
_logNMEA = enabled;
}
// ***** CFG RATE Helper Functions
//Set the rate at which the module will give us an updated navigation solution
@@ -928,6 +928,9 @@ public:
void flushHNRPVT(); //Mark all the data as read/stale
void logHNRPVT(boolean enabled = true); // Log data to file buffer
// Helper function for NMEA logging
void logNMEA(boolean enabled = true); // Log NMEA data to file buffer
// Helper functions for CFG RATE
boolean setNavigationFrequency(uint8_t navFreq, uint16_t maxWait = defaultMaxWait); //Set the number of nav solutions sent per second
@@ -1183,6 +1186,8 @@ private:
boolean ubx7FcheckDisabled = false; // Flag to indicate if the "7F" check should be ignored in checkUbloxI2C
boolean _logNMEA = false; // Flag to indicate if NMEA data should be added to the file buffer
//The packet buffers
//These are pointed at from within the ubxPacket
uint8_t payloadAck[2]; // Holds the requested ACK/NACK