ESPHome 2025.5.0
Loading...
Searching...
No Matches
gps_time.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ARDUINO
4
8
9namespace esphome {
10namespace gps {
11
12class GPSTime : public time::RealTimeClock, public GPSListener {
13 public:
14 void update() override { this->from_tiny_gps_(this->get_tiny_gps()); };
15 void on_update(TinyGPSPlus &tiny_gps) override {
16 if (!this->has_time_)
17 this->from_tiny_gps_(tiny_gps);
18 }
19
20 protected:
21 void from_tiny_gps_(TinyGPSPlus &tiny_gps);
22 bool has_time_{false};
23};
24
25} // namespace gps
26} // namespace esphome
27
28#endif // USE_ARDUINO
TinyGPSPlus & get_tiny_gps()
Definition gps.cpp:11
void from_tiny_gps_(TinyGPSPlus &tiny_gps)
Definition gps_time.cpp:11
void on_update(TinyGPSPlus &tiny_gps) override
Definition gps_time.h:15
void update() override
Definition gps_time.h:14
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7