CCSDS
|
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... | |
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.
CCSDS::Cltu::Cltu | ( | void * | p_StartOfTransmissionContext = NULL , |
TStartOfTransmissionCallback * | p_StartOfTransmissionCallback = NULL , |
||
void * | p_ReceiveContext = NULL , |
||
TReceiveCallback * | p_ReceiveCallback = NULL |
||
) |
Construct a new Cltu object.
p_StartOfTransmissionContext | A pointer to the context which has to be used when a start of transmission is detected |
p_StartOfTransmissionCallback | This callback is called when a start of transmission is detected |
p_ReceiveContext | A pointer to the context which has to be used when a data block is received |
p_ReceiveCallback | This callback is called when a data block is received |
|
static |
Creates a sequence of CLTUs, embeds the data to be sent and writes it into the given buffer.
pu8_Buffer | A pointer to the buffer where the CLTUs shall be stored |
u32_BufferSize | The available size of the buffer |
pu8_Data | A pointer to the data block which shall be wrapped |
u16_DataSize | The size of the data block |
0 | If the buffer size is not sufficient or an other error occured |
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.
pu8_Data | The data buffer which is to parse |
u16_DataSize | The size of the data buffer |
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.
p_StartOfTransmissionContext | A pointer to the context which has to be used when a start of transmission is detected |
p_StartOfTransmissionCallback | This callback is called when a start of transmission is detected |
p_ReceiveContext | A pointer to the context which has to be used when a data block is received |
p_ReceiveCallback | This callback is called when a data block is received |