Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ersa::test::MockRtc Class Reference

#include <mock_rtc.h>

Inheritance diagram for ersa::test::MockRtc:
Inheritance graph
[legend]
Collaboration diagram for ersa::test::MockRtc:
Collaboration graph
[legend]

Public Member Functions

 MockRtc (uint32_t epoch=1790535111)
 
Result< void > init () override
 
hal::TimePoint now () override
 
Result< void > adjust (const hal::TimePoint &time) override
 
Result< void > setEpoch (uint32_t epochSeconds) override
 
bool isHealthy () const override
 
void advanceSeconds (uint32_t sec)
 
void advanceMinutes (uint32_t min)
 
void setHealthy (bool h)
 
- Public Member Functions inherited from ersa::hal::IRtc
virtual ~IRtc ()=default
 
virtual RtcDiagnostics diagnostics ()
 
virtual void resync ()
 

Private Attributes

uint32_t epoch_ {0}
 
bool healthy_ {true}
 

Constructor & Destructor Documentation

◆ MockRtc()

ersa::test::MockRtc::MockRtc ( uint32_t  epoch = 1790535111)
inlineexplicit

Member Function Documentation

◆ adjust()

Result< void > ersa::test::MockRtc::adjust ( const hal::TimePoint &  time)
inlineoverridevirtual

Write explicit calendar fields and report bus/chip failures.

Implements ersa::hal::IRtc.

◆ advanceMinutes()

void ersa::test::MockRtc::advanceMinutes ( uint32_t  min)
inline

◆ advanceSeconds()

void ersa::test::MockRtc::advanceSeconds ( uint32_t  sec)
inline

◆ init()

Result< void > ersa::test::MockRtc::init ( )
inlineoverridevirtual

Initialize the chip/bus and verify that calendar reads are plausible.

Implements ersa::hal::IRtc.

◆ isHealthy()

bool ersa::test::MockRtc::isHealthy ( ) const
inlineoverridevirtual

Report backend health; this does not guarantee the wall time is accurate.

Implements ersa::hal::IRtc.

◆ now()

hal::TimePoint ersa::test::MockRtc::now ( )
inlineoverridevirtual

Return a calendar snapshot; the implementation may derive epoch fields.

Implements ersa::hal::IRtc.

◆ setEpoch()

Result< void > ersa::test::MockRtc::setEpoch ( uint32_t  epochSeconds)
inlineoverridevirtual

Convert and write epoch seconds without exposing a chip-specific date type.

Implements ersa::hal::IRtc.

◆ setHealthy()

void ersa::test::MockRtc::setHealthy ( bool  h)
inline

Member Data Documentation

◆ epoch_

uint32_t ersa::test::MockRtc::epoch_ {0}
private

◆ healthy_

bool ersa::test::MockRtc::healthy_ {true}
private

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