ClockModule is handling the RTC and keeps it updated over NTP.
More...
#include <ClockModule.h>
ClockModule is handling the RTC and keeps it updated over NTP.
Definition at line 24 of file ClockModule.h.
◆ ClockModule()
| ClockModule::ClockModule |
( |
RtcDS3231< TwoWire > |
_rtc, |
|
|
Timezone |
_localTZ, |
|
|
String |
_ntpServerName |
|
) |
| |
ClockModule is handling the RTC and keeps it updated over NTP.
- Parameters
-
| _rtc | Arduino Wire object |
| _updateInterval | Interval of updating RTC in Seconds |
| _ntpServerName | NTP server address. |
Definition at line 22 of file ClockModule.cpp.
◆ ~ClockModule()
| ClockModule::~ClockModule |
( |
| ) |
|
◆ getLocalSimpleTime()
Get current time from RTC in local time.
With timezone and daylight saving adjustment.
- Returns
- Current Local Time as SimpleTime.
Definition at line 140 of file ClockModule.cpp.
◆ getNtpTime()
| time_t ClockModule::getNtpTime |
( |
| ) |
|
|
private |
Get NTP time from set NTP server over UDP.
- Returns
Definition at line 150 of file ClockModule.cpp.
◆ getUtcTime()
| time_t ClockModule::getUtcTime |
( |
| ) |
|
Get current time from RTC in UTC.
- Returns
- Current Time as time_t in UTC.
Definition at line 132 of file ClockModule.cpp.
◆ isDateTimeValid()
| bool ClockModule::isDateTimeValid |
( |
| ) |
|
Either true if rtc time is not valid or the updateInterval is reached.
- Returns
Definition at line 47 of file ClockModule.cpp.
◆ sendNTPpacket()
| void ClockModule::sendNTPpacket |
( |
IPAddress & |
address | ) |
|
|
private |
Send an NTP request to the time server at the given address.
- Parameters
-
Definition at line 185 of file ClockModule.cpp.
◆ setup()
| void ClockModule::setup |
( |
| ) |
|
◆ update()
| void ClockModule::update |
( |
| ) |
|
Get current time from NTP server and update RTC.
- Returns
- true if updating successful
Definition at line 93 of file ClockModule.cpp.
◆ localPort
| unsigned int ClockModule::localPort = 8888 |
|
private |
◆ localTZ
| Timezone ClockModule::localTZ |
|
private |
◆ NTP_PACKET_SIZE
| const int ClockModule::NTP_PACKET_SIZE = 48 |
|
staticprivate |
◆ ntpServerName
| String ClockModule::ntpServerName |
|
private |
◆ ntpUDP
| WiFiUDP ClockModule::ntpUDP |
|
private |
◆ packetBuffer
◆ rtc
| RtcDS3231<TwoWire> ClockModule::rtc |
|
private |
The documentation for this class was generated from the following files:
- /Users/jolau/Documents/Projekte/QlockTwo_DIY/GIT/esp8266/src/ClockModule.h
- /Users/jolau/Documents/Projekte/QlockTwo_DIY/GIT/esp8266/src/ClockModule.cpp