Skip to content

File syn_datalog.c

FileList > log > syn_datalog.c

Go to the source code of this file

  • #include "../util/syn_assert.h"
  • #include "syn_datalog.h"

Public Functions

Type Name
void syn_datalog_init (SYN_DataLog * log, uint8_t * buf, size_t size)
Initialize a datalogger.
size_t syn_datalog_read (SYN_DataLog * log, uint16_t * out_id, void * out_data, size_t max_len)
Read the next telemetry frame from the logger.
bool syn_datalog_write (SYN_DataLog * log, uint16_t id, const void * data, uint16_t len)
Write a telemetry frame to the logger.

Public Functions Documentation

function syn_datalog_init

Initialize a datalogger.

void syn_datalog_init (
    SYN_DataLog * log,
    uint8_t * buf,
    size_t size
) 

Parameters:

  • log Pointer to logger instance.
  • buf Caller-provided backing array.
  • size Size of backing array in bytes.

function syn_datalog_read

Read the next telemetry frame from the logger.

size_t syn_datalog_read (
    SYN_DataLog * log,
    uint16_t * out_id,
    void * out_data,
    size_t max_len
) 

Parameters:

  • log Pointer to logger instance.
  • out_id [out] Stream ID of read frame.
  • out_data [out] Buffer to store payload.
  • max_len Maximum size of out_data.

Returns:

Number of payload bytes read, or 0 if empty or buffer too small.


function syn_datalog_write

Write a telemetry frame to the logger.

bool syn_datalog_write (
    SYN_DataLog * log,
    uint16_t id,
    const void * data,
    uint16_t len
) 

Parameters:

  • log Pointer to logger instance.
  • id Stream ID.
  • data Payload to write.
  • len Payload size in bytes.

Returns:

true if written, false if buffer is full (frame dropped).



The documentation for this class was generated from the following file src/syntropic/log/syn_datalog.c