Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
ersa::services::SettingsService Class Referenceabstract

#include <settings_service.h>

Inheritance diagram for ersa::services::SettingsService:
Inheritance graph
[legend]

Public Member Functions

virtual ~SettingsService ()=default
 
virtual Result< void > init ()=0
 
virtual std::string getWifiSsid () const =0
 Return the configured Wi-Fi network name.
 
virtual void setWifiSsid (const std::string &ssid)=0
 
virtual std::string getWifiPass () const =0
 Return the configured Wi-Fi password.
 
virtual void setWifiPass (const std::string &pass)=0
 
virtual int16_t getTimezoneOffsetMin () const =0
 Return the timezone offset in minutes from UTC.
 
virtual void setTimezoneOffsetMin (int16_t offset)=0
 
virtual bool isMilitaryTime () const =0
 Return whether the user selected 24-hour time display.
 
virtual void setMilitaryTime (bool military)=0
 
virtual void save ()=0
 

Static Public Member Functions

static SettingsService & instance ()
 Return the installed process-wide settings service.
 
static void setInstance (SettingsService *instance)
 Install the process-wide settings service.
 

Detailed Description

Typed user preferences exposed independently from persistent storage format.

UI and service code use named settings rather than raw keys so defaults, validation, and future migrations remain centralized in the implementation. Setters update the service's in-memory view; save() is the explicit durable commit boundary for backends that buffer writes.

Constructor & Destructor Documentation

◆ ~SettingsService()

virtual ersa::services::SettingsService::~SettingsService ( )
virtualdefault

Member Function Documentation

◆ getTimezoneOffsetMin()

virtual int16_t ersa::services::SettingsService::getTimezoneOffsetMin ( ) const
pure virtual

Return the timezone offset in minutes from UTC.

Implemented in ersa::services::MemorySettingsService.

◆ getWifiPass()

virtual std::string ersa::services::SettingsService::getWifiPass ( ) const
pure virtual

Return the configured Wi-Fi password.

Implemented in ersa::services::MemorySettingsService.

◆ getWifiSsid()

virtual std::string ersa::services::SettingsService::getWifiSsid ( ) const
pure virtual

Return the configured Wi-Fi network name.

Implemented in ersa::services::MemorySettingsService.

◆ init()

virtual Result< void > ersa::services::SettingsService::init ( )
pure virtual

Load persisted values, validate ranges, and fill absent keys with defaults.

Implemented in ersa::services::MemorySettingsService.

◆ instance()

SettingsService & ersa::services::SettingsService::instance ( )
static

Return the installed process-wide settings service.

◆ isMilitaryTime()

virtual bool ersa::services::SettingsService::isMilitaryTime ( ) const
pure virtual

Return whether the user selected 24-hour time display.

Implemented in ersa::services::MemorySettingsService.

◆ save()

virtual void ersa::services::SettingsService::save ( )
pure virtual

Commit pending setting changes to durable storage.

Implemented in ersa::services::MemorySettingsService.

◆ setInstance()

void ersa::services::SettingsService::setInstance ( SettingsService *  instance)
static

Install the process-wide settings service.

◆ setMilitaryTime()

virtual void ersa::services::SettingsService::setMilitaryTime ( bool  military)
pure virtual

Update the display preference; formatting remains the view's responsibility.

Implemented in ersa::services::MemorySettingsService.

◆ setTimezoneOffsetMin()

virtual void ersa::services::SettingsService::setTimezoneOffsetMin ( int16_t  offset)
pure virtual

Update offset minutes (east positive); persist with save().

Implemented in ersa::services::MemorySettingsService.

◆ setWifiPass()

virtual void ersa::services::SettingsService::setWifiPass ( const std::string &  pass)
pure virtual

Update the pending passphrase; implementations must not log its value.

Implemented in ersa::services::MemorySettingsService.

◆ setWifiSsid()

virtual void ersa::services::SettingsService::setWifiSsid ( const std::string &  ssid)
pure virtual

Update the pending SSID; call save() to persist it.

Implemented in ersa::services::MemorySettingsService.


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