Myriota Flex SDK 2.5.0
Loading...
Searching...
No Matches
Time and Location

GNSS interface for time and location. More...

Functions

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.
 

Detailed Description

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.

Function Documentation

◆ 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]Latthe recorded latitude.
[out]Lonthe recorded longitude.
[out]Timethe recorded fix time.
Returns
FLEX_SUCCESS (0) if succeeded and < 0 if failed.
Return values
-FLEX_ERROR_GNSSerror on GNSS device, failed to read
-FLEX_ERROR_POWER_OUTfailed 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]LastLatitudethe last GNSS fixes latitude in degrees multiplied by 1e7.
[out]LastLongitudethe last GNSS fixes longitude in degrees multiplied by 1e7.
[out]LastFixTimethe time of the last GNSS fix as an epoch time.