Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
Loading...
Searching...
No Matches
sysStatusData Class Reference

This class is a singleton; you do not create one as a global, on the stack, or with new. More...

#include <MyPersistentData.h>

Inheritance diagram for sysStatusData:

Classes

class  SysData

Public Member Functions

uint8_t get_alertCodeNode () const
time_t get_alertTimestampNode () const
uint8_t get_closeTime () const
uint16_t get_cloudDisconnectBudgetSec () const
uint16_t get_connectAttemptBudgetSec () const
uint16_t get_connectedReportingIntervalSec () const
uint8_t get_countingMode () const
bool get_disconnectedMode () const
time_t get_lastConnection () const
uint16_t get_lastConnectionDuration () const
time_t get_lastDailyCleanup () const
time_t get_lastHookResponse () const
time_t get_lastReport () const
time_t get_lastTimeSync () const
bool get_lowBatteryMode () const
bool get_lowPowerMode () const
uint16_t get_lowPowerReportingIntervalSec () const
uint16_t get_modemOffBudgetSec () const
uint32_t get_occupancyDebounceMs () const
uint8_t get_openTime () const
uint8_t get_operatingMode () const
uint16_t get_reportingInterval () const
uint8_t get_resetCount () const
uint8_t get_sensorType () const
bool get_serialConnected () const
bool get_solarPowerMode () const
uint8_t get_structuresVersion () const
 For the Get functions, used to retrieve the value of the variable.
String get_timeZoneStr () const
bool get_updatesPending () const
bool get_verboseMode () const
void initialize ()
 Will reinitialize data if it is found not to be valid.
void loop ()
 Perform application loop operations; call this from global application loop().
void set_alertCodeNode (uint8_t value)
void set_alertTimestampNode (time_t value)
void set_closeTime (uint8_t value)
void set_cloudDisconnectBudgetSec (uint16_t value)
void set_connectAttemptBudgetSec (uint16_t value)
void set_connectedReportingIntervalSec (uint16_t value)
void set_countingMode (uint8_t value)
void set_disconnectedMode (bool value)
void set_lastConnection (time_t value)
void set_lastConnectionDuration (uint16_t value)
void set_lastDailyCleanup (time_t value)
void set_lastHookResponse (time_t value)
void set_lastReport (time_t value)
void set_lastTimeSync (time_t value)
void set_lowBatteryMode (bool value)
void set_lowPowerMode (bool value)
void set_lowPowerReportingIntervalSec (uint16_t value)
void set_modemOffBudgetSec (uint16_t value)
void set_occupancyDebounceMs (uint32_t value)
void set_openTime (uint8_t value)
void set_operatingMode (uint8_t value)
void set_reportingInterval (uint16_t value)
void set_resetCount (uint8_t value)
void set_sensorType (uint8_t value)
void set_serialConnected (bool value)
void set_solarPowerMode (bool value)
void set_structuresVersion (uint8_t value)
bool set_timeZoneStr (const char *str)
void set_updatesPending (bool value)
void set_verboseMode (bool value)
void setup ()
 Perform setup operations; call this from global application setup().
bool validate (size_t dataSize)
 Validates values and, if valid, checks that data is in the correct range.

Static Public Member Functions

static sysStatusDatainstance ()
 Gets the singleton instance of this class, allocating it if necessary.

Public Attributes

SysData sysData

Protected Member Functions

sysStatusDataoperator= (const sysStatusData &)=delete
 This class is a singleton and cannot be copied.
 sysStatusData ()
 The constructor is protected because the class is a singleton.
 sysStatusData (const sysStatusData &)=delete
 This class is a singleton and cannot be copied.
virtual ~sysStatusData ()
 The destructor is protected because the class is a singleton and cannot be deleted.

Static Protected Attributes

static sysStatusData_instance
 Singleton instance of this class.
static const uint32_t SYS_DATA_MAGIC = 0x20a15e75
static const uint16_t SYS_DATA_VERSION = 3

Detailed Description

This class is a singleton; you do not create one as a global, on the stack, or with new.

From global application setup you must call: MyPersistentData::instance().setup();

From global application loop you must call: MyPersistentData::instance().loop();

Definition at line 91 of file MyPersistentData.h.

Constructor & Destructor Documentation

◆ sysStatusData() [1/2]

sysStatusData::sysStatusData ( )
protected

The constructor is protected because the class is a singleton.

Use MyPersistentData::instance() to instantiate the singleton.

Definition at line 56 of file MyPersistentData.cpp.

References persistentDataPathSystem, SYS_DATA_MAGIC, SYS_DATA_VERSION, and sysData.

Referenced by instance(), operator=(), and sysStatusData().

◆ ~sysStatusData()

sysStatusData::~sysStatusData ( )
protectedvirtual

The destructor is protected because the class is a singleton and cannot be deleted.

Definition at line 60 of file MyPersistentData.cpp.

◆ sysStatusData() [2/2]

sysStatusData::sysStatusData ( const sysStatusData & )
protecteddelete

This class is a singleton and cannot be copied.

References sysStatusData().

Member Function Documentation

◆ get_alertCodeNode()

uint8_t sysStatusData::get_alertCodeNode ( ) const

◆ get_alertTimestampNode()

time_t sysStatusData::get_alertTimestampNode ( ) const

◆ get_closeTime()

uint8_t sysStatusData::get_closeTime ( ) const

Definition at line 194 of file MyPersistentData.cpp.

◆ get_cloudDisconnectBudgetSec()

uint16_t sysStatusData::get_cloudDisconnectBudgetSec ( ) const

Definition at line 322 of file MyPersistentData.cpp.

◆ get_connectAttemptBudgetSec()

uint16_t sysStatusData::get_connectAttemptBudgetSec ( ) const

Definition at line 315 of file MyPersistentData.cpp.

◆ get_connectedReportingIntervalSec()

uint16_t sysStatusData::get_connectedReportingIntervalSec ( ) const

Definition at line 301 of file MyPersistentData.cpp.

◆ get_countingMode()

uint8_t sysStatusData::get_countingMode ( ) const

Definition at line 280 of file MyPersistentData.cpp.

◆ get_disconnectedMode()

bool sysStatusData::get_disconnectedMode ( ) const

Definition at line 250 of file MyPersistentData.cpp.

◆ get_lastConnection()

time_t sysStatusData::get_lastConnection ( ) const

Definition at line 208 of file MyPersistentData.cpp.

◆ get_lastConnectionDuration()

uint16_t sysStatusData::get_lastConnectionDuration ( ) const

Definition at line 215 of file MyPersistentData.cpp.

◆ get_lastDailyCleanup()

time_t sysStatusData::get_lastDailyCleanup ( ) const

Definition at line 264 of file MyPersistentData.cpp.

◆ get_lastHookResponse()

time_t sysStatusData::get_lastHookResponse ( ) const

Definition at line 222 of file MyPersistentData.cpp.

◆ get_lastReport()

time_t sysStatusData::get_lastReport ( ) const

Definition at line 201 of file MyPersistentData.cpp.

◆ get_lastTimeSync()

time_t sysStatusData::get_lastTimeSync ( ) const

Definition at line 271 of file MyPersistentData.cpp.

◆ get_lowBatteryMode()

bool sysStatusData::get_lowBatteryMode ( ) const

Definition at line 163 of file MyPersistentData.cpp.

◆ get_lowPowerMode()

bool sysStatusData::get_lowPowerMode ( ) const

Definition at line 156 of file MyPersistentData.cpp.

◆ get_lowPowerReportingIntervalSec()

uint16_t sysStatusData::get_lowPowerReportingIntervalSec ( ) const

Definition at line 308 of file MyPersistentData.cpp.

◆ get_modemOffBudgetSec()

uint16_t sysStatusData::get_modemOffBudgetSec ( ) const

Definition at line 329 of file MyPersistentData.cpp.

◆ get_occupancyDebounceMs()

uint32_t sysStatusData::get_occupancyDebounceMs ( ) const

Definition at line 294 of file MyPersistentData.cpp.

◆ get_openTime()

uint8_t sysStatusData::get_openTime ( ) const

Definition at line 187 of file MyPersistentData.cpp.

◆ get_operatingMode()

uint8_t sysStatusData::get_operatingMode ( ) const

Definition at line 287 of file MyPersistentData.cpp.

◆ get_reportingInterval()

uint16_t sysStatusData::get_reportingInterval ( ) const

Definition at line 243 of file MyPersistentData.cpp.

◆ get_resetCount()

uint8_t sysStatusData::get_resetCount ( ) const

Definition at line 170 of file MyPersistentData.cpp.

◆ get_sensorType()

uint8_t sysStatusData::get_sensorType ( ) const

Definition at line 229 of file MyPersistentData.cpp.

◆ get_serialConnected()

bool sysStatusData::get_serialConnected ( ) const

Definition at line 257 of file MyPersistentData.cpp.

◆ get_solarPowerMode()

bool sysStatusData::get_solarPowerMode ( ) const

Definition at line 149 of file MyPersistentData.cpp.

◆ get_structuresVersion()

uint8_t sysStatusData::get_structuresVersion ( ) const

For the Get functions, used to retrieve the value of the variable.

Specific to the location in the object and the type of the variable

Parameters
Nothingneeded
Returns
The value of the variable in the corret type

For the Set functions, used to set the value of the variable

Specific to the location in the object and the type of the variable

Parameters
Valueto set the variable - correct type - for Strings they are truncated if too long
Returns
None needed

Definition at line 133 of file MyPersistentData.cpp.

◆ get_timeZoneStr()

String sysStatusData::get_timeZoneStr ( ) const

Definition at line 177 of file MyPersistentData.cpp.

References sysStatusData::SysData::timeZoneStr.

◆ get_updatesPending()

bool sysStatusData::get_updatesPending ( ) const

Definition at line 236 of file MyPersistentData.cpp.

◆ get_verboseMode()

bool sysStatusData::get_verboseMode ( ) const

Definition at line 141 of file MyPersistentData.cpp.

◆ initialize()

void sysStatusData::initialize ( )

Will reinitialize data if it is found not to be valid.

Be careful doing this, because when MyData is extended to add new fields, the initialize method is not called! This is only called when first initialized.

Definition at line 103 of file MyPersistentData.cpp.

References CONNECTED, COUNTING, publishDiagnosticSafe(), and sysStatus.

◆ instance()

sysStatusData & sysStatusData::instance ( )
static

Gets the singleton instance of this class, allocating it if necessary.

Use MyPersistentData::instance() to instantiate the singleton.

Definition at line 49 of file MyPersistentData.cpp.

References _instance, and sysStatusData().

◆ loop()

void sysStatusData::loop ( )

Perform application loop operations; call this from global application loop().

You typically use MyPersistentData::instance().loop();

Definition at line 72 of file MyPersistentData.cpp.

References sysStatus.

◆ operator=()

sysStatusData & sysStatusData::operator= ( const sysStatusData & )
protecteddelete

This class is a singleton and cannot be copied.

References sysStatusData().

◆ set_alertCodeNode()

void sysStatusData::set_alertCodeNode ( uint8_t value)

◆ set_alertTimestampNode()

void sysStatusData::set_alertTimestampNode ( time_t value)

◆ set_closeTime()

void sysStatusData::set_closeTime ( uint8_t value)

Definition at line 197 of file MyPersistentData.cpp.

◆ set_cloudDisconnectBudgetSec()

void sysStatusData::set_cloudDisconnectBudgetSec ( uint16_t value)

Definition at line 325 of file MyPersistentData.cpp.

◆ set_connectAttemptBudgetSec()

void sysStatusData::set_connectAttemptBudgetSec ( uint16_t value)

Definition at line 318 of file MyPersistentData.cpp.

◆ set_connectedReportingIntervalSec()

void sysStatusData::set_connectedReportingIntervalSec ( uint16_t value)

Definition at line 304 of file MyPersistentData.cpp.

◆ set_countingMode()

void sysStatusData::set_countingMode ( uint8_t value)

Definition at line 283 of file MyPersistentData.cpp.

◆ set_disconnectedMode()

void sysStatusData::set_disconnectedMode ( bool value)

Definition at line 253 of file MyPersistentData.cpp.

◆ set_lastConnection()

void sysStatusData::set_lastConnection ( time_t value)

Definition at line 211 of file MyPersistentData.cpp.

◆ set_lastConnectionDuration()

void sysStatusData::set_lastConnectionDuration ( uint16_t value)

Definition at line 218 of file MyPersistentData.cpp.

◆ set_lastDailyCleanup()

void sysStatusData::set_lastDailyCleanup ( time_t value)

Definition at line 267 of file MyPersistentData.cpp.

◆ set_lastHookResponse()

void sysStatusData::set_lastHookResponse ( time_t value)

Definition at line 225 of file MyPersistentData.cpp.

◆ set_lastReport()

void sysStatusData::set_lastReport ( time_t value)

Definition at line 204 of file MyPersistentData.cpp.

◆ set_lastTimeSync()

void sysStatusData::set_lastTimeSync ( time_t value)

Definition at line 274 of file MyPersistentData.cpp.

◆ set_lowBatteryMode()

void sysStatusData::set_lowBatteryMode ( bool value)

Definition at line 166 of file MyPersistentData.cpp.

◆ set_lowPowerMode()

void sysStatusData::set_lowPowerMode ( bool value)

Definition at line 159 of file MyPersistentData.cpp.

◆ set_lowPowerReportingIntervalSec()

void sysStatusData::set_lowPowerReportingIntervalSec ( uint16_t value)

Definition at line 311 of file MyPersistentData.cpp.

◆ set_modemOffBudgetSec()

void sysStatusData::set_modemOffBudgetSec ( uint16_t value)

Definition at line 332 of file MyPersistentData.cpp.

◆ set_occupancyDebounceMs()

void sysStatusData::set_occupancyDebounceMs ( uint32_t value)

Definition at line 297 of file MyPersistentData.cpp.

◆ set_openTime()

void sysStatusData::set_openTime ( uint8_t value)

Definition at line 190 of file MyPersistentData.cpp.

◆ set_operatingMode()

void sysStatusData::set_operatingMode ( uint8_t value)

Definition at line 290 of file MyPersistentData.cpp.

◆ set_reportingInterval()

void sysStatusData::set_reportingInterval ( uint16_t value)

Definition at line 246 of file MyPersistentData.cpp.

◆ set_resetCount()

void sysStatusData::set_resetCount ( uint8_t value)

Definition at line 173 of file MyPersistentData.cpp.

◆ set_sensorType()

void sysStatusData::set_sensorType ( uint8_t value)

Definition at line 232 of file MyPersistentData.cpp.

◆ set_serialConnected()

void sysStatusData::set_serialConnected ( bool value)

Definition at line 260 of file MyPersistentData.cpp.

◆ set_solarPowerMode()

void sysStatusData::set_solarPowerMode ( bool value)

Definition at line 152 of file MyPersistentData.cpp.

◆ set_structuresVersion()

void sysStatusData::set_structuresVersion ( uint8_t value)

Definition at line 137 of file MyPersistentData.cpp.

◆ set_timeZoneStr()

bool sysStatusData::set_timeZoneStr ( const char * str)

Definition at line 183 of file MyPersistentData.cpp.

References sysStatusData::SysData::timeZoneStr.

◆ set_updatesPending()

void sysStatusData::set_updatesPending ( bool value)

Definition at line 239 of file MyPersistentData.cpp.

◆ set_verboseMode()

void sysStatusData::set_verboseMode ( bool value)

Definition at line 145 of file MyPersistentData.cpp.

◆ setup()

void sysStatusData::setup ( )

Perform setup operations; call this from global application setup().

You typically use MyPersistentData::instance().setup();

Definition at line 63 of file MyPersistentData.cpp.

References sysStatus.

◆ validate()

bool sysStatusData::validate ( size_t dataSize)

Validates values and, if valid, checks that data is in the correct range.

Definition at line 76 of file MyPersistentData.cpp.

References sysStatus.

Member Data Documentation

◆ _instance

sysStatusData * sysStatusData::_instance
staticprotected

Singleton instance of this class.

The object pointer to this class is stored here. It's NULL at system boot.

Definition at line 321 of file MyPersistentData.h.

Referenced by instance().

◆ SYS_DATA_MAGIC

const uint32_t sysStatusData::SYS_DATA_MAGIC = 0x20a15e75
staticprotected

Definition at line 324 of file MyPersistentData.h.

Referenced by sysStatusData().

◆ SYS_DATA_VERSION

const uint16_t sysStatusData::SYS_DATA_VERSION = 3
staticprotected

Definition at line 325 of file MyPersistentData.h.

Referenced by sysStatusData().

◆ sysData

SysData sysStatusData::sysData

Definition at line 173 of file MyPersistentData.h.

Referenced by sysStatusData().


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