CCSDS
Public Member Functions | Static Public Member Functions | List of all members
CCSDS::Cltu Class Reference

Class for handling Communications Link Transmission Unit (CLTU) as described in CCSDS 231.0-B-3. More...

#include <ccsds_cltu.h>

Public Member Functions

 Cltu (void *p_StartOfTransmissionContext=NULL, TStartOfTransmissionCallback *p_StartOfTransmissionCallback=NULL, void *p_ReceiveContext=NULL, TReceiveCallback *p_ReceiveCallback=NULL)
 Construct a new Cltu object. More...
 
void setCallbacks (void *p_StartOfTransmissionContext, TStartOfTransmissionCallback *p_StartOfTransmissionCallback, void *p_ReceiveContext, TReceiveCallback *p_ReceiveCallback)
 Overwrites the context pointers and callbacks which were set using the constructor. More...
 
void process (const uint8_t *pu8_Data, const uint16_t u16_DataSize)
 The given upstream data is parsed for a CLTU sequence. More...
 

Static Public Member Functions

static uint32_t create (uint8_t *pu8_Buffer, const uint32_t u32_BufferSize, const uint8_t *pu8_Data, const uint16_t u16_DataSize)
 Creates a sequence of CLTUs, embeds the data to be sent and writes it into the given buffer. More...
 

Detailed Description

Class for handling Communications Link Transmission Unit (CLTU) as described in CCSDS 231.0-B-3.

CLTUs are used to syncronize to the uplink data stream.

On real satellites, CLTUs are usually processed by hardware, and the raw Transfer Frames are handed over to the application which handles the communication between ground and the satellite. With this class, it is possible to detect a start of transmission, to create and unpack CLTUs in software.

Constructor & Destructor Documentation

◆ Cltu()

CCSDS::Cltu::Cltu ( void *  p_StartOfTransmissionContext = NULL,
TStartOfTransmissionCallback *  p_StartOfTransmissionCallback = NULL,
void *  p_ReceiveContext = NULL,
TReceiveCallback *  p_ReceiveCallback = NULL 
)

Construct a new Cltu object.

Parameters
p_StartOfTransmissionContextA pointer to the context which has to be used when a start of transmission is detected
p_StartOfTransmissionCallbackThis callback is called when a start of transmission is detected
p_ReceiveContextA pointer to the context which has to be used when a data block is received
p_ReceiveCallbackThis callback is called when a data block is received

Member Function Documentation

◆ create()

uint32_t CCSDS::Cltu::create ( uint8_t *  pu8_Buffer,
const uint32_t  u32_BufferSize,
const uint8_t *  pu8_Data,
const uint16_t  u16_DataSize 
)
static

Creates a sequence of CLTUs, embeds the data to be sent and writes it into the given buffer.

Parameters
pu8_BufferA pointer to the buffer where the CLTUs shall be stored
u32_BufferSizeThe available size of the buffer
pu8_DataA pointer to the data block which shall be wrapped
u16_DataSizeThe size of the data block
Returns
The size of the CLTU sequence if sucessfull
Return values
0If the buffer size is not sufficient or an other error occured

◆ process()

void CCSDS::Cltu::process ( const uint8_t *  pu8_Data,
const uint16_t  u16_DataSize 
)

The given upstream data is parsed for a CLTU sequence.

The method can handle continuously incoming data as well as complete data blocks. If a CLTU start sequence is found, the callback function p_StartOfTransmissionCallback is called. If a complete and valid CLTU sequence is processed, the callback function p_ReceiveCallback is called.

Parameters
pu8_DataThe data buffer which is to parse
u16_DataSizeThe size of the data buffer

◆ setCallbacks()

void CCSDS::Cltu::setCallbacks ( void *  p_StartOfTransmissionContext,
TStartOfTransmissionCallback *  p_StartOfTransmissionCallback,
void *  p_ReceiveContext,
TReceiveCallback *  p_ReceiveCallback 
)

Overwrites the context pointers and callbacks which were set using the constructor.

Parameters
p_StartOfTransmissionContextA pointer to the context which has to be used when a start of transmission is detected
p_StartOfTransmissionCallbackThis callback is called when a start of transmission is detected
p_ReceiveContextA pointer to the context which has to be used when a data block is received
p_ReceiveCallbackThis callback is called when a data block is received

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