ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
gps_time.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace gps {
9
10class GPSTime : public time::RealTimeClock, public GPSListener {
11 public:
12 void update() override { this->from_tiny_gps_(this->get_tiny_gps()); };
13 void on_update(TinyGPSPlus &tiny_gps) override {
14 if (!this->has_time_) {
15 this->from_tiny_gps_(tiny_gps);
16 }
17 }
18
19 protected:
20 void from_tiny_gps_(TinyGPSPlus &tiny_gps);
21 bool has_time_{false};
22};
23
24} // namespace gps
25} // namespace esphome
TinyGPSPlus & get_tiny_gps()
Definition gps.cpp:9
void from_tiny_gps_(TinyGPSPlus &tiny_gps)
Definition gps_time.cpp:9
void on_update(TinyGPSPlus &tiny_gps) override
Definition gps_time.h:13
void update() override
Definition gps_time.h:12
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