Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
IDataSaver Class Referenceabstract

Abstract interface for persisting timestamped data points. More...

#include <DataSaver.h>

Inheritance diagram for IDataSaver:
Inheritance graph
Collaboration diagram for IDataSaver:
Collaboration graph

Public Member Functions

virtual int saveDataPoint (const DataPoint &dp, uint8_t name)=0
 Persist a data point with a source identifier.
virtual int saveDataPoint (float data, uint32_t timestamp_ms, uint8_t name) final
 Convenience overload to construct and save a data point.
virtual bool begin ()
 Optional hook for initialization.
virtual void launchDetected (uint32_t launchTimestamp_ms)
 Notification that launch has been detected.

Detailed Description

Abstract interface for persisting timestamped data points.

Note
When to use: derive from this class to implement a specific persistence backend (e.g., SD card, SPI flash, telemetry).

Definition at line 13 of file DataSaver.h.

Member Function Documentation

◆ begin()

virtual bool IDataSaver::begin ( )
inlinevirtual

Optional hook for initialization.

Note
When to use: override if the saver needs hardware/filesystem setup before use.

Reimplemented in DataSaverBigSD, and DataSaverSPI.

Definition at line 42 of file DataSaver.h.

◆ launchDetected()

virtual void IDataSaver::launchDetected ( uint32_t launchTimestamp_ms)
inlinevirtual

Notification that launch has been detected.

Parameters
launchTimestamp_msTimestamp of launch, in milliseconds.
Note
When to use: override to change write policy once launch is confirmed (e.g., lock buffers or mark critical data).

Reimplemented in DataSaverSPI.

Definition at line 52 of file DataSaver.h.

◆ saveDataPoint() [1/2]

virtual int IDataSaver::saveDataPoint ( const DataPoint & dp,
uint8_t name )
pure virtual

Persist a data point with a source identifier.

Parameters
dpData point to store.
name8-bit identifier (sensor/channel) saved alongside the value.
Note
When to use: primary write path for subclasses; implement in each concrete saver.

Implemented in DataSaverBigSD, DataSaverMock, DataSaverSDSerial, DataSaverSPI, and printSaver.

◆ saveDataPoint() [2/2]

virtual int IDataSaver::saveDataPoint ( float data,
uint32_t timestamp_ms,
uint8_t name )
inlinefinalvirtual

Convenience overload to construct and save a data point.

Parameters
dataMeasurement value.
timestamp_msTimestamp of the measurement in milliseconds.
name8-bit source identifier.
Note
When to use: callers that have raw values but not a DataPoint object.

Reimplemented in DataSaverSDSerial.

Definition at line 33 of file DataSaver.h.


The documentation for this class was generated from the following file: