|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <IRtc.h>
Public Member Functions | |
| virtual | ~IRtc ()=default |
| virtual void | getTime (struct tm *timeinfo) const=0 |
| virtual void | getTimeStr (char *buf, size_t bufLen) const=0 |
| virtual void | getDateStr (char *buf, size_t bufLen) const=0 |
| virtual void | setTime (int hour, int minute, int second)=0 |
| virtual void | setDate (int year, int month, int day)=0 |
| virtual void | setTimestamp (time_t timestamp)=0 |
| virtual time_t | getTimestamp () const=0 |
| virtual bool | isTimeSet () const=0 |
| virtual void | markTimeSet ()=0 |
| virtual void | setTimezoneOffset (int8_t hours)=0 |
| virtual int8_t | getTimezoneOffset () const=0 |
| Public Member Functions inherited from cdc::core::IService | |
| virtual | ~IService ()=default |
| virtual bool | init ()=0 |
| virtual bool | start ()=0 |
| virtual void | stop ()=0 |
| virtual ServiceState | getState () const =0 |
| virtual const char * | getName () const =0 |
RTC (Real-Time Clock) Interface
Uses ESP32-S3's internal RTC. Time survives light sleep but NOT deep sleep or power cycles without battery backup.
Reference: ~/GIT/cdc-badge-os-legacy/components/cdc_badge/cdc_rtc.cpp
|
virtualdefault |
|
pure virtual |
Get date as formatted string "YYYY-MM-DD"
|
pure virtual |
Get current time as struct tm
|
pure virtual |
Get Unix timestamp
|
pure virtual |
Get time as formatted string "HH:MM"
|
pure virtual |
Get timezone offset in hours
|
pure virtual |
Check if time has been set (year >= 2024)
|
pure virtual |
Mark time as set (e.g. after NTP sync)
|
pure virtual |
Set date (year, month 1-12, day 1-31)
|
pure virtual |
Set time (hour, minute, second) If date is not set, defaults to 2025-01-01
|
pure virtual |
Set time from Unix timestamp
|
pure virtual |
Set timezone offset in hours from UTC E.g., +1 for CET, +2 for CEST