I am trying to understand the way in which sodaq One tracker v2 discerns to have the right number of available GPS satellites.
I have seen in the function getGpsFixAndTransmit that it waits for the timeout and for the count of available satellites with the condition
while ((getNow() - startTime <= params.getGpsFixTimeout()) && (pendingReportDataRecord.getSatelliteCount() < params.getGpsMinSatelliteCount()))
But how/where is getSatelliteCount() updated? I understand that it is checking to get the minimun satellites although not quite well where is the update made, on the Ublox itself?
Thanks in adnvace,
The method delegateNavPvt() (lines 883-920) copies the the GPS data into pendingReportDataRecord.
This method is a delegate method which handles the incoming GPS data. The method is assigned to the ublox instance on line 1045.
The call to ublox.GetPeriodic() (on line 951) is what triggers the ublox instance to call that delegate method (if a new packet is available).
Thanks for the explanation @GabrielNotman,
Why casting a pointer to a function with delegateNavPvt? My compiler complains about it variable or field ‘delegateNavPvt’ declared void
On the other hand, I was wondering as well, in the method delegateNavPvt you are using the ublox.db_printf() but that is debug function, so if the lib is not in debug it won’t give back anything, will it? In case I want just the latitude reading should I just store NavPvt->lat right?