|
Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
|
#include <MyPersistentData.h>
Classes | |
| class | SensorData |
Public Member Functions | |
| uint16_t | get_pollingRate () const |
| uint16_t | get_threshold1 () const |
| For the Get functions, used to retrieve the value of the variable. | |
| uint16_t | get_threshold2 () 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 | set_pollingRate (uint16_t value) |
| void | set_threshold1 (uint16_t value) |
| void | set_threshold2 (uint16_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 sensorConfigData & | instance () |
| Gets the singleton instance of this class, allocating it if necessary. | |
Public Attributes | |
| SensorData | sensorData |
Protected Member Functions | |
| sensorConfigData & | operator= (const sensorConfigData &)=delete |
| This class is a singleton and cannot be copied. | |
| sensorConfigData () | |
| The constructor is protected because the class is a singleton. | |
| sensorConfigData (const sensorConfigData &)=delete | |
| This class is a singleton and cannot be copied. | |
| virtual | ~sensorConfigData () |
| The destructor is protected because the class is a singleton and cannot be deleted. | |
Static Protected Attributes | |
| static sensorConfigData * | _instance |
| Singleton instance of this class. | |
| static const uint32_t | SENSOR_DATA_MAGIC = 0x20a47e74 |
| static const uint16_t | SENSOR_DATA_VERSION = 1 |
Definition at line 333 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 354 of file MyPersistentData.cpp.
References persistentDataPathSensor, SENSOR_DATA_MAGIC, SENSOR_DATA_VERSION, and sensorData.
Referenced by instance(), operator=(), and sensorConfigData().
|
protectedvirtual |
The destructor is protected because the class is a singleton and cannot be deleted.
Definition at line 357 of file MyPersistentData.cpp.
|
protecteddelete |
This class is a singleton and cannot be copied.
References sensorConfigData().
| uint16_t sensorConfigData::get_pollingRate | ( | ) | const |
Definition at line 408 of file MyPersistentData.cpp.
| uint16_t sensorConfigData::get_threshold1 | ( | ) | 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 393 of file MyPersistentData.cpp.
| uint16_t sensorConfigData::get_threshold2 | ( | ) | const |
Definition at line 401 of file MyPersistentData.cpp.
| void sensorConfigData::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 384 of file MyPersistentData.cpp.
|
static |
Gets the singleton instance of this class, allocating it if necessary.
Use MyPersistentData::instance() to instantiate the singleton.
Definition at line 347 of file MyPersistentData.cpp.
References _instance, and sensorConfigData().
| void sensorConfigData::loadCurrentDefaults | ( | ) |
Load the appropriate system defaults - good ot initialize a system to "factory settings".
| void sensorConfigData::loop | ( | ) |
Perform application loop operations; call this from global application loop().
You typically use MyPersistentData::instance().loop();
Definition at line 367 of file MyPersistentData.cpp.
References sensorConfig.
|
protecteddelete |
This class is a singleton and cannot be copied.
References sensorConfigData().
| void sensorConfigData::set_pollingRate | ( | uint16_t | value | ) |
Definition at line 412 of file MyPersistentData.cpp.
| void sensorConfigData::set_threshold1 | ( | uint16_t | value | ) |
Definition at line 397 of file MyPersistentData.cpp.
| void sensorConfigData::set_threshold2 | ( | uint16_t | value | ) |
Definition at line 405 of file MyPersistentData.cpp.
| void sensorConfigData::setup | ( | ) |
Perform setup operations; call this from global application setup().
You typically use MyPersistentData::instance().setup();
Definition at line 360 of file MyPersistentData.cpp.
References sensorConfig.
| bool sensorConfigData::validate | ( | size_t | dataSize | ) |
Validates values and, if valid, checks that data is in the correct range.
Definition at line 371 of file MyPersistentData.cpp.
References sensorConfig.
|
staticprotected |
Singleton instance of this class.
The object pointer to this class is stored here. It's NULL at system boot.
Definition at line 455 of file MyPersistentData.h.
Referenced by instance().
|
staticprotected |
Definition at line 458 of file MyPersistentData.h.
Referenced by sensorConfigData().
|
staticprotected |
Definition at line 459 of file MyPersistentData.h.
Referenced by sensorConfigData().
| SensorData sensorConfigData::sensorData |
Definition at line 392 of file MyPersistentData.h.
Referenced by sensorConfigData().