firmware/src/GPS.h

33 lines
660 B
C
Raw Normal View History

2020-02-06 15:39:21 +00:00
#pragma once
#include <TinyGPS++.h>
#include "PeriodicTask.h"
#include "Observer.h"
/**
* A gps class that only reads from the GPS periodically (and FIXME - eventually keeps the gps powered down except when reading)
*
* When new data is available it will notify observers.
*/
class GPS : public PeriodicTask, public Observable, public TinyGPSPlus
{
public:
GPS();
2020-02-06 16:18:20 +00:00
/// Return time since 1970 in msecs. Until we have a GPS lock we will be returning time based at zero
uint64_t getTime();
String getTimeStr();
2020-02-06 15:39:21 +00:00
void setup();
virtual void loop();
virtual void doTask();
2020-02-19 16:17:28 +00:00
private:
void readFromRTC();
2020-02-06 15:39:21 +00:00
};
extern GPS gps;