@@ -497,6 +497,12 @@ enum sfe_ublox_ls_src_e
497
497
// For storing SPI bytes received during sendSpiCommand
498
498
#define SFE_UBLOX_SPI_BUFFER_SIZE 128
499
499
500
+ // Default maximum NMEA byte count
501
+ // maxNMEAByteCount was set to 82: https://en.wikipedia.org/wiki/NMEA_0183#Message_structure
502
+ // but the u-blox HP (RTK) GGA messages are 88 bytes long
503
+ // The user can adjust maxNMEAByteCount by calling setMaxNMEAByteCount
504
+ #define SFE_UBLOX_MAX_NMEA_BYTE_COUNT 88
505
+
500
506
// -=-=-=-=- UBX binary specific variables
501
507
struct ubxPacket
502
508
{
@@ -572,6 +578,9 @@ class SFE_UBLOX_GNSS
572
578
573
579
void setI2CpollingWait (uint8_t newPollingWait_ms); // Allow the user to change the I2C polling wait if required
574
580
581
+ // Set the max number of bytes set in a given I2C transaction
582
+ uint8_t i2cTransactionSize = 32 ; // Default to ATmega328 limit
583
+
575
584
// Control the size of the internal I2C transaction amount
576
585
void setI2CTransactionSize (uint8_t bufferSize);
577
586
uint8_t getI2CTransactionSize (void );
@@ -581,8 +590,9 @@ class SFE_UBLOX_GNSS
581
590
void setSpiTransactionSize (uint8_t bufferSize);
582
591
uint8_t getSpiTransactionSize (void );
583
592
584
- // Set the max number of bytes set in a given I2C transaction
585
- uint8_t i2cTransactionSize = 32 ; // Default to ATmega328 limit
593
+ // Control the size of maxNMEAByteCount
594
+ void setMaxNMEAByteCount (int8_t newMax);
595
+ int8_t getMaxNMEAByteCount (void );
586
596
587
597
// Returns true if device answers on _gpsI2Caddress address or via Serial
588
598
boolean isConnected (uint16_t maxWait = 1100 );
@@ -1345,7 +1355,9 @@ class SFE_UBLOX_GNSS
1345
1355
uint8_t rollingChecksumB; // Rolls forward as we receive incoming bytes. Checked against the last two A/B checksum bytes
1346
1356
1347
1357
int8_t nmeaByteCounter; // Count all NMEA message bytes.
1348
- const int8_t maxNMEAByteCount = 82 ; // Abort NMEA message reception if nmeaByteCounter exceeds this (https://en.wikipedia.org/wiki/NMEA_0183#Message_structure)
1358
+ // Abort NMEA message reception if nmeaByteCounter exceeds maxNMEAByteCount.
1359
+ // The user can adjust maxNMEAByteCount by calling setMaxNMEAByteCount
1360
+ int8_t maxNMEAByteCount = SFE_UBLOX_MAX_NMEA_BYTE_COUNT;
1349
1361
uint8_t nmeaAddressField[6 ]; // NMEA Address Field - includes the start character (*)
1350
1362
boolean logThisNMEA (); // Return true if we should log this NMEA message
1351
1363
boolean processThisNMEA (); // Return true if we should pass this NMEA message to processNMEA
0 commit comments