#include <time.h>
#include "common.h"
Go to the source code of this file.
Define Documentation
Unix timestamp of the GPS epoch 1980-01-06 00:00:00 UTC
Definition at line 31 of file gpstime.h.
Offset between GPS and UTC times in seconds. Update when a new leap second is inserted and be careful about times in the past when this offset was different.
Definition at line 28 of file gpstime.h.
Number of rollovers in the 10-bit broadcast GPS week number. Update on next rollover on April 7, 2019.
- Todo:
- Detect and handle rollover more gracefully.
Definition at line 23 of file gpstime.h.
Function Documentation
Structure representing a GPS time.
< Seconds since the GPS start of week.
< GPS week number.
Definition at line 34 of file gpstime.h.
Convert a `gps_time_t` GPS time to a Unix `time_t`.
- Note:
- Adjusts for leap seconds using the current constant offset.
- Parameters:
-
- Returns:
- Unix time.
Definition at line 46 of file gpstime.c.
Time difference in seconds between two GPS times.
- Parameters:
-
end | Higher bound of the time interval whose length is calculated. |
beginning | Lower bound of the time interval whose length is calculated. If this describes a time point later than end, the result is negative. |
- Returns:
- The time difference in seconds between `beginning` and `end`.
Definition at line 63 of file gpstime.c.
Normalize a `gps_time_t` GPS time struct. Ensures that the time of week is greater than zero and less than one week by wrapping and adjusting the week number accordingly.
- Parameters:
-
- Returns:
- Normalized GPS time struct.
Definition at line 25 of file gpstime.c.
Variable Documentation