@@ -42,22 +42,22 @@ SFE_UBLOX_GNSS myGNSS;
42
42
// | / _____ You can use any name you like for the struct
43
43
// | | /
44
44
// | | |
45
- void printSATdata (UBX_NAV_SAT_data_t ubxDataStruct)
45
+ void printSATdata (UBX_NAV_SAT_data_t * ubxDataStruct)
46
46
{
47
47
// Serial.println();
48
48
49
49
Serial.print (F (" UBX-NAV-SAT contains data for " ));
50
- Serial.print (ubxDataStruct. header .numSvs );
51
- if (ubxDataStruct. header .numSvs == 1 )
50
+ Serial.print (ubxDataStruct-> header .numSvs );
51
+ if (ubxDataStruct-> header .numSvs == 1 )
52
52
Serial.println (F (" SV" ));
53
53
else
54
54
Serial.println (F (" SVs" ));
55
55
56
56
uint16_t numAopAvail = 0 ; // Count how many SVs have AssistNow Autonomous data available
57
57
58
- for (uint16_t block = 0 ; block < ubxDataStruct. header .numSvs ; block++) // For each SV
58
+ for (uint16_t block = 0 ; block < ubxDataStruct-> header .numSvs ; block++) // For each SV
59
59
{
60
- if (ubxDataStruct. blocks [block].flags .bits .aopAvail == 1 ) // If the aopAvail bit is set
60
+ if (ubxDataStruct-> blocks [block].flags .bits .aopAvail == 1 ) // If the aopAvail bit is set
61
61
numAopAvail++; // Increment the number of SVs
62
62
}
63
63
@@ -78,12 +78,12 @@ void printSATdata(UBX_NAV_SAT_data_t ubxDataStruct)
78
78
// | / _____ You can use any name you like for the struct
79
79
// | | /
80
80
// | | |
81
- void printAOPstatus (UBX_NAV_AOPSTATUS_data_t ubxDataStruct)
81
+ void printAOPstatus (UBX_NAV_AOPSTATUS_data_t * ubxDataStruct)
82
82
{
83
83
// Serial.println();
84
84
85
85
Serial.print (F (" AOPSTATUS status is " ));
86
- Serial.println (ubxDataStruct. status );
86
+ Serial.println (ubxDataStruct-> status );
87
87
}
88
88
89
89
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -95,27 +95,27 @@ void printAOPstatus(UBX_NAV_AOPSTATUS_data_t ubxDataStruct)
95
95
// | / _____ You can use any name you like for the struct
96
96
// | | /
97
97
// | | |
98
- void printPVTdata (UBX_NAV_PVT_data_t ubxDataStruct)
98
+ void printPVTdata (UBX_NAV_PVT_data_t * ubxDataStruct)
99
99
{
100
100
// Print the UBX-NAV-PVT data so we can see how quickly the fixType goes to 3D
101
101
102
102
Serial.println ();
103
103
104
- long latitude = ubxDataStruct. lat ; // Print the latitude
104
+ long latitude = ubxDataStruct-> lat ; // Print the latitude
105
105
Serial.print (F (" Lat: " ));
106
106
Serial.print (latitude);
107
107
108
- long longitude = ubxDataStruct. lon ; // Print the longitude
108
+ long longitude = ubxDataStruct-> lon ; // Print the longitude
109
109
Serial.print (F (" Long: " ));
110
110
Serial.print (longitude);
111
111
Serial.print (F (" (degrees * 10^-7)" ));
112
112
113
- long altitude = ubxDataStruct. hMSL ; // Print the height above mean sea level
113
+ long altitude = ubxDataStruct-> hMSL ; // Print the height above mean sea level
114
114
Serial.print (F (" Alt: " ));
115
115
Serial.print (altitude);
116
116
Serial.print (F (" (mm)" ));
117
117
118
- byte fixType = ubxDataStruct. fixType ; // Print the fix type
118
+ byte fixType = ubxDataStruct-> fixType ; // Print the fix type
119
119
Serial.print (F (" Fix: " ));
120
120
if (fixType == 0 ) Serial.print (F (" No fix" ));
121
121
else if (fixType == 1 ) Serial.print (F (" Dead reckoning" ));
@@ -171,9 +171,9 @@ void setup()
171
171
172
172
myGNSS.setNavigationFrequency (1 ); // Produce one solution per second
173
173
174
- myGNSS.setAutoNAVSATcallback (&printSATdata); // Enable automatic NAV SAT messages with callback to printSATdata
175
- myGNSS.setAutoAOPSTATUScallback (&printAOPstatus); // Enable automatic NAV AOPSTATUS messages with callback to printAOPstatus
176
- myGNSS.setAutoPVTcallback (&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
174
+ myGNSS.setAutoNAVSATcallbackPtr (&printSATdata); // Enable automatic NAV SAT messages with callback to printSATdata
175
+ myGNSS.setAutoAOPSTATUScallbackPtr (&printAOPstatus); // Enable automatic NAV AOPSTATUS messages with callback to printAOPstatus
176
+ myGNSS.setAutoPVTcallbackPtr (&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
177
177
}
178
178
179
179
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
0 commit comments