|
| | Esp32Rtc ()=default |
| bool | init () override |
| | Initializes RTC service and timezone context.
|
| bool | start () override |
| void | stop () override |
| core::ServiceState | getState () const override |
| const char * | getName () const override |
| void | getTime (struct tm *timeinfo) const override |
| | Reads current local time into tm.
|
| void | getTimeStr (char *buf, size_t bufLen) const override |
| | Formats current time as HH:MM.
|
| void | getDateStr (char *buf, size_t bufLen) const override |
| | Formats current date as YYYY-MM-DD.
|
| void | setTime (int hour, int minute, int second) override |
| | Sets RTC time while preserving current date.
|
| void | setDate (int year, int month, int day) override |
| | Sets RTC date while preserving current time.
|
| void | setTimestamp (time_t timestamp) override |
| | Sets RTC from UNIX timestamp.
|
| time_t | getTimestamp () const override |
| | Returns current UNIX timestamp.
|
| bool | isTimeSet () const override |
| void | markTimeSet () override |
| void | setTimezoneOffset (int8_t hours) override |
| | Sets timezone offset and persists it.
|
| int8_t | getTimezoneOffset () const override |
| virtual | ~IRtc ()=default |
| virtual | ~IService ()=default |
Definition at line 32 of file Rtc.cpp.
◆ Esp32Rtc()
| cdc::hal::Esp32Rtc::Esp32Rtc |
( |
| ) |
|
|
default |
◆ getDateStr()
| void cdc::hal::Esp32Rtc::getDateStr |
( |
char * | buf, |
|
|
size_t | bufLen ) const |
|
overridevirtual |
Formats current date as YYYY-MM-DD.
- Parameters
-
| buf | Output character buffer. |
| bufLen | Size of output buffer. |
- Returns
- void
Implements cdc::hal::IRtc.
Definition at line 144 of file Rtc.cpp.
References getTime().
◆ getName()
| const char * cdc::hal::Esp32Rtc::getName |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getState()
◆ getTime()
| void cdc::hal::Esp32Rtc::getTime |
( |
struct tm * | timeinfo | ) |
const |
|
overridevirtual |
◆ getTimestamp()
| time_t cdc::hal::Esp32Rtc::getTimestamp |
( |
| ) |
const |
|
overridevirtual |
Returns current UNIX timestamp.
- Returns
- Current UNIX timestamp.
Implements cdc::hal::IRtc.
Definition at line 232 of file Rtc.cpp.
◆ getTimeStr()
| void cdc::hal::Esp32Rtc::getTimeStr |
( |
char * | buf, |
|
|
size_t | bufLen ) const |
|
overridevirtual |
Formats current time as HH:MM.
- Parameters
-
| buf | Output character buffer. |
| bufLen | Size of output buffer. |
- Returns
- void
Implements cdc::hal::IRtc.
Definition at line 131 of file Rtc.cpp.
References getTime().
◆ getTimezoneOffset()
| int8_t cdc::hal::Esp32Rtc::getTimezoneOffset |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ init()
| bool cdc::hal::Esp32Rtc::init |
( |
| ) |
|
|
overridevirtual |
◆ isTimeSet()
| bool cdc::hal::Esp32Rtc::isTimeSet |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ markTimeSet()
| void cdc::hal::Esp32Rtc::markTimeSet |
( |
| ) |
|
|
inlineoverridevirtual |
◆ setDate()
| void cdc::hal::Esp32Rtc::setDate |
( |
int | year, |
|
|
int | month, |
|
|
int | day ) |
|
overridevirtual |
Sets RTC date while preserving current time.
- Parameters
-
| year | Year value. |
| month | Month value. |
| day | Day value. |
- Returns
- void
Implements cdc::hal::IRtc.
Definition at line 193 of file Rtc.cpp.
References getTime(), LOG_I, and TAG.
◆ setTime()
| void cdc::hal::Esp32Rtc::setTime |
( |
int | hour, |
|
|
int | minute, |
|
|
int | second ) |
|
overridevirtual |
Sets RTC time while preserving current date.
- Parameters
-
| hour | Hour value. |
| minute | Minute value. |
| second | Second value. |
- Returns
- void
Implements cdc::hal::IRtc.
Definition at line 158 of file Rtc.cpp.
References getTime(), LOG_I, LOG_W, and TAG.
◆ setTimestamp()
| void cdc::hal::Esp32Rtc::setTimestamp |
( |
time_t | timestamp | ) |
|
|
overridevirtual |
◆ setTimezoneOffset()
| void cdc::hal::Esp32Rtc::setTimezoneOffset |
( |
int8_t | hours | ) |
|
|
overridevirtual |
◆ start()
| bool cdc::hal::Esp32Rtc::start |
( |
| ) |
|
|
inlineoverridevirtual |
◆ stop()
| void cdc::hal::Esp32Rtc::stop |
( |
| ) |
|
|
inlineoverridevirtual |
The documentation for this class was generated from the following file: