AlteriomPainlessMesh v2.1.1
Easy ESP32/ESP8266 mesh networking with Alteriom IoT extensions
Loading...
Searching...
No Matches
Public Member Functions | List of all members
painlessmesh::rtc::RTCManager Class Reference

#include <rtc.hpp>

Public Member Functions

 RTCManager ()
 
bool enable (RTCInterface *interface)
 
void disable ()
 
bool isEnabled () const
 
uint32_t getTime ()
 
bool syncFromNTP (uint32_t ntpTimestamp)
 
uint32_t getTimeSinceLastSync () const
 
RTCType getType () const
 

Detailed Description

RTC manager class for mesh integration

Handles RTC time synchronization and fallback to mesh time

Constructor & Destructor Documentation

◆ RTCManager()

painlessmesh::rtc::RTCManager::RTCManager ( )
inline

Member Function Documentation

◆ disable()

void painlessmesh::rtc::RTCManager::disable ( )
inline

Disable RTC

◆ enable()

bool painlessmesh::rtc::RTCManager::enable ( RTCInterface *  interface)
inline

Enable RTC with a user-provided interface

Parameters
interfacePointer to RTCInterface implementation
Returns
true if RTC initialized successfully, false otherwise

◆ getTime()

uint32_t painlessmesh::rtc::RTCManager::getTime ( )
inline

Get current time from RTC

Returns
Unix timestamp, or 0 if RTC unavailable

◆ getTimeSinceLastSync()

uint32_t painlessmesh::rtc::RTCManager::getTimeSinceLastSync ( ) const
inline

Get time since last RTC sync

Returns
Milliseconds since last sync, or 0 if never synced

◆ getType()

RTCType painlessmesh::rtc::RTCManager::getType ( ) const
inline

Get RTC type

Returns
RTCType enum, or RTC_NONE if disabled

◆ isEnabled()

bool painlessmesh::rtc::RTCManager::isEnabled ( ) const
inline

Check if RTC is enabled and available

Returns
true if RTC can be used, false otherwise

◆ syncFromNTP()

bool painlessmesh::rtc::RTCManager::syncFromNTP ( uint32_t  ntpTimestamp)
inline

Sync RTC time from NTP/Internet source

Parameters
ntpTimestampUnix timestamp from NTP source
Returns
true if sync successful, false otherwise

The documentation for this class was generated from the following file: