This example, at fixed intervals, will attempt to acquire a GNSS fix to retrieve the current location and time, and print it on the debug console.
#include <stdio.h>
#include "flex.h"
#define APPLICATION_NAME "GNSS Example"
#define GNSS_FIX_INTERVAL_HOURS 6
static time_t LocationAndTime(void) {
time_t time;
int32_t lat, lon;
printf("Failed to get a valid GNSS sync!\n");
} else {
printf("Lat: %f, Lon: %f, Time: %u.\n", lat * 1e-7, lon * 1e-7, (unsigned int)time);
}
}
void FLEX_AppInit() {
printf("%s\n", APPLICATION_NAME);
}