Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
Loading...
Searching...
No Matches
MyPersistentData.cpp File Reference

Persistent Data Storage Implementation. More...

#include "MyPersistentData.h"

Go to the source code of this file.

Functions

bool publishDiagnosticSafe (const char *eventName, const char *data, PublishFlags flags=PRIVATE)
 Publish a state transition to the log handler.

Variables

const char * persistentDataPathCurrent = "/usr/current.dat"
const char * persistentDataPathSensor = "/usr/sensor.dat"
const char * persistentDataPathSystem = "/usr/sysStatus.dat"

Detailed Description

Persistent Data Storage Implementation.

Implements data structures for persistent device configuration, sensor settings, and runtime state using StorageHelperRK. Provides automatic initialization, validation, and efficient read/write operations to EEPROM/retained memory.

Author
Chip McClelland
Date
December 12, 2025

@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.cpp.

Function Documentation

◆ publishDiagnosticSafe()

bool publishDiagnosticSafe ( const char * eventName,
const char * data,
PublishFlags flags )

Publish a state transition to the log handler.

Safely publish diagnostic message through queue with depth guard.

Routes low-priority diagnostic messages through PublishQueuePosix only when queue depth is below threshold, preventing displacement of critical telemetry data during tight loops or error conditions.

Parameters
eventNameThe event name for the publish.
dataThe event data payload.
flagsParticle publish flags (e.g., PRIVATE).
Returns
true if message was queued or published, false if queue was too full.

Definition at line 633 of file Generalized-Core-Counter.cpp.

Variable Documentation

◆ persistentDataPathCurrent

const char* persistentDataPathCurrent = "/usr/current.dat"

Definition at line 423 of file MyPersistentData.cpp.

Referenced by currentStatusData::currentStatusData().

◆ persistentDataPathSensor

const char* persistentDataPathSensor = "/usr/sensor.dat"

Definition at line 342 of file MyPersistentData.cpp.

Referenced by sensorConfigData::sensorConfigData().

◆ persistentDataPathSystem

const char* persistentDataPathSystem = "/usr/sysStatus.dat"

Definition at line 44 of file MyPersistentData.cpp.

Referenced by sysStatusData::sysStatusData().