ReduxLib C++ 2024.3.2
Loading...
Searching...
No Matches
redux::canand::CanandSettings Class Reference

#include <CanandSettings.h>

Inheritance diagram for redux::canand::CanandSettings:
redux::sensors::canandgyro::CanandgyroSettings redux::sensors::canandmag::CanandmagSettings

Public Member Functions

 CanandSettings ()=default
 
 CanandSettings (CanandSettings &stg)
 
 ~CanandSettings ()=default
 
std::unordered_map< uint8_t, uint64_t > FilteredMap ()
 
bool AllSettingsReceived () const
 
virtual const std::vector< uint8_t > & SettingAddresses () const
 
std::unordered_map< uint8_t, uint64_t > & GetMap ()
 
bool IsEmpty () const
 
bool IsEphemeral () const
 
void SetEphemeral (bool value)
 
std::string ToString ()
 

Protected Attributes

std::unordered_map< uint8_t, uint64_t > values
 
bool ephemeral = false
 

Detailed Description

Base (simple) settings class for Redux devices.

Inheriting classes with more complex firmware interfaces may or may not use this structure. It's typically used in conjunction with CanandSettingsManager.

In general, however, it's a pretty useful structure.

Constructor & Destructor Documentation

◆ CanandSettings() [1/2]

redux::canand::CanandSettings::CanandSettings ( )
default

Default constructor.

◆ CanandSettings() [2/2]

redux::canand::CanandSettings::CanandSettings ( CanandSettings stg)
inline

Copy constructor – only copies over a filtered copy of values.

Parameters
stgreference to another CanandSettings.

◆ ~CanandSettings()

redux::canand::CanandSettings::~CanandSettings ( )
default

Destructor.

Member Function Documentation

◆ AllSettingsReceived()

bool redux::canand::CanandSettings::AllSettingsReceived ( ) const
inline

Returns whether or not all settings fields have been written into the object.

May return false if the a getSettings call did not succeed in fetching every setting.

Returns
whether the settings object has been filled

◆ FilteredMap()

std::unordered_map< uint8_t, uint64_t > redux::canand::CanandSettings::FilteredMap ( )
inline

Return a direct filtered view of settings values as a new unordered_map, limited to only valid settings.

Returns
map

◆ GetMap()

std::unordered_map< uint8_t, uint64_t > & redux::canand::CanandSettings::GetMap ( )
inline

Gets the backing store.

Returns
the underlying map.

◆ IsEmpty()

bool redux::canand::CanandSettings::IsEmpty ( ) const
inline

Returns if this CanandSettings has any set settings or not. Useful when a CanandSettings is returned as a result of setSettings to check if all settings succeeded.

Returns
true if empty

◆ IsEphemeral()

bool redux::canand::CanandSettings::IsEphemeral ( ) const
inline

Returns if this CanandSettings is set to be ephemeral.

Ephemeral settings do not persist on device reboot, but do not impose any flash wear.

Returns
true if ephemeral

◆ SetEphemeral()

void redux::canand::CanandSettings::SetEphemeral ( bool  value)
inline

Sets whether or not the settings will be set as ephemeral – that is, does not persist on device power cycle.

Pre-v2024 firmwares will not support this!

Parameters
valuetrue if ephemeral

◆ SettingAddresses()

virtual const std::vector< uint8_t > & redux::canand::CanandSettings::SettingAddresses ( ) const
inlinevirtual

Gets the array of settings addresses this settings class records.

Returns
DetailsKey array

Reimplemented in redux::sensors::canandgyro::CanandgyroSettings, and redux::sensors::canandmag::CanandmagSettings.

◆ ToString()

std::string redux::canand::CanandSettings::ToString ( )
inline

Dump the CanandSettings map as a string.

Returns
string

Member Data Documentation

◆ ephemeral

bool redux::canand::CanandSettings::ephemeral = false
protected

Whether the settings in this class should be set ephemerally.

◆ values

std::unordered_map<uint8_t, uint64_t> redux::canand::CanandSettings::values
protected

The backing store.


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