forked from sparkfun/SparkFun_u-blox_GNSS_Arduino_Library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
u-blox_structs.h
1947 lines (1752 loc) · 58.4 KB
/
u-blox_structs.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
/*
This is a library written for the u-blox ZED-F9P and NEO-M8P-2
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/16481
https://www.sparkfun.com/products/15136
https://www.sparkfun.com/products/15005
https://www.sparkfun.com/products/15733
https://www.sparkfun.com/products/15193
https://www.sparkfun.com/products/15210
Original version by Nathan Seidle @ SparkFun Electronics, September 6th, 2018
v2.0 rework by Paul Clark @ SparkFun Electronics, December 31st, 2020
This library handles configuring and handling the responses
from a u-blox GPS module. Works with most modules from u-blox including
the Zed-F9P, NEO-M8P-2, NEO-M9N, ZOE-M8Q, SAM-M8Q, and many others.
https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library
Development environment specifics:
Arduino IDE 1.8.13
SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).
The MIT License (MIT)
Copyright (c) 2016 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.
*/
#ifndef __u_blox_structs_h__
#define __u_blox_structs_h__
#include "SparkFun_u-blox_GNSS_Arduino_Library.h"
#ifndef DEF_NUM_SENS
#define DEF_NUM_SENS 7 // The maximum number of ESF sensors
#endif
//Additional flags and pointers that need to be stored with each message type
struct ubxAutomaticFlags
{
union
{
uint8_t all;
struct
{
uint8_t automatic : 1; // Will this message be delivered and parsed "automatically" (without polling)
uint8_t implicitUpdate : 1; // Is the update triggered by accessing stale data (=true) or by a call to checkUblox (=false)
uint8_t addToFileBuffer : 1; // Should the raw UBX data be added to the file buffer?
uint8_t callbackCopyValid : 1; // Is the copy of the data struct used by the callback valid/fresh?
} bits;
} flags;
};
// UBX-NAV-POSECEF (0x01 0x01): Position solution in ECEF
const uint16_t UBX_NAV_POSECEF_LEN = 20;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
int32_t ecefX; // ECEF X coordinate: cm
int32_t ecefY; // ECEF Y coordinate: cm
int32_t ecefZ; // ECEF Z coordinate: cm
uint32_t pAcc; // Position Accuracy Estimate: cm
} UBX_NAV_POSECEF_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t ecefX : 1;
uint32_t ecefY : 1;
uint32_t ecefZ : 1;
uint32_t pAcc : 1;
} bits;
} moduleQueried;
} UBX_NAV_POSECEF_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_POSECEF_data_t data;
UBX_NAV_POSECEF_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_POSECEF_data_t);
UBX_NAV_POSECEF_data_t *callbackData;
} UBX_NAV_POSECEF_t;
// UBX-NAV-POSLLH (0x01 0x02): Geodetic position solution
const uint16_t UBX_NAV_POSLLH_LEN = 28;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
int32_t lon; // Longitude: Degrees * 1e-7
int32_t lat; // Latitude: Degrees * 1e-7
int32_t height; // Height above ellipsoid: mm
int32_t hMSL; // Height above mean sea level: mm
uint32_t hAcc; // Horizontal Accuracy Estimate: mm
uint32_t vAcc; // Vertical Accuracy Estimate: mm
} UBX_NAV_POSLLH_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t lon : 1;
uint32_t lat : 1;
uint32_t height : 1;
uint32_t hMSL : 1;
uint32_t hAcc : 1;
uint32_t vAcc : 1;
} bits;
} moduleQueried;
} UBX_NAV_POSLLH_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_POSLLH_data_t data;
UBX_NAV_POSLLH_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_POSLLH_data_t);
UBX_NAV_POSLLH_data_t *callbackData;
} UBX_NAV_POSLLH_t;
// UBX-NAV-STATUS (0x01 0x03): Receiver navigation status
const uint16_t UBX_NAV_STATUS_LEN = 16;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint8_t gpsFix; // GPSfix Type: 0x00 = no fix; 0x01 = dead reckoning only; 0x02 = 2D-fix; 0x03 = 3D-fix
// 0x04 = GPS + dead reckoning combined; 0x05 = Time only fix; 0x06..0xff = reserved
union
{
uint8_t all;
struct
{
uint8_t gpsFixOk : 1; // 1 = position and velocity valid and within DOP and ACC Masks.
uint8_t diffSoln : 1; // 1 = differential corrections were applied
uint8_t wknSet : 1; // 1 = Week Number valid (see Time Validity section for details)
uint8_t towSet : 1; // 1 = Time of Week valid (see Time Validity section for details)
} bits;
} flags;
union
{
uint8_t all;
struct
{
uint8_t diffCorr : 1; // 1 = differential corrections available
uint8_t carrSolnValid : 1; // 1 = valid carrSoln
uint8_t reserved : 4;
uint8_t mapMatching : 2; // map matching status: 00: none
// 01: valid but not used, i.e. map matching data was received, but was too old
// 10: valid and used, map matching data was applied
// 11: valid and used, map matching data was applied.
} bits;
} fixStat;
union
{
uint8_t all;
struct
{
uint8_t psmState : 2; // power save mode state
// 0: ACQUISITION [or when psm disabled]
// 1: TRACKING
// 2: POWER OPTIMIZED TRACKING
// 3: INACTIVE
uint8_t reserved1 : 1;
uint8_t spoofDetState : 2; // Spoofing detection state
// 0: Unknown or deactivated
// 1: No spoofing indicated
// 2: Spoofing indicated
// 3: Multiple spoofing indications
uint8_t reserved2 : 1;
uint8_t carrSoln : 2; // Carrier phase range solution status:
// 0: no carrier phase range solution
// 1: carrier phase range solution with floating ambiguities
// 2: carrier phase range solution with fixed ambiguities
} bits;
} flags2;
uint32_t ttff; // Time to first fix (millisecond time tag): ms
uint32_t msss; // Milliseconds since Startup / Reset: ms
} UBX_NAV_STATUS_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t gpsFix : 1;
uint32_t gpsFixOk : 1;
uint32_t diffSoln : 1;
uint32_t wknSet : 1;
uint32_t towSet : 1;
uint32_t diffCorr : 1;
uint32_t carrSolnValid : 1;
uint32_t mapMatching : 1;
uint32_t psmState : 1;
uint32_t spoofDetState : 1;
uint32_t carrSoln : 1;
uint32_t ttff : 1;
uint32_t msss : 1;
} bits;
} moduleQueried;
} UBX_NAV_STATUS_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_STATUS_data_t data;
UBX_NAV_STATUS_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_STATUS_data_t);
UBX_NAV_STATUS_data_t *callbackData;
} UBX_NAV_STATUS_t;
// UBX-NAV-DOP (0x01 0x04): Dilution of precision
const uint16_t UBX_NAV_DOP_LEN = 18;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint16_t gDOP; // Geometric DOP: * 0.01
uint16_t pDOP; // Position DOP: * 0.01
uint16_t tDOP; // Time DOP: * 0.01
uint16_t vDOP; // Vertical DOP: * 0.01
uint16_t hDOP; // Horizontal DOP: * 0.01
uint16_t nDOP; // Northing DOP: * 0.01
uint16_t eDOP; // Easting DOP: * 0.01
} UBX_NAV_DOP_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t gDOP : 1;
uint32_t pDOP : 1;
uint32_t tDOP : 1;
uint32_t vDOP : 1;
uint32_t hDOP : 1;
uint32_t nDOP : 1;
uint32_t eDOP : 1;
} bits;
} moduleQueried;
} UBX_NAV_DOP_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_DOP_data_t data;
UBX_NAV_DOP_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_DOP_data_t);
UBX_NAV_DOP_data_t *callbackData;
} UBX_NAV_DOP_t;
// UBX-NAV-ATT (0x01 0x05): Attitude solution
const uint16_t UBX_NAV_ATT_LEN = 32;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint8_t version; // Message version (0x00 for this version)
uint8_t reserved1[3];
int32_t roll; // Vehicle roll: Degrees * 1e-5
int32_t pitch; // Vehicle pitch: Degrees * 1e-5
int32_t heading; // Vehicle heading: Degrees * 1e-5
uint32_t accRoll; // Vehicle roll accuracy (if null, roll angle is not available): Degrees * 1e-5
uint32_t accPitch; // Vehicle pitch accuracy (if null, roll angle is not available): Degrees * 1e-5
uint32_t accHeading; // Vehicle heading accuracy (if null, roll angle is not available): Degrees * 1e-5
} UBX_NAV_ATT_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t version : 1;
uint32_t roll : 1;
uint32_t pitch : 1;
uint32_t heading : 1;
uint32_t accRoll : 1;
uint32_t accPitch : 1;
uint32_t accHeading : 1;
} bits;
} moduleQueried;
} UBX_NAV_ATT_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_ATT_data_t data;
UBX_NAV_ATT_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_ATT_data_t);
UBX_NAV_ATT_data_t *callbackData;
} UBX_NAV_ATT_t;
// UBX-NAV-PVT (0x01 0x07): Navigation position velocity time solution
const uint16_t UBX_NAV_PVT_LEN = 92;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint16_t year; // Year (UTC)
uint8_t month; // Month, range 1..12 (UTC)
uint8_t day; // Day of month, range 1..31 (UTC)
uint8_t hour; // Hour of day, range 0..23 (UTC)
uint8_t min; // Minute of hour, range 0..59 (UTC)
uint8_t sec; // Seconds of minute, range 0..60 (UTC)
union
{
uint8_t all;
struct
{
uint8_t validDate : 1; // 1 = valid UTC Date
uint8_t validTime : 1; // 1 = valid UTC time of day
uint8_t fullyResolved : 1; // 1 = UTC time of day has been fully resolved (no seconds uncertainty).
uint8_t validMag : 1; // 1 = valid magnetic declination
} bits;
} valid;
uint32_t tAcc; // Time accuracy estimate (UTC): ns
int32_t nano; // Fraction of second, range -1e9 .. 1e9 (UTC): ns
uint8_t fixType; // GNSSfix Type:
// 0: no fix
// 1: dead reckoning only
// 2: 2D-fix
// 3: 3D-fix
// 4: GNSS + dead reckoning combined
// 5: time only fix
union
{
uint8_t all;
struct
{
uint8_t gnssFixOK : 1; // 1 = valid fix (i.e within DOP & accuracy masks)
uint8_t diffSoln : 1; // 1 = differential corrections were applied
uint8_t psmState : 3;
uint8_t headVehValid : 1; // 1 = heading of vehicle is valid, only set if the receiver is in sensor fusion mode
uint8_t carrSoln : 2; // Carrier phase range solution status:
// 0: no carrier phase range solution
// 1: carrier phase range solution with floating ambiguities
// 2: carrier phase range solution with fixed ambiguities
} bits;
} flags;
union
{
uint8_t all;
struct
{
uint8_t reserved : 5;
uint8_t confirmedAvai : 1; // 1 = information about UTC Date and Time of Day validity confirmation is available
uint8_t confirmedDate : 1; // 1 = UTC Date validity could be confirmed
uint8_t confirmedTime : 1; // 1 = UTC Time of Day could be confirmed
} bits;
} flags2;
uint8_t numSV; // Number of satellites used in Nav Solution
int32_t lon; // Longitude: deg * 1e-7
int32_t lat; // Latitude: deg * 1e-7
int32_t height; // Height above ellipsoid: mm
int32_t hMSL; // Height above mean sea level: mm
uint32_t hAcc; // Horizontal accuracy estimate: mm
uint32_t vAcc; // Vertical accuracy estimate: mm
int32_t velN; // NED north velocity: mm/s
int32_t velE; // NED east velocity: mm/s
int32_t velD; // NED down velocity: mm/s
int32_t gSpeed; // Ground Speed (2-D): mm/s
int32_t headMot; // Heading of motion (2-D): deg * 1e-5
uint32_t sAcc; // Speed accuracy estimate: mm/s
uint32_t headAcc; // Heading accuracy estimate (both motion and vehicle): deg * 1e-5
uint16_t pDOP; // Position DOP * 0.01
union
{
uint8_t all;
struct
{
uint8_t invalidLlh : 1; // 1 = Invalid lon, lat, height and hMSL
} bits;
} flags3;
uint8_t reserved1[5];
int32_t headVeh; // Heading of vehicle (2-D): deg * 1e-5
int16_t magDec; // Magnetic declination: deg * 1e-2
uint16_t magAcc; // Magnetic declination accuracy: deg * 1e-2
} UBX_NAV_PVT_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t year : 1;
uint32_t month : 1;
uint32_t day : 1;
uint32_t hour : 1;
uint32_t min : 1;
uint32_t sec : 1;
uint32_t validDate : 1;
uint32_t validTime : 1;
uint32_t fullyResolved : 1;
uint32_t validMag : 1;
uint32_t tAcc : 1;
uint32_t nano : 1;
uint32_t fixType : 1;
uint32_t gnssFixOK : 1;
uint32_t diffSoln : 1;
uint32_t psmState : 1;
uint32_t headVehValid : 1;
uint32_t carrSoln : 1;
uint32_t confirmedAvai : 1;
uint32_t confirmedDate : 1;
uint32_t confirmedTime : 1;
uint32_t numSV : 1;
uint32_t lon : 1;
uint32_t lat : 1;
uint32_t height : 1;
uint32_t hMSL : 1;
uint32_t hAcc : 1;
uint32_t vAcc : 1;
uint32_t velN : 1;
uint32_t velE : 1;
} bits;
} moduleQueried1;
union
{
uint32_t all;
struct
{
uint32_t velD : 1;
uint32_t gSpeed : 1;
uint32_t headMot : 1;
uint32_t sAcc : 1;
uint32_t headAcc : 1;
uint32_t pDOP : 1;
uint32_t invalidLlh : 1;
uint32_t headVeh : 1;
uint32_t magDec : 1;
uint32_t magAcc : 1;
} bits;
} moduleQueried2;
} UBX_NAV_PVT_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_PVT_data_t data;
UBX_NAV_PVT_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_PVT_data_t);
UBX_NAV_PVT_data_t *callbackData;
} UBX_NAV_PVT_t;
// UBX-NAV-ODO (0x01 0x09): Odometer solution
const uint16_t UBX_NAV_ODO_LEN = 20;
typedef struct
{
uint8_t version; // Message version (0x00 for this version)
uint8_t reserved1[3];
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint32_t distance; // Ground distance since last reset: m
uint32_t totalDistance; // Total cumulative ground distance: m
uint32_t distanceStd; // Ground distance accuracy (1-sigma): m
} UBX_NAV_ODO_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t version : 1;
uint32_t iTOW : 1;
uint32_t distance : 1;
uint32_t totalDistance : 1;
uint32_t distanceStd : 1;
} bits;
} moduleQueried;
} UBX_NAV_ODO_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_ODO_data_t data;
UBX_NAV_ODO_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_ODO_data_t);
UBX_NAV_ODO_data_t *callbackData;
} UBX_NAV_ODO_t;
// UBX-NAV-VELECEF (0x01 0x11): Velocity solution in ECEF
const uint16_t UBX_NAV_VELECEF_LEN = 20;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
int32_t ecefVX; // ECEF X velocity: cm/s
int32_t ecefVY; // ECEF Y velocity: cm/s
int32_t ecefVZ; // ECEF Z velocity: cm/s
uint32_t sAcc; // Speed accuracy estimate: cm/s
} UBX_NAV_VELECEF_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t ecefVX : 1;
uint32_t ecefVY : 1;
uint32_t ecefVZ : 1;
uint32_t sAcc : 1;
} bits;
} moduleQueried;
} UBX_NAV_VELECEF_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_VELECEF_data_t data;
UBX_NAV_VELECEF_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_VELECEF_data_t);
UBX_NAV_VELECEF_data_t *callbackData;
} UBX_NAV_VELECEF_t;
// UBX-NAV-VELNED (0x01 0x12): Velocity solution in NED frame
const uint16_t UBX_NAV_VELNED_LEN = 36;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
int32_t velN; // North velocity component: cm/s
int32_t velE; // East velocity component: cm/s
int32_t velD; // Down velocity component: cm/s
uint32_t speed; // Speed (3-D): cm/s
uint32_t gSpeed; // Ground Speed (2-D): cm/s
int32_t heading; // Heading of motion 2-D: Degrees * 1e-5
uint32_t sAcc; // Speed accuracy estimate: cm/s
uint32_t cAcc; // Course/Heading accuracy estimate: Degrees * 1e-5
} UBX_NAV_VELNED_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t velN : 1;
uint32_t velE : 1;
uint32_t velD : 1;
uint32_t speed : 1;
uint32_t gSpeed : 1;
uint32_t heading : 1;
uint32_t sAcc : 1;
uint32_t cAcc : 1;
} bits;
} moduleQueried;
} UBX_NAV_VELNED_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_VELNED_data_t data;
UBX_NAV_VELNED_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_VELNED_data_t);
UBX_NAV_VELNED_data_t *callbackData;
} UBX_NAV_VELNED_t;
// UBX-NAV-HPPOSECEF (0x01 0x13): High precision position solution in ECEF
const uint16_t UBX_NAV_HPPOSECEF_LEN = 28;
typedef struct
{
uint8_t version; // Message version (0x00 for this version)
uint8_t reserved1[3];
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
int32_t ecefX; // ECEF X coordinate: cm
int32_t ecefY; // ECEF Y coordinate: cm
int32_t ecefZ; // ECEF Z coordinate: cm
int8_t ecefXHp; // High precision component of ECEF X coordinate: mm * 0.1
int8_t ecefYHp; // High precision component of ECEF Y coordinate: mm * 0.1
int8_t ecefZHp; // High precision component of ECEF Z coordinate: mm * 0.1
union
{
uint8_t all;
struct
{
uint8_t invalidEcef : 1; // 1 = Invalid ecefX, ecefY, ecefZ, ecefXHp, ecefYHp and ecefZHp
} bits;
} flags;
uint32_t pAcc; // Position Accuracy Estimate: mm * 0.1
} UBX_NAV_HPPOSECEF_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t version : 1;
uint32_t iTOW : 1;
uint32_t ecefX : 1;
uint32_t ecefY : 1;
uint32_t ecefZ : 1;
uint32_t ecefXHp : 1;
uint32_t ecefYHp : 1;
uint32_t ecefZHp : 1;
uint32_t invalidEcef : 1;
uint32_t pAcc : 1;
} bits;
} moduleQueried;
} UBX_NAV_HPPOSECEF_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_HPPOSECEF_data_t data;
UBX_NAV_HPPOSECEF_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_HPPOSECEF_data_t);
UBX_NAV_HPPOSECEF_data_t *callbackData;
} UBX_NAV_HPPOSECEF_t;
// UBX-NAV-HPPOSLLH (0x01 0x14): High precision geodetic position solution
const uint16_t UBX_NAV_HPPOSLLH_LEN = 36;
typedef struct
{
uint8_t version; // Message version (0x00 for this version)
uint8_t reserved1[2];
union
{
uint8_t all;
struct
{
uint8_t invalidLlh : 1; // 1 = Invalid lon, lat, height, hMSL, lonHp, latHp, heightHp and hMSLHp
} bits;
} flags;
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
int32_t lon; // Longitude: deg * 1e-7
int32_t lat; // Latitude: deg * 1e-7
int32_t height; // Height above ellipsoid: mm
int32_t hMSL; // Height above mean sea level: mm
int8_t lonHp; // High precision component of longitude: deg * 1e-9
int8_t latHp; // High precision component of latitude: deg * 1e-9
int8_t heightHp; // High precision component of height above ellipsoid: mm * 0.1
int8_t hMSLHp; // High precision component of height above mean sea level: mm * 0.1
uint32_t hAcc; // Horizontal accuracy estimate: mm * 0.1
uint32_t vAcc; // Vertical accuracy estimate: mm * 0.1
} UBX_NAV_HPPOSLLH_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t version : 1;
uint32_t invalidLlh : 1;
uint32_t iTOW : 1;
uint32_t lon : 1;
uint32_t lat : 1;
uint32_t height : 1;
uint32_t hMSL : 1;
uint32_t lonHp : 1;
uint32_t latHp : 1;
uint32_t heightHp : 1;
uint32_t hMSLHp : 1;
uint32_t hAcc : 1;
uint32_t vAcc : 1;
} bits;
} moduleQueried;
} UBX_NAV_HPPOSLLH_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_HPPOSLLH_data_t data;
UBX_NAV_HPPOSLLH_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_HPPOSLLH_data_t);
UBX_NAV_HPPOSLLH_data_t *callbackData;
} UBX_NAV_HPPOSLLH_t;
// UBX-NAV-TIMEUTC (0x01 0x21): UTC time solution
const uint16_t UBX_NAV_TIMEUTC_LEN = 20;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint32_t tAcc; // Time accuracy estimate (UTC): ns
int32_t nano; // Fraction of second, range -1e9 .. 1e9 (UTC): ns
uint16_t year; // Year (UTC)
uint8_t month; // Month, range 1..12 (UTC)
uint8_t day; // Day of month, range 1..31 (UTC)
uint8_t hour; // Hour of day, range 0..23 (UTC)
uint8_t min; // Minute of hour, range 0..59 (UTC)
uint8_t sec; // Seconds of minute, range 0..60 (UTC)
union
{
uint8_t all;
struct
{
uint8_t validTOW : 1; // 1 = Valid Time of Week
uint8_t validWKN : 1; // 1 = Valid Week Number
uint8_t validUTC : 1; // 1 = Valid UTC Time
uint8_t reserved : 1;
uint8_t utcStandard : 4; // UTC standard identifier
} bits;
} valid;
} UBX_NAV_TIMEUTC_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t tAcc : 1;
uint32_t nano : 1;
uint32_t year : 1;
uint32_t month : 1;
uint32_t day : 1;
uint32_t hour : 1;
uint32_t min : 1;
uint32_t sec : 1;
uint32_t validTOW : 1;
uint32_t validWKN : 1;
uint32_t validUTC : 1;
uint32_t utcStandard : 1;
} bits;
} moduleQueried;
} UBX_NAV_TIMEUTC_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_TIMEUTC_data_t data;
UBX_NAV_TIMEUTC_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_TIMEUTC_data_t);
UBX_NAV_TIMEUTC_data_t *callbackData;
} UBX_NAV_TIMEUTC_t;
// UBX-NAV-CLOCK (0x01 0x22): Clock solution
const uint16_t UBX_NAV_CLOCK_LEN = 20;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
int32_t clkB; // Clock bias: ns
int32_t clkD; // Clock drift: ns/s
uint32_t tAcc; // Time accuracy estimate: ns
uint32_t fAcc; // Frequency accuracy estimate: ps/s
} UBX_NAV_CLOCK_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t clkB : 1;
uint32_t clkD : 1;
uint32_t tAcc : 1;
uint32_t fAcc : 1;
} bits;
} moduleQueried;
} UBX_NAV_CLOCK_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_CLOCK_data_t data;
UBX_NAV_CLOCK_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_CLOCK_data_t);
UBX_NAV_CLOCK_data_t *callbackData;
} UBX_NAV_CLOCK_t;
const uint16_t UBX_NAV_COV_LEN = 64;
typedef struct
{
uint32_t iTOW;
uint8_t msgVersion;
uint8_t posCovValid;
uint8_t velCovValid;
float posCovNN;
float posCovNE;
float posCovND;
float posCovEE;
float posCovED;
float posCovDD;
float velCovNN;
float velCovNE;
float velCovND;
float velCovEE;
float velCovED;
float velCovDD;
} UBX_NAV_COV_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t msgVersion : 1;
uint32_t posCovValid : 1;
uint32_t velCovValid : 1;
uint32_t posCovNN : 1;
uint32_t posCovNE : 1;
uint32_t posCovND : 1;
uint32_t posCovEE : 1;
uint32_t posCovED : 1;
uint32_t posCovDD : 1;
uint32_t velCovNN : 1;
uint32_t velCovNE : 1;
uint32_t velCovND : 1;
uint32_t velCovEE : 1;
uint32_t velCovED : 1;
uint32_t velCovDD : 1;
} bits;
} moduleQueried;
} UBX_NAV_COV_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_COV_data_t data;
UBX_NAV_COV_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_COV_data_t);
UBX_NAV_COV_data_t *callbackData;
} UBX_NAV_COV_t;
// UBX-NAV-TIMELS (0x01 0x26): Leap second event information
const uint16_t UBX_NAV_TIMELS_LEN = 24;
typedef struct
{
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint8_t version; // Message version (0x00 for this version)
uint8_t reserved1[3];
uint8_t srcOfCurrLs; //Information source for the current number of leap seconds
int8_t currLs; //Current number of leap seconds since start of GPS (Jan 6, 1980), s
uint8_t srcOfLsChange; //Information source for the future leap second event
int8_t lsChange; //Future leap second change if one is scheduled, +1, 0, -1s
int32_t timeToLsEvent; //Num of secs until the next or from the last leap second, s
uint16_t dateOfLsGpsWn; //GPS week num (WN) of the next or the last leap second event
uint16_t dateOfLsGpsDn; //GPS day of week num (DN) for the next or last leap second event
uint8_t reserved2[3];
union
{
uint8_t all;
struct
{
uint8_t validCurrLs : 1; // 1 = Valid current number of leap seconds value
uint8_t validTimeToLsEvent : 1; // 1 = Valid time to next leap second event or from the last leap second event if no future event scheduled
} bits;
} valid;
} UBX_NAV_TIMELS_data_t;
typedef struct
{
union
{
uint32_t all;
struct
{
uint32_t all : 1;
uint32_t iTOW : 1;
uint32_t version : 1;
uint32_t srcOfCurrLs : 1;
uint32_t currLs : 1;
uint32_t srcOfLsChange : 1;
uint32_t lsChange : 1;
uint32_t timeToLsEvent : 1;
uint32_t dateOfLsGpsWn : 1;
uint32_t dateOfLsGpsDn : 1;
uint32_t validCurrLs : 1;
uint32_t validTimeToLsEvent : 1;
} bits;
} moduleQueried;
} UBX_NAV_TIMELS_moduleQueried_t;
typedef struct
{
ubxAutomaticFlags automaticFlags;
UBX_NAV_TIMELS_data_t data;
UBX_NAV_TIMELS_moduleQueried_t moduleQueried;
void (*callbackPointer)(UBX_NAV_TIMELS_data_t);
UBX_NAV_TIMELS_data_t *callbackData;
} UBX_NAV_TIMELS_t;
// UBX-NAV-SVIN (0x01 0x3B): Survey-in data
const uint16_t UBX_NAV_SVIN_LEN = 40;
typedef struct
{
uint8_t version; // Message version (0x00 for this version)
uint8_t reserved1[3];
uint32_t iTOW; // GPS time of week of the navigation epoch: ms
uint32_t dur; // Passed survey-in observation time: s
int32_t meanX; // Current survey-in mean position ECEF X coordinate: cm
int32_t meanY; // Current survey-in mean position ECEF Y coordinate: cm
int32_t meanZ; // Current survey-in mean position ECEF Z coordinate: cm
int8_t meanXHP; // Current high-precision survey-in mean position ECEF X coordinate: mm * 0.1
int8_t meanYHP; // Current high-precision survey-in mean position ECEF Y coordinate: mm * 0.1
int8_t meanZHP; // Current high-precision survey-in mean position ECEF Z coordinate: mm * 0.1
uint8_t reserved2;
uint32_t meanAcc; // Current survey-in mean position accuracy: mm * 0.1
uint32_t obs; // Number of position observations used during survey-in
int8_t valid; // Survey-in position validity flag, 1 = valid, otherwise 0
int8_t active; // Survey-in in progress flag, 1 = in-progress, otherwise 0
uint8_t reserved3[2];
} UBX_NAV_SVIN_data_t;
typedef struct