|
Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
|
#include <MyPersistentData.h>
Classes | |
| class | CurrentData |
Public Member Functions | |
| int8_t | get_alertCode () const |
| uint8_t | get_batteryState () const |
| uint16_t | get_dailyCount () const |
| float | get_externalTempC () const |
| uint16_t | get_faceNumber () const |
| For the Get functions, used to retrieve the value of the variable. | |
| uint16_t | get_faceScore () const |
| uint16_t | get_gestureScore () const |
| uint16_t | get_gestureType () const |
| uint16_t | get_hourlyCount () const |
| float | get_internalTempC () const |
| time_t | get_lastAlertTime () const |
| time_t | get_lastCountTime () const |
| uint32_t | get_lastOccupancyEvent () const |
| time_t | get_occupancyStartTime () const |
| bool | get_occupied () const |
| float | get_stateOfCharge () const |
| uint32_t | get_totalOccupiedSeconds () const |
| void | initialize () |
| Will reinitialize data if it is found not to be valid. | |
| void | loadCurrentDefaults () |
| Load the appropriate system defaults - good ot initialize a system to "factory settings". | |
| void | loop () |
| Perform application loop operations; call this from global application loop(). | |
| void | raiseAlert (int8_t value) |
| Raise an alert, keeping the highest severity code when multiple occur. | |
| void | resetEverything () |
| Resets the current and hourly counts. | |
| void | set_alertCode (int8_t value) |
| void | set_batteryState (uint8_t value) |
| void | set_dailyCount (uint16_t value) |
| void | set_externalTempC (float value) |
| void | set_faceNumber (uint16_t value) |
| void | set_faceScore (uint16_t value) |
| void | set_gestureScore (uint16_t value) |
| void | set_gestureType (uint16_t value) |
| void | set_hourlyCount (uint16_t value) |
| void | set_internalTempC (float value) |
| void | set_lastAlertTime (time_t value) |
| void | set_lastCountTime (time_t value) |
| void | set_lastOccupancyEvent (uint32_t value) |
| void | set_occupancyStartTime (time_t value) |
| void | set_occupied (bool value) |
| void | set_stateOfCharge (float value) |
| void | set_totalOccupiedSeconds (uint32_t 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 currentStatusData & | instance () |
| Gets the singleton instance of this class, allocating it if necessary. | |
Public Attributes | |
| CurrentData | currentData |
Protected Member Functions | |
| currentStatusData () | |
| The constructor is protected because the class is a singleton. | |
| currentStatusData (const currentStatusData &)=delete | |
| This class is a singleton and cannot be copied. | |
| currentStatusData & | operator= (const currentStatusData &)=delete |
| This class is a singleton and cannot be copied. | |
| virtual | ~currentStatusData () |
| The destructor is protected because the class is a singleton and cannot be deleted. | |
Static Protected Attributes | |
| static currentStatusData * | _instance |
| Singleton instance of this class. | |
| static const uint32_t | CURRENT_DATA_MAGIC = 0x20a99e74 |
| static const uint16_t | CURRENT_DATA_VERSION = 1 |
Definition at line 467 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 435 of file MyPersistentData.cpp.
References CURRENT_DATA_MAGIC, CURRENT_DATA_VERSION, currentData, and persistentDataPathCurrent.
Referenced by currentStatusData(), instance(), and operator=().
|
protectedvirtual |
The destructor is protected because the class is a singleton and cannot be deleted.
Definition at line 438 of file MyPersistentData.cpp.
|
protecteddelete |
This class is a singleton and cannot be copied.
References currentStatusData().
| int8_t currentStatusData::get_alertCode | ( | ) | const |
Definition at line 548 of file MyPersistentData.cpp.
Referenced by raiseAlert().
| uint8_t currentStatusData::get_batteryState | ( | ) | const |
Definition at line 615 of file MyPersistentData.cpp.
| uint16_t currentStatusData::get_dailyCount | ( | ) | const |
Definition at line 631 of file MyPersistentData.cpp.
| float currentStatusData::get_externalTempC | ( | ) | const |
Definition at line 540 of file MyPersistentData.cpp.
| uint16_t currentStatusData::get_faceNumber | ( | ) | 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 493 of file MyPersistentData.cpp.
| uint16_t currentStatusData::get_faceScore | ( | ) | const |
Definition at line 501 of file MyPersistentData.cpp.
| uint16_t currentStatusData::get_gestureScore | ( | ) | const |
Definition at line 516 of file MyPersistentData.cpp.
| uint16_t currentStatusData::get_gestureType | ( | ) | const |
Definition at line 508 of file MyPersistentData.cpp.
| uint16_t currentStatusData::get_hourlyCount | ( | ) | const |
Definition at line 624 of file MyPersistentData.cpp.
| float currentStatusData::get_internalTempC | ( | ) | const |
Definition at line 532 of file MyPersistentData.cpp.
| time_t currentStatusData::get_lastAlertTime | ( | ) | const |
Definition at line 556 of file MyPersistentData.cpp.
| time_t currentStatusData::get_lastCountTime | ( | ) | const |
Definition at line 524 of file MyPersistentData.cpp.
| uint32_t currentStatusData::get_lastOccupancyEvent | ( | ) | const |
Definition at line 647 of file MyPersistentData.cpp.
| time_t currentStatusData::get_occupancyStartTime | ( | ) | const |
Definition at line 654 of file MyPersistentData.cpp.
| bool currentStatusData::get_occupied | ( | ) | const |
Definition at line 640 of file MyPersistentData.cpp.
| float currentStatusData::get_stateOfCharge | ( | ) | const |
Definition at line 608 of file MyPersistentData.cpp.
| uint32_t currentStatusData::get_totalOccupiedSeconds | ( | ) | const |
Definition at line 661 of file MyPersistentData.cpp.
| void currentStatusData::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 482 of file MyPersistentData.cpp.
References resetEverything().
|
static |
Gets the singleton instance of this class, allocating it if necessary.
Use MyPersistentData::instance() to instantiate the singleton.
Definition at line 428 of file MyPersistentData.cpp.
References _instance, and currentStatusData().
| void currentStatusData::loadCurrentDefaults | ( | ) |
Load the appropriate system defaults - good ot initialize a system to "factory settings".
| void currentStatusData::loop | ( | ) |
Perform application loop operations; call this from global application loop().
You typically use MyPersistentData::instance().loop();
Definition at line 448 of file MyPersistentData.cpp.
References current.
|
protecteddelete |
This class is a singleton and cannot be copied.
References currentStatusData().
| void currentStatusData::raiseAlert | ( | int8_t | value | ) |
Raise an alert, keeping the highest severity code when multiple occur.
If an alert is already set, this helper compares the severity of the existing code to the new one and only overwrites when the new alert is more severe. This prevents a later, less serious warning from masking a prior critical condition.
Definition at line 596 of file MyPersistentData.cpp.
References get_alertCode(), set_alertCode(), and set_lastAlertTime().
| void currentStatusData::resetEverything | ( | ) |
Resets the current and hourly counts.
Definition at line 452 of file MyPersistentData.cpp.
References current, and sysStatus.
Referenced by initialize().
| void currentStatusData::set_alertCode | ( | int8_t | value | ) |
Definition at line 552 of file MyPersistentData.cpp.
Referenced by raiseAlert().
| void currentStatusData::set_batteryState | ( | uint8_t | value | ) |
Definition at line 618 of file MyPersistentData.cpp.
| void currentStatusData::set_dailyCount | ( | uint16_t | value | ) |
Definition at line 634 of file MyPersistentData.cpp.
| void currentStatusData::set_externalTempC | ( | float | value | ) |
Definition at line 544 of file MyPersistentData.cpp.
| void currentStatusData::set_faceNumber | ( | uint16_t | value | ) |
Definition at line 497 of file MyPersistentData.cpp.
| void currentStatusData::set_faceScore | ( | uint16_t | value | ) |
Definition at line 505 of file MyPersistentData.cpp.
| void currentStatusData::set_gestureScore | ( | uint16_t | value | ) |
Definition at line 520 of file MyPersistentData.cpp.
| void currentStatusData::set_gestureType | ( | uint16_t | value | ) |
Definition at line 512 of file MyPersistentData.cpp.
| void currentStatusData::set_hourlyCount | ( | uint16_t | value | ) |
Definition at line 627 of file MyPersistentData.cpp.
| void currentStatusData::set_internalTempC | ( | float | value | ) |
Definition at line 536 of file MyPersistentData.cpp.
| void currentStatusData::set_lastAlertTime | ( | time_t | value | ) |
Definition at line 561 of file MyPersistentData.cpp.
Referenced by raiseAlert().
| void currentStatusData::set_lastCountTime | ( | time_t | value | ) |
Definition at line 528 of file MyPersistentData.cpp.
| void currentStatusData::set_lastOccupancyEvent | ( | uint32_t | value | ) |
Definition at line 650 of file MyPersistentData.cpp.
| void currentStatusData::set_occupancyStartTime | ( | time_t | value | ) |
Definition at line 657 of file MyPersistentData.cpp.
| void currentStatusData::set_occupied | ( | bool | value | ) |
Definition at line 643 of file MyPersistentData.cpp.
| void currentStatusData::set_stateOfCharge | ( | float | value | ) |
Definition at line 611 of file MyPersistentData.cpp.
| void currentStatusData::set_totalOccupiedSeconds | ( | uint32_t | value | ) |
Definition at line 664 of file MyPersistentData.cpp.
| void currentStatusData::setup | ( | ) |
Perform setup operations; call this from global application setup().
You typically use MyPersistentData::instance().setup();
Definition at line 441 of file MyPersistentData.cpp.
References current.
| bool currentStatusData::validate | ( | size_t | dataSize | ) |
Validates values and, if valid, checks that data is in the correct range.
Definition at line 467 of file MyPersistentData.cpp.
References current.
|
staticprotected |
Singleton instance of this class.
The object pointer to this class is stored here. It's NULL at system boot.
Definition at line 670 of file MyPersistentData.h.
Referenced by instance().
|
staticprotected |
Definition at line 673 of file MyPersistentData.h.
Referenced by currentStatusData().
|
staticprotected |
Definition at line 674 of file MyPersistentData.h.
Referenced by currentStatusData().
| CurrentData currentStatusData::currentData |
Definition at line 549 of file MyPersistentData.h.
Referenced by currentStatusData().