|
Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
|
This class is a singleton; you do not create one as a global, on the stack, or with new. More...
#include <MyPersistentData.h>
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 sysStatusData & | instance () |
| Gets the singleton instance of this class, allocating it if necessary. | |
Public Attributes | |
| SysData | sysData |
Protected Member Functions | |
| sysStatusData & | operator= (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 |
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.
|
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().
|
protectedvirtual |
The destructor is protected because the class is a singleton and cannot be deleted.
Definition at line 60 of file MyPersistentData.cpp.
|
protecteddelete |
This class is a singleton and cannot be copied.
References sysStatusData().
| uint8_t sysStatusData::get_alertCodeNode | ( | ) | const |
| time_t sysStatusData::get_alertTimestampNode | ( | ) | const |
| uint8_t sysStatusData::get_closeTime | ( | ) | const |
Definition at line 194 of file MyPersistentData.cpp.
| uint16_t sysStatusData::get_cloudDisconnectBudgetSec | ( | ) | const |
Definition at line 322 of file MyPersistentData.cpp.
| uint16_t sysStatusData::get_connectAttemptBudgetSec | ( | ) | const |
Definition at line 315 of file MyPersistentData.cpp.
| uint16_t sysStatusData::get_connectedReportingIntervalSec | ( | ) | const |
Definition at line 301 of file MyPersistentData.cpp.
| uint8_t sysStatusData::get_countingMode | ( | ) | const |
Definition at line 280 of file MyPersistentData.cpp.
| bool sysStatusData::get_disconnectedMode | ( | ) | const |
Definition at line 250 of file MyPersistentData.cpp.
| time_t sysStatusData::get_lastConnection | ( | ) | const |
Definition at line 208 of file MyPersistentData.cpp.
| uint16_t sysStatusData::get_lastConnectionDuration | ( | ) | const |
Definition at line 215 of file MyPersistentData.cpp.
| time_t sysStatusData::get_lastDailyCleanup | ( | ) | const |
Definition at line 264 of file MyPersistentData.cpp.
| time_t sysStatusData::get_lastHookResponse | ( | ) | const |
Definition at line 222 of file MyPersistentData.cpp.
| time_t sysStatusData::get_lastReport | ( | ) | const |
Definition at line 201 of file MyPersistentData.cpp.
| time_t sysStatusData::get_lastTimeSync | ( | ) | const |
Definition at line 271 of file MyPersistentData.cpp.
| bool sysStatusData::get_lowBatteryMode | ( | ) | const |
Definition at line 163 of file MyPersistentData.cpp.
| bool sysStatusData::get_lowPowerMode | ( | ) | const |
Definition at line 156 of file MyPersistentData.cpp.
| uint16_t sysStatusData::get_lowPowerReportingIntervalSec | ( | ) | const |
Definition at line 308 of file MyPersistentData.cpp.
| uint16_t sysStatusData::get_modemOffBudgetSec | ( | ) | const |
Definition at line 329 of file MyPersistentData.cpp.
| uint32_t sysStatusData::get_occupancyDebounceMs | ( | ) | const |
Definition at line 294 of file MyPersistentData.cpp.
| uint8_t sysStatusData::get_openTime | ( | ) | const |
Definition at line 187 of file MyPersistentData.cpp.
| uint8_t sysStatusData::get_operatingMode | ( | ) | const |
Definition at line 287 of file MyPersistentData.cpp.
| uint16_t sysStatusData::get_reportingInterval | ( | ) | const |
Definition at line 243 of file MyPersistentData.cpp.
| uint8_t sysStatusData::get_resetCount | ( | ) | const |
Definition at line 170 of file MyPersistentData.cpp.
| uint8_t sysStatusData::get_sensorType | ( | ) | const |
Definition at line 229 of file MyPersistentData.cpp.
| bool sysStatusData::get_serialConnected | ( | ) | const |
Definition at line 257 of file MyPersistentData.cpp.
| bool sysStatusData::get_solarPowerMode | ( | ) | const |
Definition at line 149 of file MyPersistentData.cpp.
| 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
| Nothing | needed |
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
| Value | to set the variable - correct type - for Strings they are truncated if too long |
Definition at line 133 of file MyPersistentData.cpp.
| String sysStatusData::get_timeZoneStr | ( | ) | const |
Definition at line 177 of file MyPersistentData.cpp.
References sysStatusData::SysData::timeZoneStr.
| bool sysStatusData::get_updatesPending | ( | ) | const |
Definition at line 236 of file MyPersistentData.cpp.
| bool sysStatusData::get_verboseMode | ( | ) | const |
Definition at line 141 of file MyPersistentData.cpp.
| 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.
|
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().
| 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.
|
protecteddelete |
This class is a singleton and cannot be copied.
References sysStatusData().
| void sysStatusData::set_alertCodeNode | ( | uint8_t | value | ) |
| void sysStatusData::set_alertTimestampNode | ( | time_t | value | ) |
| void sysStatusData::set_closeTime | ( | uint8_t | value | ) |
Definition at line 197 of file MyPersistentData.cpp.
| void sysStatusData::set_cloudDisconnectBudgetSec | ( | uint16_t | value | ) |
Definition at line 325 of file MyPersistentData.cpp.
| void sysStatusData::set_connectAttemptBudgetSec | ( | uint16_t | value | ) |
Definition at line 318 of file MyPersistentData.cpp.
| void sysStatusData::set_connectedReportingIntervalSec | ( | uint16_t | value | ) |
Definition at line 304 of file MyPersistentData.cpp.
| void sysStatusData::set_countingMode | ( | uint8_t | value | ) |
Definition at line 283 of file MyPersistentData.cpp.
| void sysStatusData::set_disconnectedMode | ( | bool | value | ) |
Definition at line 253 of file MyPersistentData.cpp.
| void sysStatusData::set_lastConnection | ( | time_t | value | ) |
Definition at line 211 of file MyPersistentData.cpp.
| void sysStatusData::set_lastConnectionDuration | ( | uint16_t | value | ) |
Definition at line 218 of file MyPersistentData.cpp.
| void sysStatusData::set_lastDailyCleanup | ( | time_t | value | ) |
Definition at line 267 of file MyPersistentData.cpp.
| void sysStatusData::set_lastHookResponse | ( | time_t | value | ) |
Definition at line 225 of file MyPersistentData.cpp.
| void sysStatusData::set_lastReport | ( | time_t | value | ) |
Definition at line 204 of file MyPersistentData.cpp.
| void sysStatusData::set_lastTimeSync | ( | time_t | value | ) |
Definition at line 274 of file MyPersistentData.cpp.
| void sysStatusData::set_lowBatteryMode | ( | bool | value | ) |
Definition at line 166 of file MyPersistentData.cpp.
| void sysStatusData::set_lowPowerMode | ( | bool | value | ) |
Definition at line 159 of file MyPersistentData.cpp.
| void sysStatusData::set_lowPowerReportingIntervalSec | ( | uint16_t | value | ) |
Definition at line 311 of file MyPersistentData.cpp.
| void sysStatusData::set_modemOffBudgetSec | ( | uint16_t | value | ) |
Definition at line 332 of file MyPersistentData.cpp.
| void sysStatusData::set_occupancyDebounceMs | ( | uint32_t | value | ) |
Definition at line 297 of file MyPersistentData.cpp.
| void sysStatusData::set_openTime | ( | uint8_t | value | ) |
Definition at line 190 of file MyPersistentData.cpp.
| void sysStatusData::set_operatingMode | ( | uint8_t | value | ) |
Definition at line 290 of file MyPersistentData.cpp.
| void sysStatusData::set_reportingInterval | ( | uint16_t | value | ) |
Definition at line 246 of file MyPersistentData.cpp.
| void sysStatusData::set_resetCount | ( | uint8_t | value | ) |
Definition at line 173 of file MyPersistentData.cpp.
| void sysStatusData::set_sensorType | ( | uint8_t | value | ) |
Definition at line 232 of file MyPersistentData.cpp.
| void sysStatusData::set_serialConnected | ( | bool | value | ) |
Definition at line 260 of file MyPersistentData.cpp.
| void sysStatusData::set_solarPowerMode | ( | bool | value | ) |
Definition at line 152 of file MyPersistentData.cpp.
| void sysStatusData::set_structuresVersion | ( | uint8_t | value | ) |
Definition at line 137 of file MyPersistentData.cpp.
| bool sysStatusData::set_timeZoneStr | ( | const char * | str | ) |
Definition at line 183 of file MyPersistentData.cpp.
References sysStatusData::SysData::timeZoneStr.
| void sysStatusData::set_updatesPending | ( | bool | value | ) |
Definition at line 239 of file MyPersistentData.cpp.
| void sysStatusData::set_verboseMode | ( | bool | value | ) |
Definition at line 145 of file MyPersistentData.cpp.
| 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.
| 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.
|
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().
|
staticprotected |
Definition at line 324 of file MyPersistentData.h.
Referenced by sysStatusData().
|
staticprotected |
Definition at line 325 of file MyPersistentData.h.
Referenced by sysStatusData().
| SysData sysStatusData::sysData |
Definition at line 173 of file MyPersistentData.h.
Referenced by sysStatusData().