|
Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
|
Persistent Data Storage Structures - EEPROM/Retained Memory Management. More...
#include "Particle.h"#include "StorageHelperRK.h"Go to the source code of this file.
Classes | |
| class | currentStatusData::CurrentData |
| class | currentStatusData |
| class | sensorConfigData |
| class | sensorConfigData::SensorData |
| class | sysStatusData::SysData |
| class | sysStatusData |
| This class is a singleton; you do not create one as a global, on the stack, or with new. More... | |
Macros | |
| #define | current currentStatusData::instance() |
| #define | sensorConfig sensorConfigData::instance() |
| #define | sysStatus sysStatusData::instance() |
Enumerations | |
| enum | CountingMode { COUNTING = 0 , OCCUPANCY = 1 , SCHEDULED = 2 } |
| Counting mode defines how the device processes sensor events. More... | |
| enum | OperatingMode { CONNECTED = 0 , LOW_POWER = 1 , DISCONNECTED = 2 } |
| Operating mode defines power and connectivity behavior. More... | |
Persistent Data Storage Structures - EEPROM/Retained Memory Management.
Defines data structures for device configuration, sensor settings, and runtime state that persist across power cycles and reboots. Uses StorageHelperRK for efficient EEPROM/retained memory operations with automatic validation and versioning.
@license MIT License
Copyright (c) 2025 Chip McClelland
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file MyPersistentData.h.
| #define current currentStatusData::instance() |
Definition at line 41 of file MyPersistentData.h.
Referenced by SensorManager::batteryState(), dailyCleanup(), handleConnectingState(), handleCountingMode(), handleErrorState(), handleIdleState(), handleOccupancyMode(), handleReportingState(), handleSleepingState(), SensorManager::isItSafeToCharge(), currentStatusData::loop(), loop(), publishData(), Cloud::publishDataToLedger(), publishStartupStatus(), currentStatusData::resetEverything(), currentStatusData::setup(), setup(), UbidotsHandler(), updateOccupancyState(), and currentStatusData::validate().
| #define sensorConfig sensorConfigData::instance() |
Definition at line 43 of file MyPersistentData.h.
Referenced by loop(), sensorConfigData::loop(), SensorManager::loop(), sensorConfigData::setup(), setup(), sensorConfigData::validate(), and Cloud::writeDeviceStatusToCloud().
| #define sysStatus sysStatusData::instance() |
Definition at line 42 of file MyPersistentData.h.
Referenced by SensorManager::batteryState(), dailyCleanup(), handleConnectingState(), handleErrorState(), handleIdleState(), handleOccupancyMode(), handleReportingState(), handleSleepingState(), sysStatusData::initialize(), SensorManager::initializeFromConfig(), SensorManager::isItSafeToCharge(), isWithinOpenHours(), loop(), SensorManager::loop(), sysStatusData::loop(), publishData(), Cloud::publishDataToLedger(), currentStatusData::resetEverything(), secondsUntilNextOpen(), sensorISR(), setup(), sysStatusData::setup(), UbidotsHandler(), updateOccupancyState(), sysStatusData::validate(), and Cloud::writeDeviceStatusToCloud().
| enum CountingMode |
Counting mode defines how the device processes sensor events.
COUNTING: Interrupt-driven event counting. OCCUPANCY: Interrupt-driven occupied/unoccupied tracking. SCHEDULED: Non-interrupt, time-based sampling.
| Enumerator | |
|---|---|
| COUNTING | |
| OCCUPANCY | |
| SCHEDULED | |
Definition at line 53 of file MyPersistentData.h.
| enum OperatingMode |
Operating mode defines power and connectivity behavior.
CONNECTED: Device stays connected to cloud, reports frequently. LOW_POWER: Device disconnects between reports to save battery. DISCONNECTED: Device never auto-connects (test / bench mode).
| Enumerator | |
|---|---|
| CONNECTED | |
| LOW_POWER | |
| DISCONNECTED | |
Definition at line 66 of file MyPersistentData.h.