-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathu-blox_GNSS.h
1743 lines (1491 loc) · 171 KB
/
u-blox_GNSS.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
An Arduino Library which allows you to communicate seamlessly with u-blox GNSS modules using the Configuration Interface
SparkFun sells these at its website: www.sparkfun.com
Do you like this library? Help support SparkFun. Buy a board!
https://www.sparkfun.com/products/15136
https://www.sparkfun.com/products/16481
https://www.sparkfun.com/products/16344
https://www.sparkfun.com/products/18037
https://www.sparkfun.com/products/18719
https://www.sparkfun.com/products/18774
https://www.sparkfun.com/products/19663
https://www.sparkfun.com/products/17722
Original version by Nathan Seidle @ SparkFun Electronics, September 6th, 2018
v2.0 rework by Paul Clark @ SparkFun Electronics, December 31st, 2020
v3.0 rework by Paul Clark @ SparkFun Electronics, December 8th, 2022
https://github.com/sparkfun/SparkFun_u-blox_GNSS_v3
This library is an updated version of the popular SparkFun u-blox GNSS Arduino Library.
v3 uses the u-blox Configuration Interface (VALSET and VALGET) to:
detect the module (during begin); configure message intervals; configure the base location; etc..
This version of the library will not work with older GNSS modules.
It is specifically written for newer modules like the ZED-F9P, ZED-F9R and MAX-M10S.
For older modules, please use v2 of the library: https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library
Development environment specifics:
Arduino IDE 1.8.19
SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).
The MIT License (MIT)
Copyright (c) 2018 SparkFun Electronics
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to
do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
// Uncomment the next line (or add SFE_UBLOX_REDUCED_PROG_MEM as a compiler directive) to reduce the amount of program memory used by the library
// #define SFE_UBLOX_REDUCED_PROG_MEM // Uncommenting this line will delete the minor debug messages to save memory
// Uncomment the next line (or add SFE_UBLOX_DISABLE_AUTO_NMEA as a compiler directive) to reduce the amount of program memory used by the library
// #define SFE_UBLOX_DISABLE_AUTO_NMEA // Uncommenting this line will disable auto-NMEA support to save memory
// Uncomment the next line (or add SFE_UBLOX_DISABLE_RTCM_LOGGING as a compiler directive) to reduce the amount of program memory used by the library
// #define SFE_UBLOX_DISABLE_RTCM_LOGGING // Uncommenting this line will disable RTCM logging support to save memory
// Uncomment the next line (or add SFE_UBLOX_DISABLE_RAWX_SFRBX_PMP_QZSS_SAT as a compiler directive) to reduce the amount of program memory used by the library
// #define SFE_UBLOX_DISABLE_RAWX_SFRBX_PMP_QZSS_SAT // Uncommenting this line will disable the RAM-heavy RXM and NAV-SAT support to save memory
// Uncomment the next line (or add SFE_UBLOX_DISABLE_ESF as a compiler directive) to reduce the amount of program memory used by the library
// #define SFE_UBLOX_DISABLE_ESF // Uncommenting this line will disable the ESF support to save memory
// Uncomment the next line (or add SFE_UBLOX_DISABLE_HNR as a compiler directive) to reduce the amount of program memory used by the library
// #define SFE_UBLOX_DISABLE_HNR // Uncommenting this line will disable the HNR support to save memory
// The code exceeds the program memory on the ATmega328P (Arduino Uno), so let's delete the minor debug messages and disable auto-NMEA and RAM-heavy support anyway
// However, the ATmega2560 and ATmega1280 _do_ have enough memory, so let's exclude those
#if !defined(SFE_UBLOX_REDUCED_PROG_MEM) && defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_AVR_MEGA2560) && !defined(ARDUINO_AVR_MEGA) && !defined(ARDUINO_AVR_ADK)
#define SFE_UBLOX_REDUCED_PROG_MEM
#endif
#if !defined(SFE_UBLOX_DISABLE_AUTO_NMEA) && defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_AVR_MEGA2560) && !defined(ARDUINO_AVR_MEGA) && !defined(ARDUINO_AVR_ADK)
#define SFE_UBLOX_DISABLE_AUTO_NMEA
#endif
#if !defined(SFE_UBLOX_DISABLE_RTCM_LOGGING) && defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_AVR_MEGA2560) && !defined(ARDUINO_AVR_MEGA) && !defined(ARDUINO_AVR_ADK)
#define SFE_UBLOX_DISABLE_RTCM_LOGGING
#endif
#if !defined(SFE_UBLOX_DISABLE_RAWX_SFRBX_PMP_QZSS_SAT) && defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_AVR_MEGA2560) && !defined(ARDUINO_AVR_MEGA) && !defined(ARDUINO_AVR_ADK)
#define SFE_UBLOX_DISABLE_RAWX_SFRBX_PMP_QZSS_SAT
#endif
#include <Arduino.h>
#include "u-blox_config_keys.h"
#include "u-blox_structs.h"
#include "u-blox_external_typedefs.h"
#include "u-blox_Class_and_ID.h"
#include "sfe_bus.h"
// Define a digital pin to aid debugging
// Leave set to -1 if not needed
const int debugPin = -1;
class DevUBLOXGNSS
{
public:
DevUBLOXGNSS(void);
~DevUBLOXGNSS(void);
// New in v3.0: hardware interface is abstracted
bool isConnected(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
protected:
enum commTypes
{
COMM_TYPE_I2C = 0,
COMM_TYPE_SERIAL,
COMM_TYPE_SPI
} _commType = COMM_TYPE_I2C; // Controls which port we look to for incoming bytes
bool init(uint16_t maxWait, bool assumeSuccess);
void setCommunicationBus(SparkFun_UBLOX_GNSS::GNSSDeviceBus &theBus);
// For I2C, ping the _address
// Not Applicable for SPI and Serial
bool ping();
// For Serial, return Serial.available()
// For I2C, read registers 0xFD and 0xFE. Return bytes available as uint16_t
// Not Applicable for SPI
uint16_t available();
// For Serial, do Serial.write
// For I2C, push data to register 0xFF. Chunkify if necessary. Prevent single byte writes as these are illegal
// For SPI, writing bytes will also read bytes simultaneously. Read data is _ignored_ here. Use writeReadBytes
uint8_t writeBytes(uint8_t *data, uint8_t length);
// For SPI, writing bytes will also read bytes simultaneously. Read data is returned in readData
uint8_t writeReadBytes(const uint8_t *data, uint8_t *readData, uint8_t length);
void startWriteReadByte();
void writeReadByte(const uint8_t *data, uint8_t *readData);
void writeReadByte(const uint8_t data, uint8_t *readData);
void endWriteReadByte();
// For Serial, attempt Serial.read
// For I2C, read from register 0xFF
// For SPI, read the byte while writing 0xFF
uint8_t readBytes(uint8_t *data, uint8_t length);
// Flag to indicate if we are connected to UART1 or UART2
// Needed to select the correct config items when enabling a periodic message
bool _UART2 = false; // Default to UART1
// These lock / unlock functions can be used if you have multiple tasks writing to the bus.
// The idea is that in a RTOS you override this class and the functions in which you take and give a mutex.
virtual bool createLock(void) { return true; }
virtual bool lock(void) { return true; }
virtual void unlock(void) {}
virtual void deleteLock(void) {}
public:
void connectedToUART2(bool connected = true) { _UART2 = connected; }
// Depending on the sentence type the processor will load characters into different arrays
enum sfe_ublox_sentence_types_e
{
SFE_UBLOX_SENTENCE_TYPE_NONE = 0,
SFE_UBLOX_SENTENCE_TYPE_NMEA,
SFE_UBLOX_SENTENCE_TYPE_UBX,
SFE_UBLOX_SENTENCE_TYPE_RTCM
} currentSentence = SFE_UBLOX_SENTENCE_TYPE_NONE;
// New in v2.0: allow the payload size for packetCfg to be changed
bool setPacketCfgPayloadSize(size_t payloadSize); // Set packetCfgPayloadSize
size_t getPacketCfgSpaceRemaining(); // Returns the number of free bytes remaining in packetCfgPayload
void end(void); // Stop all automatic message processing. Free all used RAM
void setI2CpollingWait(uint8_t newPollingWait_ms); // Allow the user to change the I2C polling wait if required
void setSPIpollingWait(uint8_t newPollingWait_ms); // Allow the user to change the SPI polling wait if required
// Set the max number of bytes set in a given I2C transaction
uint8_t i2cTransactionSize = 32; // Default to ATmega328 limit
// Control the size of the internal I2C transaction amount
void setI2CTransactionSize(uint8_t transactionSize);
uint8_t getI2CTransactionSize(void);
// Control the size of the internal I2C transaction amount
void setSpiTransactionSize(uint8_t transactionSize);
uint8_t getSpiTransactionSize(void);
// Control the size of the SPI transfer buffer. If the buffer isn't big enough, we'll start to lose bytes
void setSpiBufferSize(size_t bufferSize);
size_t getSpiBufferSize(void);
// A dedicated buffer for RTCM data - separate to the logging buffer
// RTCM data can be stored here and then extracted - avoiding processRTCM
// This is useful on SPI systems, avoiding bus collisions between checkUblox/processRTCM
// and pushing the RTCM data to (e.g.) Ethernet
void setRTCMBufferSize(uint16_t bufferSize); // Set the size of the RTCM buffer. This must be called _before_ .begin.
uint16_t getRTCMBufferSize(void); // Return the size of the RTCM buffer
uint16_t extractRTCMBufferData(uint8_t *destination, uint16_t numBytes); // Extract numBytes of data from the RTCM buffer. Copy it to destination. It is the user's responsibility to ensure destination is large enough.
uint16_t rtcmBufferAvailable(void); // Returns the number of bytes available in the RTCM buffer which are waiting to be read
void clearRTCMBuffer(void); // Empty the RTCM buffer - discard all contents
// Control the size of maxNMEAByteCount
void setMaxNMEAByteCount(int8_t newMax);
int8_t getMaxNMEAByteCount(void);
// Enable debug messages using the chosen Serial port (Stream)
// Boards like the RedBoard Turbo use SerialUSB (not Serial).
// But other boards like the SAMD51 Thing Plus use Serial (not SerialUSB).
// These lines let the code compile cleanly on as many SAMD boards as possible.
#if defined(ARDUINO_ARCH_SAMD) // Is this a SAMD board?
#if defined(USB_VID) // Is the USB Vendor ID defined?
#if (USB_VID == 0x1B4F) // Is this a SparkFun board?
#if !defined(ARDUINO_SAMD51_THING_PLUS) & !defined(ARDUINO_SAMD51_MICROMOD) // If it is not a SAMD51 Thing Plus or SAMD51 MicroMod
void enableDebugging(Print &debugPort = SerialUSB, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
#else
void enableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
#endif
#else
void enableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
#endif
#else
void enableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
#endif
#else
void enableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
#endif
void disableDebugging(void); // Turn off debug statements
void debugPrint(char *message); // Safely print debug statements
void debugPrintln(char *message); // Safely print debug statements
const char *statusString(sfe_ublox_status_e stat); // Pretty print the return value
// Check for the arrival of new I2C/Serial data
// Changed in V1.8.1: provides backward compatibility for the examples that call checkUblox directly
// Will default to using packetCfg to look for explicit autoPVT packets so they get processed correctly by processUBX
bool checkUblox(uint8_t requestedClass = 0, uint8_t requestedID = 0); // Checks module with user selected commType
bool checkUbloxI2C(ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Method for I2C polling of data, passing any new bytes to process()
bool checkUbloxSerial(ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Method for serial polling of data, passing any new bytes to process()
bool checkUbloxSpi(ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Method for spi polling of data, passing any new bytes to process()
bool processSpiBuffer(ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Called by checkUbloxSpi to process any backlog data in the spiBuffer
// Process the incoming data
void process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Processes NMEA and UBX binary sentences one byte at a time
void processNMEA(char incoming) __attribute__((weak)); // Given a NMEA character, do something with it. User can overwrite if desired to use something like tinyGPS or MicroNMEA libraries
sfe_ublox_sentence_types_e processRTCMframe(uint8_t incoming, uint16_t *rtcmFrameCounter) __attribute__((weak)); // Monitor the incoming bytes for start and length bytes
void processRTCM(uint8_t incoming) __attribute__((weak)); // Given rtcm byte, do something with it. User can overwrite if desired to pipe bytes to radio, internet, etc.
void processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Given a character, file it away into the uxb packet structure
void processUBXpacket(ubxPacket *msg); // Once a packet has been received and validated, identify this packet's class/id and update internal flags
// Send I2C/Serial/SPI commands to the module
void calcChecksum(ubxPacket *msg); // Sets the checksumA and checksumB of a given messages
sfe_ublox_status_e sendCommand(ubxPacket *outgoingUBX, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait, bool expectACKonly = false); // Given a packet and payload, send everything including CRC bytes, return true if we got a response
sfe_ublox_status_e sendI2cCommand(ubxPacket *outgoingUBX);
void sendSerialCommand(ubxPacket *outgoingUBX);
sfe_ublox_status_e sendSpiCommand(ubxPacket *outgoingUBX);
void spiTransfer(const uint8_t byteToTransfer);
void printPacket(ubxPacket *packet, bool alwaysPrintPayload = false); // Useful for debugging
// After sending a message to the module, wait for the expected response (data+ACK or just data)
sfe_ublox_status_e waitForACKResponse(ubxPacket *outgoingUBX, uint8_t requestedClass, uint8_t requestedID, uint16_t maxTime = kUBLOXGNSSDefaultMaxWait); // Poll the module until a config packet and an ACK is received, or just an ACK
sfe_ublox_status_e waitForNoACKResponse(ubxPacket *outgoingUBX, uint8_t requestedClass, uint8_t requestedID, uint16_t maxTime = kUBLOXGNSSDefaultMaxWait); // Poll the module until a config packet is received
// Check if any callbacks need to be called
void checkCallbacks(void);
// Push (e.g.) RTCM or Assist Now data directly to the module
// Warning: this function does not check that the data is valid. It is the user's responsibility to ensure the data is valid before pushing.
//
// For SPI: callProcessBuffer defaults to true and forces pushRawData to call processSpiBuffer in between push transactions.
// This is to try and prevent incoming data being 'lost' during large (bi-directional) pushes.
// If you are only pushing limited amounts of data and/or will be calling checkUblox manually, it might be advantageous to set callProcessBuffer to false.
//
// Likewise for Serial: callProcessBuffer defaults to true and forces pushRawData to call checkUbloxSerial in between pushing data.
// This is to try and prevent incoming data being 'lost' (overflowing the serial RX buffer) during a large push.
// If you are only pushing limited amounts of data and/or will be calling checkUblox manually, it might be advantageous to set callProcessBuffer to false.
bool pushRawData(uint8_t *dataBytes, size_t numDataBytes, bool callProcessBuffer = true);
#ifndef SFE_UBLOX_DISABLE_RTCM_LOGGING
// RTCM parsing - used inside pushRawData
protected:
void parseRTCM1005(uint8_t *dataBytes, size_t numDataBytes);
void parseRTCM1006(uint8_t *dataBytes, size_t numDataBytes);
public:
#endif
// Push MGA AssistNow data to the module.
// Check for UBX-MGA-ACK responses if required (if mgaAck is YES or ENQUIRE).
// Wait for maxWait millis after sending each packet (if mgaAck is NO).
// Return how many bytes were pushed successfully.
// If skipTime is true, any UBX-MGA-INI-TIME_UTC or UBX-MGA-INI-TIME_GNSS packets found in the data will be skipped,
// allowing the user to override with their own time data with setUTCTimeAssistance.
// offset allows a sub-set of the data to be sent - starting from offset.
#define defaultMGAdelay 7 // Default to waiting for 7ms between each MGA message
size_t pushAssistNowData(const String &dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
size_t pushAssistNowData(const uint8_t *dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
size_t pushAssistNowData(bool skipTime, const String &dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
size_t pushAssistNowData(bool skipTime, const uint8_t *dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
size_t pushAssistNowData(size_t offset, bool skipTime, const String &dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
size_t pushAssistNowData(size_t offset, bool skipTime, const uint8_t *dataBytes, size_t numDataBytes, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
// Provide initial time assistance
#define defaultMGAINITIMEtAccS 2 // Default to setting the seconds time accuracy to 2 seconds
#define defaultMGAINITIMEtAccNs 0 // Default to setting the nanoseconds time accuracy to zero
#define defaultMGAINITIMEsource 0 // Set default source to none, i.e. on receipt of message (will be inaccurate!)
bool setUTCTimeAssistance(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanos = 0,
uint16_t tAccS = defaultMGAINITIMEtAccS, uint32_t tAccNs = defaultMGAINITIMEtAccNs, uint8_t source = defaultMGAINITIMEsource,
sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
// Provide initial position assistance
// The units for ecefX/Y/Z and posAcc (stddev) are cm.
bool setPositionAssistanceXYZ(int32_t ecefX, int32_t ecefY, int32_t ecefZ, uint32_t posAcc, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
// The units for lat and lon are degrees * 1e-7 (WGS84)
// The units for alt (WGS84) and posAcc (stddev) are cm.
bool setPositionAssistanceLLH(int32_t lat, int32_t lon, int32_t alt, uint32_t posAcc, sfe_ublox_mga_assist_ack_e mgaAck = SFE_UBLOX_MGA_ASSIST_ACK_NO, uint16_t maxWait = defaultMGAdelay);
// Find the start of the AssistNow Offline (UBX_MGA_ANO) data for the chosen day
// The daysIntoFture parameter makes it easy to get the data for (e.g.) tomorrow based on today's date
// Returns numDataBytes if unsuccessful
// TO DO: enhance this so it will find the nearest data for the chosen day - instead of an exact match
size_t findMGAANOForDate(const String &dataBytes, size_t numDataBytes, uint16_t year, uint8_t month, uint8_t day, uint8_t daysIntoFuture = 0);
size_t findMGAANOForDate(const uint8_t *dataBytes, size_t numDataBytes, uint16_t year, uint8_t month, uint8_t day, uint8_t daysIntoFuture = 0);
// Read the whole navigation data base. The receiver will send all available data from its internal database.
// Data is written to dataBytes. Set maxNumDataBytes to the (maximum) size of dataBytes.
// If the database exceeds maxNumDataBytes, the excess bytes will be lost.
// The function returns the number of database bytes written to dataBytes.
// The return value will be equal to maxNumDataBytes if excess data was received.
// The function will timeout after maxWait milliseconds - in case the final UBX-MGA-ACK was missed.
#define defaultNavDBDMaxWait 3100
size_t readNavigationDatabase(uint8_t *dataBytes, size_t maxNumDataBytes, uint16_t maxWait = defaultNavDBDMaxWait);
// Support for data logging
void setFileBufferSize(uint16_t bufferSize); // Set the size of the file buffer. This must be called _before_ .begin.
uint16_t getFileBufferSize(void); // Return the size of the file buffer
uint16_t extractFileBufferData(uint8_t *destination, uint16_t numBytes); // Extract numBytes of data from the file buffer. Copy it to destination. It is the user's responsibility to ensure destination is large enough.
uint16_t fileBufferAvailable(void); // Returns the number of bytes available in file buffer which are waiting to be read
uint16_t getMaxFileBufferAvail(void); // Returns the maximum number of bytes which the file buffer has contained. Handy for checking the buffer is large enough to handle all the incoming data.
void clearFileBuffer(void); // Empty the file buffer - discard all contents
void clearMaxFileBufferAvail(void); // Reset fileBufferMaxAvail
// Specific commands
// Port configurations
bool setI2CAddress(uint8_t deviceAddress, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxTime = kUBLOXGNSSDefaultMaxWait); // Changes the I2C address of the u-blox module
bool setSerialRate(uint32_t baudrate, uint8_t uartPort = COM_PORT_UART1, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxTime = kUBLOXGNSSDefaultMaxWait); // Changes the serial baud rate of the u-blox module, uartPort should be COM_PORT_UART1/2
bool setI2COutput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure I2C port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setUART1Output(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure UART1 port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setUART2Output(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure UART2 port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setUSBOutput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure USB port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setSPIOutput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure SPI port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setI2CInput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure I2C port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setUART1Input(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure UART1 port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setUART2Input(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure UART2 port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setUSBInput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure USB port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
bool setSPIInput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure SPI port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
void setNMEAOutputPort(Print &outputPort); // Sets the internal variable for the port to direct only NMEA characters to
void setRTCMOutputPort(Print &outputPort); // Sets the internal variable for the port to direct only RTCM characters to
void setUBXOutputPort(Print &outputPort); // Sets the internal variable for the port to direct only UBX characters to
void setOutputPort(Print &outputPort); // Sets the internal variable for the port to direct ALL characters to
// Reset to defaults
void factoryReset(); // Send factory reset sequence (i.e. load "default" configuration and perform hardReset)
bool factoryDefault(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Reset module to factory defaults
void hardReset(); // Perform a reset leading to a cold start (zero info start-up)
void softwareResetGNSSOnly(); // Controlled Software Reset (GNSS only) only restarts the GNSS tasks, without reinitializing the full system or reloading any stored configuration.
void softwareEnableGNSS(bool enable); // Controlled Software Start / Stop (GNSS only)
void cfgRst(uint8_t *data, uint8_t len); // Common method for CFG RST
// Save configuration to BBR / Flash
bool saveConfiguration(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Save current configuration to flash and BBR (battery backed RAM)
bool saveConfigSelective(uint32_t configMask, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Save the selected configuration sub-sections to flash and BBR (battery backed RAM)
bool cfgCfg(uint8_t *data, uint8_t len, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Common method for CFG CFG
// Functions used for RTK and base station setup
bool setSurveyMode(uint8_t mode, uint16_t observationTime, float requiredAccuracy, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Control survey in mode
bool setSurveyModeFull(uint8_t mode, uint32_t observationTime, float requiredAccuracy, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Control survey in mode
bool enableSurveyMode(uint16_t observationTime, float requiredAccuracy, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Begin Survey-In for NEO-M8P / ZED-F9x
bool enableSurveyModeFull(uint32_t observationTime, float requiredAccuracy, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Begin Survey-In for NEO-M8P / ZED-F9x
bool disableSurveyMode(uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Stop Survey-In mode
// Given coordinates, put receiver into static position. Set latlong to true to pass in lat/long values instead of ecef.
// For ECEF the units are: cm, 0.1mm, cm, 0.1mm, cm, 0.1mm
// For Lat/Lon/Alt the units are: degrees^-7, degrees^-9, degrees^-7, degrees^-9, cm, 0.1mm
bool setStaticPosition(int32_t ecefXOrLat, int8_t ecefXOrLatHP, int32_t ecefYOrLon, int8_t ecefYOrLonHP, int32_t ecefZOrAlt, int8_t ecefZOrAltHP, bool latLong, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
bool setStaticPosition(int32_t ecefXOrLat, int32_t ecefYOrLon, int32_t ecefZOrAlt, bool latLong, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
bool setDGNSSConfiguration(sfe_ublox_dgnss_mode_e dgnssMode = SFE_UBLOX_DGNSS_MODE_FIXED, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the DGNSS differential mode
// Read the module's protocol version
// For safety, call getProtocolVersion etc. inside an if(getModuleInfo())
uint8_t getProtocolVersionHigh(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the PROTVER XX.00 from UBX-MON-VER register
uint8_t getProtocolVersionLow(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the PROTVER 00.XX from UBX-MON-VER register
uint8_t getFirmwareVersionHigh(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the FWVER XX.00 from UBX-MON-VER register
uint8_t getFirmwareVersionLow(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the FWVER 00.XX from UBX-MON-VER register
const char *getFirmwareType(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the firmware type (SPG, HPG, ADR, etc.) from UBX-MON-VER register
const char *getModuleName(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the module name (ZED-F9P, ZED-F9R, etc.) from UBX-MON-VER register
bool getProtocolVersion(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Deprecated. Use getModuleInfo.
bool getModuleInfo(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Queries module, extracts info. Returns true if MON-VER was read successfully
protected:
bool prepareModuleInfo(uint16_t maxWait);
public:
moduleSWVersion_t *moduleSWVersion = nullptr; // Pointer to struct. RAM will be allocated for this if/when necessary
// Support for geofences
bool addGeofence(int32_t latitude, int32_t longitude, uint32_t radius, uint8_t confidence = 0, bool pinPolarity = 0, uint8_t pin = 0, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Add a new geofence
bool clearGeofences(uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Clears all geofences
bool getGeofenceState(geofenceState ¤tGeofenceState, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the combined geofence state
// Storage for the geofence parameters. RAM is allocated for this if/when required.
geofenceParams_t *currentGeofenceParams = nullptr; // Pointer to struct. RAM will be allocated for this if/when necessary
// Power save / off
bool powerOff(uint32_t durationInMs, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
bool powerOffWithInterrupt(uint32_t durationInMs, uint32_t wakeupSources = VAL_RXM_PMREQ_WAKEUPSOURCE_EXTINT0, bool forceWhileUsb = true, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
// Change the dynamic platform model using UBX-CFG-NAV5
bool setDynamicModel(dynModel newDynamicModel = DYN_MODEL_PORTABLE, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
uint8_t getDynamicModel(uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get the dynamic model - returns 255 if the sendCommand fails
// Reset / enable / configure the odometer
bool resetOdometer(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Reset the odometer
bool enableOdometer(bool enable = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable / disable the odometer
bool getOdometerConfig(uint8_t *flags, uint8_t *odoCfg, uint8_t *cogMaxSpeed, uint8_t *cogMaxPosAcc, uint8_t *velLpGain, uint8_t *cogLpGain, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Read the odometer configuration
bool setOdometerConfig(uint8_t flags, uint8_t odoCfg, uint8_t cogMaxSpeed, uint8_t cogMaxPosAcc, uint8_t velLpGain, uint8_t cogLpGain, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure the odometer
// Enable/Disable individual GNSS systems using UBX-CFG-GNSS
// Note: you must leave at least one major GNSS enabled! If in doubt, enable GPS before disabling the others
bool enableGNSS(bool enable, sfe_ublox_gnss_ids_e id, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
bool isGNSSenabled(sfe_ublox_gnss_ids_e id, bool *enabled, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
bool isGNSSenabled(sfe_ublox_gnss_ids_e id, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Unsafe overload
uint32_t getEnableGNSSConfigKey(sfe_ublox_gnss_ids_e id);
// Reset ESF automatic IMU-mount alignment
bool resetIMUalignment(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
// Enable/disable esfAutoAlignment
bool getESFAutoAlignment(bool *enabled, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
bool getESFAutoAlignment(uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Unsafe overload
bool setESFAutoAlignment(bool enable, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait);
// RF Information (including jamming) - ZED-F9 only
bool getRFinformation(UBX_MON_RF_data_t *data = nullptr, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get the RF information using UBX_MON_RF
// Extended hardware status
bool getHW2status(UBX_MON_HW2_data_t *data = nullptr, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get the extended hardware status using UBX_MON_HW2
// UBX-CFG-NAVX5 - get/set the ackAiding byte. If ackAiding is 1, UBX-MGA-ACK messages will be sent by the module to acknowledge the MGA data
uint8_t getAckAiding(uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get the ackAiding byte - returns 255 if the sendCommand fails
bool setAckAiding(uint8_t ackAiding, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the ackAiding byte
// AssistNow Autonomous support
// UBX-CFG-NAVX5 - get/set the aopCfg byte and set the aopOrdMaxErr word. If aopOrbMaxErr is 0 (default), the max orbit error is reset to the firmware default.
uint8_t getAopCfg(uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get the AssistNow Autonomous configuration (aopCfg) - returns 255 if the sendCommand fails
bool setAopCfg(uint8_t aopCfg, uint16_t aopOrbMaxErr = 0, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the aopCfg byte and the aopOrdMaxErr word
// SPARTN dynamic keys
//"When the receiver boots, the host should send 'current' and 'next' keys in one message." - Use setDynamicSPARTNKeys for this.
//"Every time the 'current' key is expired, 'next' takes its place."
//"Therefore the host should then retrieve the new 'next' key and send only that." - Use setDynamicSPARTNKey for this.
// The key can be provided in binary (uint8_t) format or in ASCII Hex (char) format, but in both cases keyLengthBytes _must_ represent the binary key length in bytes.
bool setDynamicSPARTNKey(uint8_t keyLengthBytes, uint16_t validFromWno, uint32_t validFromTow, const char *key);
bool setDynamicSPARTNKey(uint8_t keyLengthBytes, uint16_t validFromWno, uint32_t validFromTow, const uint8_t *key);
bool setDynamicSPARTNKeys(uint8_t keyLengthBytes1, uint16_t validFromWno1, uint32_t validFromTow1, const char *key1,
uint8_t keyLengthBytes2, uint16_t validFromWno2, uint32_t validFromTow2, const char *key2);
bool setDynamicSPARTNKeys(uint8_t keyLengthBytes1, uint16_t validFromWno1, uint32_t validFromTow1, const uint8_t *key1,
uint8_t keyLengthBytes2, uint16_t validFromWno2, uint32_t validFromTow2, const uint8_t *key2);
// Support for SPARTN parsing
uint8_t uSpartnCrc4(const uint8_t *pU8Msg, size_t size);
uint8_t uSpartnCrc8(const uint8_t *pU8Msg, size_t size);
uint16_t uSpartnCrc16(const uint8_t *pU8Msg, size_t size);
uint32_t uSpartnCrc24(const uint8_t *pU8Msg, size_t size);
uint32_t uSpartnCrc32(const uint8_t *pU8Msg, size_t size);
uint8_t * parseSPARTN(uint8_t incoming, bool &valid, uint16_t &len, sfe_ublox_spartn_header_t *header = nullptr);
// Get unique chip ID - UBX-SEC-UNIQID
bool getUniqueChipId(UBX_SEC_UNIQID_data_t *data = nullptr, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get the unique chip ID using UBX_SEC_UNIQID
const char *getUniqueChipIdStr(UBX_SEC_UNIQID_data_t *data = nullptr, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get the unique chip ID using UBX_SEC_UNIQID
// General configuration (used only on protocol v27 and higher - ie, ZED-F9P)
// VALGET
protected: // These use packetCfg - which is protected from the user
bool newCfgValget(uint8_t layer = VAL_LAYER_RAM); // Create a new, empty UBX-CFG-VALGET. Add entries with addCfgValget
bool addCfgValget(uint32_t key); // Add a new key to an existing UBX-CFG-VALGET ubxPacket - deduce the value size automatically
bool sendCfgValget(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Send the CfgValget (UBX-CFG-VALGET) construct
public:
bool newCfgValget(ubxPacket *pkt, uint16_t maxPayload, uint8_t layer = VAL_LAYER_RAM); // Create a new, empty UBX-CFG-VALGET. Add entries with addCfgValget8/16/32/64
bool addCfgValget(ubxPacket *pkt, uint32_t key); // Add a new key to an existing UBX-CFG-VALGET ubxPacket - deduce the value size automatically
bool sendCfgValget(ubxPacket *pkt, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Send the CfgValget (UBX-CFG-VALGET) construct
uint8_t getNumGetCfgKeys() { return _numGetCfgKeys; } // Return the number of keys in the VALGET packet
uint16_t getLenCfgValGetResponse() { return _lenCfgValGetResponse; } // Return the expected length of the VALGET response
uint8_t getCfgValueSizeBytes(const uint32_t key); // Returns the value size in bytes for the given key
template <typename T>
bool extractConfigValueByKey(ubxPacket *pkt, const uint32_t key, T value, size_t maxWidth) // Extract the config value by its key. maxWidth prevents writing beyond the end of value
{
if (cfgValgetValueSizes == nullptr) // Check the size list exists
return false;
uint8_t sizePtr = 0;
if (pkt->len < 4)
return false;
uint32_t k1 = key & ~UBX_CFG_SIZE_MASK; // Convert key back into an actual key
uint16_t ptr = 4;
while (ptr < pkt->len)
{
uint32_t k2 = extractLong(pkt, ptr);
if (k1 == k2)
{
ptr += 4; // Point to the value
switch (key & UBX_CFG_SIZE_MASK)
{
case UBX_CFG_L:
if (maxWidth < sizeof(bool))
return false;
*value = (bool)extractByte(pkt, ptr);
return (true);
break;
case UBX_CFG_U1:
case UBX_CFG_E1:
case UBX_CFG_X1:
if (maxWidth < sizeof(uint8_t))
return false;
*value = (uint8_t)extractByte(pkt, ptr);
return (true);
break;
case UBX_CFG_I1:
if (maxWidth < sizeof(int8_t))
return false;
*value = (int8_t)extractSignedChar(pkt, ptr);
return (true);
break;
case UBX_CFG_U2:
case UBX_CFG_E2:
case UBX_CFG_X2:
if (maxWidth < sizeof(uint16_t))
return false;
*value = (uint16_t)extractInt(pkt, ptr);
return (true);
break;
case UBX_CFG_I2:
if (maxWidth < sizeof(int16_t))
return false;
*value = (int16_t)extractSignedInt(pkt, ptr);
return (true);
break;
case UBX_CFG_U4:
case UBX_CFG_E4:
case UBX_CFG_X4:
if (maxWidth < sizeof(uint32_t))
return false;
*value = (uint32_t)extractLong(pkt, ptr);
return (true);
break;
case UBX_CFG_I4:
if (maxWidth < sizeof(int32_t))
return false;
*value = (int32_t)extractSignedLong(pkt, ptr);
return (true);
break;
case UBX_CFG_R4:
if (maxWidth < sizeof(float))
return false;
*value = (float)extractFloat(pkt, ptr);
return (true);
break;
case UBX_CFG_U8:
case UBX_CFG_X8:
if (maxWidth < sizeof(uint64_t))
return false;
*value = (uint64_t)extractLongLong(pkt, ptr);
return (true);
break;
case UBX_CFG_I8:
if (maxWidth < sizeof(int64_t))
return false;
*value = (int64_t)extractSignedLongLong(pkt, ptr);
return (true);
break;
case UBX_CFG_R8:
if (maxWidth < sizeof(double))
return false;
*value = (double)extractDouble(pkt, ptr);
return (true);
break;
default:
return false;
break;
}
}
ptr += 4; // Update ptr
ptr += cfgValgetValueSizes[sizePtr++];
}
return false;
}
protected:
sfe_ublox_status_e getVal(uint32_t key, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Load payload with response
public:
bool getVal8(uint32_t key, uint8_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
uint8_t getVal8(uint32_t key, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Unsafe overload - for backward compatibility only
bool getVal16(uint32_t key, uint16_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
uint16_t getVal16(uint32_t key, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Unsafe overload - for backward compatibility only
bool getVal32(uint32_t key, uint32_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
uint32_t getVal32(uint32_t key, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Unsafe overload - for backward compatibility only
bool getVal64(uint32_t key, uint64_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
uint64_t getVal64(uint32_t key, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Unsafe overload - for backward compatibility only
bool getValSigned8(uint32_t key, int8_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
bool getValSigned16(uint32_t key, int16_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
bool getValSigned32(uint32_t key, int32_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
bool getValSigned64(uint32_t key, int64_t *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
bool getValFloat(uint32_t key, float *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
bool getValDouble(uint32_t key, double *val, uint8_t layer = VAL_LAYER_RAM, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Returns the value at a given key location
// VALSET
bool setValN(uint32_t key, uint8_t *value, uint8_t N, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the N-byte value at a given group/id/size location
bool setVal8(uint32_t key, uint8_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 8-bit value at a given group/id/size location
bool setVal16(uint32_t key, uint16_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 16-bit value at a given group/id/size location
bool setVal32(uint32_t key, uint32_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 32-bit value at a given group/id/size location
bool setVal64(uint32_t key, uint64_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 64-bit value at a given group/id/size location
bool setValSigned8(uint32_t key, int8_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 8-bit value at a given group/id/size location
bool setValSigned16(uint32_t key, int16_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 16-bit value at a given group/id/size location
bool setValSigned32(uint32_t key, int32_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 32-bit value at a given group/id/size location
bool setValSigned64(uint32_t key, int64_t value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 64-bit value at a given group/id/size location
bool setValFloat(uint32_t key, float value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 32-bit value at a given group/id/size location
bool setValDouble(uint32_t key, double value, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Sets the 64-bit value at a given group/id/size location
bool newCfgValset(uint8_t layer = VAL_LAYER_RAM_BBR); // Create a new, empty UBX-CFG-VALSET. Add entries with addCfgValset8/16/32/64
bool addCfgValsetN(uint32_t key, uint8_t *value, uint8_t N); // Add a new key and N-byte value to an existing UBX-CFG-VALSET ubxPacket
bool sendCfgValset(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Send the CfgValset (UBX-CFG-VALSET) construct
uint8_t getCfgValsetLen(); // Returns the length of the current CfgValset construct as number-of-keys
size_t getCfgValsetSpaceRemaining(); // Returns the number of free bytes remaining in packetCfg
void autoSendCfgValsetAtSpaceRemaining(size_t spaceRemaining) { _autoSendAtSpaceRemaining = spaceRemaining; } // Cause CFG_VALSET packets to be sent automatically when packetCfg has less than this many bytes available
template <typename T>
bool addCfgValset(uint32_t key, T value) // Add a new key and value to an existing UBX-CFG-VALSET ubxPacket
{
uint8_t val[8];
uint32_t k1 = key & ~UBX_CFG_SIZE_MASK; // Convert key back into an actual key
switch (key & UBX_CFG_SIZE_MASK)
{
case UBX_CFG_L:
val[0] = (bool)value;
return (addCfgValsetN(k1, val, 1));
break;
case UBX_CFG_U1:
case UBX_CFG_E1:
case UBX_CFG_X1:
val[0] = (uint8_t)value;
return (addCfgValsetN(k1, val, 1));
break;
case UBX_CFG_I1:
unsignedSigned8 usVal8;
usVal8.signed8 = (int8_t)value;
return (addCfgValsetN(k1, &usVal8.unsigned8, 1));
break;
case UBX_CFG_U2:
case UBX_CFG_E2:
case UBX_CFG_X2:
for (uint8_t i = 0; i < 2; i++)
val[i] = (uint8_t)(((uint16_t)value) >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 2));
break;
case UBX_CFG_I2:
unsignedSigned16 usVal16;
usVal16.signed16 = (int16_t)value;
for (uint8_t i = 0; i < 2; i++)
val[i] = (uint8_t)(usVal16.unsigned16 >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 2));
break;
case UBX_CFG_U4:
case UBX_CFG_E4:
case UBX_CFG_X4:
for (uint8_t i = 0; i < 4; i++)
val[i] = (uint8_t)(((uint32_t)value) >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 4));
break;
case UBX_CFG_I4:
unsignedSigned32 usVal32;
usVal32.signed32 = (int32_t)value;
for (uint8_t i = 0; i < 4; i++)
val[i] = (uint8_t)(usVal32.unsigned32 >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 4));
break;
case UBX_CFG_R4:
unsigned32float us32flt;
us32flt.flt = (float)value;
for (uint8_t i = 0; i < 4; i++)
val[i] = (uint8_t)(us32flt.unsigned32 >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 4));
break;
case UBX_CFG_U8:
case UBX_CFG_X8:
for (uint8_t i = 0; i < 8; i++)
val[i] = (uint8_t)(((uint64_t)value) >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 8));
break;
case UBX_CFG_I8:
unsignedSigned64 usVal64;
usVal64.signed64 = (int64_t)value;
for (uint8_t i = 0; i < 8; i++)
val[i] = (uint8_t)(usVal64.unsigned64 >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 8));
break;
case UBX_CFG_R8:
unsigned64double us64dbl;
us64dbl.dbl = (float)value;
for (uint8_t i = 0; i < 8; i++)
val[i] = (uint8_t)(us64dbl.unsigned64 >> (8 * i)); // Value
return (addCfgValsetN(k1, val, 8));
break;
default:
return false;
break;
}
return false;
}
// Deprecated - use the template method addCfgValset to auto-deduce the data size
bool addCfgValset8(uint32_t key, uint8_t value); // Add a new key and 8-bit value to an existing UBX-CFG-VALSET ubxPacket
bool addCfgValset16(uint32_t key, uint16_t value); // Add a new key and 16-bit value to an existing UBX-CFG-VALSET ubxPacket
bool addCfgValset32(uint32_t key, uint32_t value); // Add a new key and 32-bit value to an existing UBX-CFG-VALSET ubxPacket
bool addCfgValset64(uint32_t key, uint64_t value); // Add a new key and 64-bit value to an existing UBX-CFG-VALSET ubxPacket
bool addCfgValsetFloat(uint32_t key, float value); // Add a new key and 32-bit float (R4) to an existing UBX-CFG-VALSET ubxPacket
bool addCfgValsetDouble(uint32_t key, double value); // Add a new key and 64-bit double (R8) to an existing UBX-CFG-VALSET ubxPacket
// Deprecated - only included for backward-compatibility. Use newCfgValset and sendCfgValset
bool newCfgValset8(uint32_t key, uint8_t value, uint8_t layer = VAL_LAYER_RAM_BBR); // Define a new UBX-CFG-VALSET with the given key and 8-bit value
bool newCfgValset16(uint32_t key, uint16_t value, uint8_t layer = VAL_LAYER_RAM_BBR); // Define a new UBX-CFG-VALSET with the given key and 16-bit value
bool newCfgValset32(uint32_t key, uint32_t value, uint8_t layer = VAL_LAYER_RAM_BBR); // Define a new UBX-CFG-VALSET with the given key and 32-bit value
bool newCfgValset64(uint32_t key, uint64_t value, uint8_t layer = VAL_LAYER_RAM_BBR); // Define a new UBX-CFG-VALSET with the given key and 64-bit value
bool sendCfgValset8(uint32_t key, uint8_t value, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Add the final key and 8-bit value to an existing UBX-CFG-VALSET ubxPacket and send it
bool sendCfgValset16(uint32_t key, uint16_t value, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Add the final key and 16-bit value to an existing UBX-CFG-VALSET ubxPacket and send it
bool sendCfgValset32(uint32_t key, uint32_t value, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Add the final key and 32-bit value to an existing UBX-CFG-VALSET ubxPacket and send it
bool sendCfgValset64(uint32_t key, uint64_t value, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Add the final key and 64-bit value to an existing UBX-CFG-VALSET ubxPacket and send it
// get and set functions for all of the "automatic" message processing
// Navigation (NAV)
// getPVT will only return data once in each navigation cycle. By default, that is once per second.
// Therefore we should set kUBLOXGNSSDefaultMaxWait to slightly longer than that.
// If you change the navigation frequency to (e.g.) 4Hz using setNavigationFrequency(4)
// then you should use a shorter maxWait. 300msec would be about right: getPVT(300)
bool getNAVPOSECEF(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV POSECEF
bool setAutoNAVPOSECEF(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic POSECEF reports at the navigation frequency
bool setAutoNAVPOSECEF(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic POSECEF reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVPOSECEFrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic POSECEF reports
bool setAutoNAVPOSECEFcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_POSECEF_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic POSECEF reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVPOSECEF(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and POSECEF is send cyclically already
void flushNAVPOSECEF(); // Mark all the data as read/stale
void logNAVPOSECEF(bool enabled = true); // Log data to file buffer
bool getNAVSTATUS(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV STATUS
bool setAutoNAVSTATUS(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic STATUS reports at the navigation frequency
bool setAutoNAVSTATUS(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic STATUS reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVSTATUSrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic STATUS reports
bool setAutoNAVSTATUScallbackPtr(void (*callbackPointerPtr)(UBX_NAV_STATUS_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic STATUS reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVSTATUS(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and STATUS is send cyclically already
void flushNAVSTATUS(); // Mark all the data as read/stale
void logNAVSTATUS(bool enabled = true); // Log data to file buffer
bool getDOP(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Query module for latest dilution of precision values and load global vars:. If autoDOP is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new DOP is available.
bool setAutoDOP(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic DOP reports at the navigation frequency
bool setAutoDOP(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic DOP reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoDOPrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic DOP reports
bool setAutoDOPcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_DOP_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic DOP reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoDOP(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and DOP is send cyclically already
void flushDOP(); // Mark all the DOP data as read/stale
void logNAVDOP(bool enabled = true); // Log data to file buffer
bool getVehAtt(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV ATT Helper
bool getNAVATT(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV ATT
bool setAutoNAVATT(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic vehicle attitude reports at the navigation frequency
bool setAutoNAVATT(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic vehicle attitude reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVATTrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic ATT reports
bool setAutoNAVATTcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_ATT_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic ATT reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVATT(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and vehicle attitude is send cyclically already
void flushNAVATT(); // Mark all the data as read/stale
void logNAVATT(bool enabled = true); // Log data to file buffer
bool getPVT(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Query module for latest group of datums and load global vars: lat, long, alt, speed, SIV, accuracies, etc. If autoPVT is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new PVT is available.
bool setAutoPVT(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic PVT reports at the navigation frequency
bool setAutoPVT(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic PVT reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoPVTrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic PVT reports
bool setAutoPVTcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_PVT_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic PVT reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoPVT(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and PVT is send cyclically already
void flushPVT(); // Mark all the PVT data as read/stale
void logNAVPVT(bool enabled = true); // Log data to file buffer
bool getNAVODO(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV ODO
bool setAutoNAVODO(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic ODO reports at the navigation frequency
bool setAutoNAVODO(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic ODO reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVODOrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic ODO reports
bool setAutoNAVODOcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_ODO_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic ODO reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVODO(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and ODO is send cyclically already
void flushNAVODO(); // Mark all the data as read/stale
void logNAVODO(bool enabled = true); // Log data to file buffer
bool getNAVVELECEF(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV VELECEF
bool setAutoNAVVELECEF(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic VELECEF reports at the navigation frequency
bool setAutoNAVVELECEF(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic VELECEF reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVVELECEFrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic VELECEF reports
bool setAutoNAVVELECEFcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_VELECEF_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic VELECEF reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVVELECEF(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and VELECEF is send cyclically already
void flushNAVVELECEF(); // Mark all the data as read/stale
void logNAVVELECEF(bool enabled = true); // Log data to file buffer
bool getNAVVELNED(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV VELNED
bool setAutoNAVVELNED(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic VELNED reports at the navigation frequency
bool setAutoNAVVELNED(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic VELNED reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVVELNEDrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic VELNED reports
bool setAutoNAVVELNEDcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_VELNED_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic VELNED reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVVELNED(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and VELNED is send cyclically already
void flushNAVVELNED(); // Mark all the data as read/stale
void logNAVVELNED(bool enabled = true); // Log data to file buffer
bool getNAVHPPOSECEF(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV HPPOSECEF
bool setAutoNAVHPPOSECEF(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic HPPOSECEF reports at the navigation frequency
bool setAutoNAVHPPOSECEF(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic HPPOSECEF reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVHPPOSECEFrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic HPPOSECEF reports
bool setAutoNAVHPPOSECEFcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_HPPOSECEF_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic HPPOSECEF reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVHPPOSECEF(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and HPPOSECEF is send cyclically already
void flushNAVHPPOSECEF(); // Mark all the data as read/stale
void logNAVHPPOSECEF(bool enabled = true); // Log data to file buffer
bool getHPPOSLLH(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV HPPOSLLH
bool setAutoHPPOSLLH(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic HPPOSLLH reports at the navigation frequency
bool setAutoHPPOSLLH(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic HPPOSLLH reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoHPPOSLLHrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic HPPOSLLH reports
bool setAutoHPPOSLLHcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_HPPOSLLH_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic HPPOSLLH reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoHPPOSLLH(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and HPPOSLLH is send cyclically already
void flushHPPOSLLH(); // Mark all the HPPPOSLLH data as read/stale. This is handy to get data alignment after CRC failure
void logNAVHPPOSLLH(bool enabled = true); // Log data to file buffer
bool getNAVPVAT(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV PVAT
bool setAutoNAVPVAT(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic PVAT reports at the navigation frequency
bool setAutoNAVPVAT(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic PVAT reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVPVATrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic PVAT reports
bool setAutoNAVPVATcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_PVAT_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic PVAT reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVPVAT(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and PVAT is send cyclically already
void flushNAVPVAT(); // Mark all the PVAT data as read/stale
void logNAVPVAT(bool enabled = true); // Log data to file buffer
bool getNAVTIMEUTC(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV TIMEUTC
bool setAutoNAVTIMEUTC(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic TIMEUTC reports at the navigation frequency
bool setAutoNAVTIMEUTC(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic TIMEUTC reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVTIMEUTCrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic TIMEUTC reports
bool setAutoNAVTIMEUTCcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_TIMEUTC_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic TIMEUTC reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVTIMEUTC(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and TIMEUTC is send cyclically already
void flushNAVTIMEUTC(); // Mark all the data as read/stale
void logNAVTIMEUTC(bool enabled = true); // Log data to file buffer
bool getNAVCLOCK(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // NAV CLOCK
bool setAutoNAVCLOCK(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic clock reports at the navigation frequency
bool setAutoNAVCLOCK(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic clock reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVCLOCKrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic CLOCK reports
bool setAutoNAVCLOCKcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_CLOCK_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic CLOCK reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVCLOCK(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and clock is send cyclically already
void flushNAVCLOCK(); // Mark all the data as read/stale
void logNAVCLOCK(bool enabled = true); // Log data to file buffer
bool getSurveyStatus(uint16_t maxWait = 2100); // NAV SVIN - Reads survey in status
bool setAutoNAVSVIN(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic survey in reports at the navigation frequency
bool setAutoNAVSVIN(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic survey in reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVSVINrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic SVIN reports
bool setAutoNAVSVINcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_SVIN_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic SVIN reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVSVIN(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and survey in is send cyclically already
void flushNAVSVIN(); // Mark all the data as read/stale
void logNAVSVIN(bool enabled = true); // Log data to file buffer
bool getNAVEOE(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Query module for latest dilution of precision values and load global vars:. If autoEOE is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new EOE is available.
bool setAutoNAVEOE(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic EOE reports at the navigation frequency
bool setAutoNAVEOE(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic EOE reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVEOErate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic EOE reports
bool setAutoNAVEOEcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_EOE_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic EOE reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVEOE(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and EOE is send cyclically already
void flushNAVEOE(); // Mark all the EOE data as read/stale
void logNAVEOE(bool enabled = true); // Log data to file buffer
// Add "auto" support for NAV TIMELS - to avoid needing 'global' storage
bool getLeapSecondEvent(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Reads leap second event info
#ifndef SFE_UBLOX_DISABLE_RAWX_SFRBX_PMP_QZSS_SAT
bool getNAVSAT(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Query module for latest AssistNow Autonomous status and load global vars:. If autoNAVSAT is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new NAVSAT is available.
bool setAutoNAVSAT(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic NAVSAT reports at the navigation frequency
bool setAutoNAVSAT(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic NAVSAT reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVSATrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic NAVSAT reports
bool setAutoNAVSATcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_SAT_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic NAVSAT reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVSAT(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and NAVSAT is send cyclically already
void flushNAVSAT(); // Mark all the NAVSAT data as read/stale
void logNAVSAT(bool enabled = true); // Log data to file buffer
bool getNAVSIG(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Query module for latest AssistNow Autonomous status and load global vars:. If autoNAVSIG is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new NAVSIG is available.
bool setAutoNAVSIG(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic NAVSIG reports at the navigation frequency
bool setAutoNAVSIG(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic NAVSIG reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoNAVSIGrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic NAVSIG reports
bool setAutoNAVSIGcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_SIG_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic NAVSIG reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoNAVSIG(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and NAVSIG is send cyclically already
void flushNAVSIG(); // Mark all the NAVSIG data as read/stale
void logNAVSIG(bool enabled = true); // Log data to file buffer
#endif
bool getRELPOSNED(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Get Relative Positioning Information of the NED frame
bool setAutoRELPOSNED(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RELPOSNED reports
bool setAutoRELPOSNED(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RELPOSNED, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoRELPOSNEDrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic RELPOSNEDreports
bool setAutoRELPOSNEDcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_RELPOSNED_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic RELPOSNED reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoRELPOSNED(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and RELPOSNED is send cyclically already
void flushNAVRELPOSNED(); // Mark all the data as read/stale
void logNAVRELPOSNED(bool enabled = true); // Log data to file buffer
bool getAOPSTATUS(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Query module for latest AssistNow Autonomous status and load global vars:. If autoAOPSTATUS is disabled, performs an explicit poll and waits, if enabled does not block. Returns true if new AOPSTATUS is available.
bool setAutoAOPSTATUS(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic AOPSTATUS reports at the navigation frequency
bool setAutoAOPSTATUS(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic AOPSTATUS reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoAOPSTATUSrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic AOPSTATUS reports
bool setAutoAOPSTATUScallbackPtr(void (*callbackPointerPtr)(UBX_NAV_AOPSTATUS_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic AOPSTATUS reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoAOPSTATUS(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and AOPSTATUS is send cyclically already
void flushAOPSTATUS(); // Mark all the AOPSTATUS data as read/stale
void logAOPSTATUS(bool enabled = true); // Log data to file buffer
#ifndef SFE_UBLOX_DISABLE_RAWX_SFRBX_PMP_QZSS_SAT
// Receiver Manager Messages (RXM)
// Configure a callback for the UBX-RXM-PMP messages produced by the NEO-D9S
// Note: on the NEO-D9S, the UBX-RXM-PMP messages are enabled by default on all ports.
// You can disable them by calling (e.g.) setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_PMP_I2C, 0)
// The NEO-D9S does not support UBX-CFG-MSG
bool setRXMPMPcallbackPtr(void (*callbackPointerPtr)(UBX_RXM_PMP_data_t *)); // Callback receives a pointer to the data, instead of _all_ the data. Much kinder on the stack!
bool setRXMPMPmessageCallbackPtr(void (*callbackPointerPtr)(UBX_RXM_PMP_message_data_t *)); // Use this if you want all of the PMP message (including sync chars, checksum, etc.) to push to a GNSS
// Configure a callback for the UBX-RXM-QZSSL6 messages produced by the NEO-D9C
// Note: on the NEO-D9C, the UBX-RXM-QZSSL6 messages are enabled by default on all ports.
// You can disable them by calling (e.g.) setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_I2C, 0)
// The NEO-D9C does not support UBX-CFG-MSG
bool setRXMQZSSL6messageCallbackPtr(void (*callbackPointerPtr)(UBX_RXM_QZSSL6_message_data_t *)); // Use this if you want all of the QZSSL6 message (including sync chars, checksum, etc.) to push to a GNSS
bool setRXMCORcallbackPtr(void (*callbackPointerPtr)(UBX_RXM_COR_data_t *)); // RXM COR
// Note: RXM-SFRBX is output-only. It cannot be polled. Strictly getRXMSFRBX should be deprecated
bool getRXMSFRBX(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // RXM SFRBX
bool setAutoRXMSFRBX(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RXM SFRBX reports at the navigation frequency
bool setAutoRXMSFRBX(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RXM SFRBX reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoRXMSFRBXrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic SFRBX reports
bool setAutoRXMSFRBXcallbackPtr(void (*callbackPointerPtr)(UBX_RXM_SFRBX_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic SFRBX reports at the navigation frequency. Data is accessed from the callback.
bool setAutoRXMSFRBXmessageCallbackPtr(void (*callbackMessagePointerPtr)(UBX_RXM_SFRBX_message_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Use this if you want all of the SFRBX message (including sync chars, checksum, etc.) to push to the PointPerfect Library
bool assumeAutoRXMSFRBX(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and RXM SFRBX is send cyclically already
void flushRXMSFRBX(); // Mark all the data as read/stale
void logRXMSFRBX(bool enabled = true); // Log data to file buffer
bool getRXMRAWX(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // RXM RAWX
bool setAutoRXMRAWX(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RXM RAWX reports at the navigation frequency
bool setAutoRXMRAWX(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RXM RAWX reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoRXMRAWXrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic RAWX reports
bool setAutoRXMRAWXcallbackPtr(void (*callbackPointerPtr)(UBX_RXM_RAWX_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic RAWX reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoRXMRAWX(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and RXM RAWX is send cyclically already
void flushRXMRAWX(); // Mark all the data as read/stale
void logRXMRAWX(bool enabled = true); // Log data to file buffer
bool getRXMMEASX(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // RXM MEASX
bool setAutoRXMMEASX(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RXM MEASX reports at the navigation frequency
bool setAutoRXMMEASX(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic RXM MEASX reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoRXMMEASXrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic MEASX reports
bool setAutoRXMMEASXcallbackPtr(void (*callbackPointerPtr)(UBX_RXM_MEASX_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic MEASX reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoRXMMEASX(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and RXM MEASX is send cyclically already
void flushRXMMEASX(); // Mark all the data as read/stale
void logRXMMEASX(bool enabled = true); // Log data to file buffer
#endif
// Timing messages (TIM)
bool getTIMTM2(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // TIM TM2
bool setAutoTIMTM2(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic TIM TM2 reports at the navigation frequency
bool setAutoTIMTM2(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic TIM TM2 reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoTIMTM2rate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic TIM TM2 reports
bool setAutoTIMTM2callbackPtr(void (*callbackPointerPtr)(UBX_TIM_TM2_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic TM2 reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoTIMTM2(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and TIM TM2 is send cyclically already
void flushTIMTM2(); // Mark all the data as read/stale
void logTIMTM2(bool enabled = true); // Log data to file buffer
bool getTIMTP(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // TIM TP
bool setAutoTIMTP(bool enabled, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic TIM TP reports at the navigation frequency
bool setAutoTIMTP(bool enabled, bool implicitUpdate, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable/disable automatic TIM TP reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
bool setAutoTIMTPrate(uint8_t rate, bool implicitUpdate = true, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Set the rate for automatic TIM TP reports
bool setAutoTIMTPcallbackPtr(void (*callbackPointerPtr)(UBX_TIM_TP_data_t *), uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Enable automatic TP reports at the navigation frequency. Data is accessed from the callback.
bool assumeAutoTIMTP(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and TIM TP is send cyclically already
void flushTIMTP(); // Mark all the data as read/stale
void logTIMTP(bool enabled = true); // Log data to file buffer
// Receiver status (MON)
bool getMONCOMMS(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // MON COMMS