Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
DataSaverSDSerial Class Reference

IDataSaver implementation that streams CSV packets over UART. More...

#include <DataSaverSDSerial.h>

Inheritance diagram for DataSaverSDSerial:
Inheritance graph
Collaboration diagram for DataSaverSDSerial:
Collaboration graph

Public Member Functions

 DataSaverSDSerial (HardwareSerial &SD_serial)
 Create a saver that streams CSV over UART to an external data logger.
virtual int saveDataPoint (const DataPoint &dataPoint, uint8_t name) override
 Write a timestamped value to the serial logger.
virtual int saveDataPoint (float data, uint32_t timestamp_ms, uint8_t name) final
 Convenience overload to construct and save a data point.
Public Member Functions inherited from IDataSaver
virtual bool begin ()
 Optional hook for initialization.
virtual void launchDetected (uint32_t launchTimestamp_ms)
 Notification that launch has been detected.

Detailed Description

IDataSaver implementation that streams CSV packets over UART.

Note
When to use: log data to an external serial data logger when file systems (SD/SPI flash) are unavailable or you need live passthrough.

Definition at line 16 of file DataSaverSDSerial.h.

Constructor & Destructor Documentation

◆ DataSaverSDSerial()

DataSaverSDSerial::DataSaverSDSerial ( HardwareSerial & SD_serial)

Create a saver that streams CSV over UART to an external data logger.

Parameters
SD_serialHardware serial interface connected to the logger.
Note
When to use: quick logging to a serial-equipped recorder when file systems are unavailable.

Definition at line 28 of file DataSaverSDSerial.cpp.

Member Function Documentation

◆ saveDataPoint() [1/2]

int DataSaverSDSerial::saveDataPoint ( const DataPoint & dataPoint,
uint8_t name )
overridevirtual

Write a timestamped value to the serial logger.

Parameters
dataPointData point to transmit.
name8-bit channel identifier transmitted alongside data.
Note
When to use: continuous logging after the external logger is ready.

Implements IDataSaver.

Definition at line 32 of file DataSaverSDSerial.cpp.

◆ 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 from IDataSaver.

Definition at line 33 of file DataSaver.h.


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