2019-06-12 19:18:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <SoftwareSerial.h>
|
|
|
|
|
|
|
|
#include <TinyGPS++.h>
|
|
|
|
|
|
|
|
#include "settings.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialises the connection to the GPS device.
|
|
|
|
*/
|
|
|
|
void gps_begin();
|
|
|
|
|
|
|
|
/**
|
2019-06-20 12:56:08 +00:00
|
|
|
* Fetches new data from the GPS module.
|
2019-06-12 19:18:37 +00:00
|
|
|
* May take a moment, as the GPS device needs time to acquire a satellite fix.
|
2019-06-20 12:56:08 +00:00
|
|
|
*/
|
|
|
|
void gps_fetch();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetches the latest information from the GPS device.
|
|
|
|
* Call gps_fetch() first.
|
2019-06-12 19:18:37 +00:00
|
|
|
* @return TinyGPSLocation The current location.
|
|
|
|
*/
|
2019-06-20 12:56:08 +00:00
|
|
|
TinyGPSLocation gps_info();
|
2019-06-13 13:13:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ends the connection to the GPS device and puts it to sleep in order to save
|
|
|
|
* power.
|
|
|
|
* Note that the GPS device is connected directly to the power management
|
|
|
|
* system and so doesn't get turned off after each measurement, as it takes
|
|
|
|
* ~30s to reacquire a lock when it first starts up - hence why we put it to
|
|
|
|
* sleep instead.
|
|
|
|
*/
|
|
|
|
void gps_end();
|