GNSS interface for time and location.
More...
|
int | FLEX_GNSSFix (int32_t *const Lat, int32_t *const Lon, time_t *const Time) |
|
bool | FLEX_GNSSHasValidFix (void) |
| Returns true if the system has obtained a valid time and location fix.
|
|
void | FLEX_LastLocationAndLastFixTime (int32_t *const LastLatitude, int32_t *const LastLongitude, time_t *const LastFixTime) |
|
time_t | FLEX_TimeGet (void) |
| Get the current epoch time.
|
|
GNSS interface for time and location.
GNSS Location and Time Synchronisation Job
The system in the background schedules a periodic task to synchronise the system location and time, with the GNSS location and time by calling the FLEX_GNSSFix() function. This job runs periodically with increasing intervals until a GNSS fix is obtained once every week. This helps to compensate for system clock drift, but also ensures that there is an accurate location fix. Please also note that when building user applications, enabling the skip_gnss
option in the build will disable this GNSS synchronisation feature and warning messages will be printed on the debug console. During production builds, please validate that the skip_gnss
option is disabled to ensure the correct operation of the FlexSense device. View the section "Building the User Application" for more information regarding the skip_gnss
option.
◆ FLEX_GNSSFix()
int FLEX_GNSSFix |
( |
int32_t *const | Lat, |
|
|
int32_t *const | Lon, |
|
|
time_t *const | Time ) |
Performs a GNSS FIX. On success, it outputs the fixed GNSS latitude, longitude, and time values. It will also update the systems real-time clock and latitude and longitude values.
- Parameters
-
[out] | Lat | the recorded latitude. |
[out] | Lon | the recorded longitude. |
[out] | Time | the recorded fix time. |
- Returns
- FLEX_SUCCESS (0) if succeeded and < 0 if failed.
- Return values
-
-FLEX_ERROR_GNSS | error on GNSS device, failed to read |
-FLEX_ERROR_POWER_OUT | failed to enable power to module |
◆ FLEX_LastLocationAndLastFixTime()
void FLEX_LastLocationAndLastFixTime |
( |
int32_t *const | LastLatitude, |
|
|
int32_t *const | LastLongitude, |
|
|
time_t *const | LastFixTime ) |
Gets the latitude, longitude, and time of the last GNSS fix.
- Parameters
-
[out] | LastLatitude | the last GNSS fixes latitude in degrees multiplied by 1e7. |
[out] | LastLongitude | the last GNSS fixes longitude in degrees multiplied by 1e7. |
[out] | LastFixTime | the time of the last GNSS fix as an epoch time. |