In Android development (latest SDK) I am using the GpsStatus.NmeaListener to parse NMEA messages for time synchronization.
In the onNmeaReceived(long timestamp, String nmea) callback I parse the nmea string for GPRMC messages. I then calculate the offset between the system clock and the time parsed from the GPRMC message.
Now there is a delay between the moment in time the NMEA message was received in the Android Frame work and the handling of the callback. This would cause a variation in the actual offset that I am calculating.
My guess is that the timestamp that is send along the NMEA message is the system clock time of the moment that the NMEA message was received. If this is true, I can use this timestamp to compensate for the latency in the callback handling.
From my measurements, the timestamp time has a difference from the System clock time captured in the onNmeaReceived callback of approx 10 ~ 30 ms.
The difference/offset between the time between the timestamp and the time derived from the parsed GPRMC message is in the order of 7200092ms (2hours difference between GPS and system time).
Therefore I would say the timestamp is not the GPS-based time but the system clock time when the message was received.
I have searched the web for quite a bit but I can not seem to locate any information regarding this timestamp. Does anyone have a resource that tells us more about this timestamp? What exactly does this timestamp represent? At what moment in time is it recorded?
timestamptime has a difference from the System clock time captured in theonNmeaReceivedcallback of approx 10 ~ 30 ms. Therefore I would say it is not the GPS-based time. The difference/offset between the time between thetimestampand the time derived from the parsed GPRMC message is in the order of 7200092ms (2hours difference between GPS and system time). - Kammingatimestampyou mentioned for the time(stamp) from the GPRMC message. However, the issue would still be the same: The point in time the message is received outside of the GPS receiver is subject to "random" delays and jitter even at the lowest layer of the software stack. GPS receivers for timing applications have a dedicated signal/interrupt line to enable synchronization to GPS time, which an Android device is unlikely to employ. So, my estimation remains that you cannot rely on the accuracy of the arrival time of GPS time messages to below maybe 100ms. - JimmyBtimestampinformation. It looks like it should be taken at the moment of an interrupt from the GPS receiver, in order to make the NMEA information usefull. However I cannot find any information regarding thetimestamp. Measuring the standard deviation of 200 offsets between thetimestampand the GPRMC-time over 10 devices, results in an average standard deviation of 6.95ms. Thus, the jitter is not that high... Would you have an idea of where to find more legit documentation regarding thetimestamp? - Kammingagettimeofday(). (nmea_cbis the callback of typegps_nmea_callback). - JimmyB