You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/Data_Logging/DataLoggingExample6_NMEA/DataLoggingExample6_NMEA.ino
+2-2
Original file line number
Diff line number
Diff line change
@@ -145,8 +145,8 @@ void setup()
145
145
myGNSS.enableNMEAMessage(UBX_NMEA_GSA, COM_PORT_I2C, 1); // Ensure the GxGSA (GNSS DOP and Active satellites) message is enabled. Send every measurement.
146
146
myGNSS.enableNMEAMessage(UBX_NMEA_GSV, COM_PORT_I2C, 1); // Ensure the GxGSV (GNSS satellites in view) message is enabled. Send every measurement.
147
147
148
-
myGNSS.setNMEALoggingMask(SFE_UBLOX_LOG_NMEA_ALL); // Enable logging of all enabled NMEA messages
149
-
//myGNSS.setNMEALoggingMask(SFE_UBLOX_LOG_NMEA_GGA | SFE_UBLOX_LOG_NMEA_GSA); // Or we can, for example, log only GxGGA and GxGSA. Ignore GxGSV
148
+
myGNSS.setNMEALoggingMask(SFE_UBLOX_FILTER_NMEA_ALL); // Enable logging of all enabled NMEA messages
149
+
//myGNSS.setNMEALoggingMask(SFE_UBLOX_FILTER_NMEA_GGA | SFE_UBLOX_FILTER_NMEA_GSA); // Or we can, for example, log only GxGGA & GxGSA and ignore GxGSV
150
150
151
151
Serial.println(F("Press any key to stop logging."));
Copy file name to clipboardExpand all lines: src/SparkFun_u-blox_GNSS_Arduino_Library.h
+37-28
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,9 @@ typedef enum
99
99
SFE_UBLOX_PACKET_PACKETAUTO
100
100
} sfe_ublox_packet_buffer_e;
101
101
102
-
// Define a struct to allow selective logging of NMEA messages
102
+
// Define a struct to allow selective logging / processing of NMEA messages
103
+
// Set the individual bits to pass the NMEA messages to the file buffer and/or processNMEA
104
+
// Setting bits.all will pass all messages to the file buffer and processNMEA
103
105
typedefstruct
104
106
{
105
107
union
@@ -131,33 +133,34 @@ typedef struct
131
133
uint32_t UBX_NMEA_ZDA : 1;
132
134
} bits;
133
135
};
134
-
} sfe_ublox_nmea_logging_t;
135
-
// Define an enum to make it easy to enable/disable selected NMEA messages for logging
136
+
} sfe_ublox_nmea_filtering_t;
137
+
138
+
// Define an enum to make it easy to enable/disable selected NMEA messages for logging / processing
136
139
typedefenum
137
140
{
138
-
SFE_UBLOX_LOG_NMEA_ALL = 0x00000001,
139
-
SFE_UBLOX_LOG_NMEA_DTM = 0x00000002,
140
-
SFE_UBLOX_LOG_NMEA_GAQ = 0x00000004,
141
-
SFE_UBLOX_LOG_NMEA_GBQ = 0x00000008,
142
-
SFE_UBLOX_LOG_NMEA_GBS = 0x00000010,
143
-
SFE_UBLOX_LOG_NMEA_GGA = 0x00000020,
144
-
SFE_UBLOX_LOG_NMEA_GLL = 0x00000040,
145
-
SFE_UBLOX_LOG_NMEA_GLQ = 0x00000080,
146
-
SFE_UBLOX_LOG_NMEA_GNQ = 0x00000100,
147
-
SFE_UBLOX_LOG_NMEA_GNS = 0x00000200,
148
-
SFE_UBLOX_LOG_NMEA_GPQ = 0x00000400,
149
-
SFE_UBLOX_LOG_NMEA_GQQ = 0x00000800,
150
-
SFE_UBLOX_LOG_NMEA_GRS = 0x00001000,
151
-
SFE_UBLOX_LOG_NMEA_GSA = 0x00002000,
152
-
SFE_UBLOX_LOG_NMEA_GST = 0x00004000,
153
-
SFE_UBLOX_LOG_NMEA_GSV = 0x00008000,
154
-
SFE_UBLOX_LOG_NMEA_RLM = 0x00010000,
155
-
SFE_UBLOX_LOG_NMEA_RMC = 0x00020000,
156
-
SFE_UBLOX_LOG_NMEA_TXT = 0x00040000,
157
-
SFE_UBLOX_LOG_NMEA_VLW = 0x00080000,
158
-
SFE_UBLOX_LOG_NMEA_VTG = 0x00100000,
159
-
SFE_UBLOX_LOG_NMEA_ZDA = 0x00200000
160
-
} sfe_ublox_nmea_logging_selective_e;
141
+
SFE_UBLOX_FILTER_NMEA_ALL = 0x00000001,
142
+
SFE_UBLOX_FILTER_NMEA_DTM = 0x00000002,
143
+
SFE_UBLOX_FILTER_NMEA_GAQ = 0x00000004,
144
+
SFE_UBLOX_FILTER_NMEA_GBQ = 0x00000008,
145
+
SFE_UBLOX_FILTER_NMEA_GBS = 0x00000010,
146
+
SFE_UBLOX_FILTER_NMEA_GGA = 0x00000020,
147
+
SFE_UBLOX_FILTER_NMEA_GLL = 0x00000040,
148
+
SFE_UBLOX_FILTER_NMEA_GLQ = 0x00000080,
149
+
SFE_UBLOX_FILTER_NMEA_GNQ = 0x00000100,
150
+
SFE_UBLOX_FILTER_NMEA_GNS = 0x00000200,
151
+
SFE_UBLOX_FILTER_NMEA_GPQ = 0x00000400,
152
+
SFE_UBLOX_FILTER_NMEA_GQQ = 0x00000800,
153
+
SFE_UBLOX_FILTER_NMEA_GRS = 0x00001000,
154
+
SFE_UBLOX_FILTER_NMEA_GSA = 0x00002000,
155
+
SFE_UBLOX_FILTER_NMEA_GST = 0x00004000,
156
+
SFE_UBLOX_FILTER_NMEA_GSV = 0x00008000,
157
+
SFE_UBLOX_FILTER_NMEA_RLM = 0x00010000,
158
+
SFE_UBLOX_FILTER_NMEA_RMC = 0x00020000,
159
+
SFE_UBLOX_FILTER_NMEA_TXT = 0x00040000,
160
+
SFE_UBLOX_FILTER_NMEA_VLW = 0x00080000,
161
+
SFE_UBLOX_FILTER_NMEA_VTG = 0x00100000,
162
+
SFE_UBLOX_FILTER_NMEA_ZDA = 0x00200000
163
+
} sfe_ublox_nmea_filtering_e;
161
164
162
165
//Registers
163
166
constuint8_t UBX_SYNCH_1 = 0xB5;
@@ -991,9 +994,13 @@ class SFE_UBLOX_GNSS
991
994
voidlogHNRPVT(boolean enabled = true); // Log data to file buffer
992
995
993
996
// Helper functions for NMEA logging
994
-
voidsetNMEALoggingMask(uint32_t messages = SFE_UBLOX_LOG_NMEA_ALL); //Log selected NMEA messages to file buffer - if enabled
997
+
voidsetNMEALoggingMask(uint32_t messages = SFE_UBLOX_FILTER_NMEA_ALL); //Add selected NMEA messages to file buffer - if enabled. Default to adding ALL messages to the file buffer
995
998
uint32_tgetNMEALoggingMask(); // Return which NMEA messages are selected for logging to the file buffer - if enabled
996
999
1000
+
// Helper functions to control which NMEA messages are passed to processNMEA
1001
+
voidsetProcessNMEAMask(uint32_t messages = SFE_UBLOX_FILTER_NMEA_ALL); // Control which NMEA messages are passed to processNMEA. Default to passing ALL messages
1002
+
uint32_tgetProcessNMEAMask(); // Return which NMEA messages are passed to processNMEA
1003
+
997
1004
// Helper functions for CFG RATE
998
1005
999
1006
boolean setNavigationFrequency(uint8_t navFreq, uint16_t maxWait = defaultMaxWait); //Set the number of nav solutions sent per second
@@ -1249,7 +1256,8 @@ class SFE_UBLOX_GNSS
1249
1256
1250
1257
boolean ubx7FcheckDisabled = false; // Flag to indicate if the "7F" check should be ignored in checkUbloxI2C
1251
1258
1252
-
sfe_ublox_nmea_logging_t _logNMEA; // Flags to indicate which NMEA messages should be added to the file buffer for logging
1259
+
sfe_ublox_nmea_filtering_t _logNMEA; // Flags to indicate which NMEA messages should be added to the file buffer for logging
1260
+
sfe_ublox_nmea_filtering_t _processNMEA; // Flags to indicate which NMEA messages should be passed to processNMEA
1253
1261
1254
1262
//The packet buffers
1255
1263
//These are pointed at from within the ubxPacket
@@ -1289,6 +1297,7 @@ class SFE_UBLOX_GNSS
1289
1297
constint16_t maxNMEAByteCount = 1024; // Abort NMEA message reception if nmeaByteCounter exceeds this
1290
1298
uint8_t nmeaAddressField[6]; // NMEA Address Field - includes the start character (*)
1291
1299
boolean logThisNMEA(); // Return true if we should log this NMEA message
1300
+
boolean processThisNMEA(); // Return true if we should pass this NMEA message to processNMEA
0 commit comments