Class for handling the telecommands as described in the Packet Utilization Standard (PUS), ECSS-E-70-41A.
More...
#include <pus_tc.h>
|
enum | CcsdsSecHeaderFlag { Custom = 0
, CCSDS = 1
} |
|
enum | Service {
TelecommandVerificationService = 1
, DeviceCommandDistributionService = 2
, HousekeepingAndDiagnosticDataReportingService = 3
, ParameterStatisticsReportingService = 4
,
EventReportingService = 5
, MemoryManagementService = 6
, NotUsed1 = 7
, FunctionManagementService = 8
,
TimeManagementService = 9
, NotUsed2 = 10
, OnboardOperationsSchedulingService = 11
, OnboardMonitoringService = 12
,
LargeDataTransferService = 13
, PacketForwardingControlService = 14
, OnboardStorageAndRetrievalService = 15
, NotUsed3 = 16
,
TestService = 17
, OnboardOperationsProcedureService = 18
, EventActionService = 19
} |
|
typedef void() | TPusTcCallback(void *p_Context, const bool b_AckAcc, const bool b_AckStart, const bool b_AckProg, const bool b_AckComp, const uint8_t u8_Service, const uint8_t u8_SubService, const uint8_t u8_SourceID, const uint8_t *pu8_Data, const uint32_t u32_DataSize) |
|
|
| tc (void *p_Context=NULL, TPusTcCallback *p_PusTcCallback=NULL) |
| Construct a new PUS TC object. More...
|
|
int32_t | process (const uint8_t *pu8_Buffer, const uint32_t u32_BufferSize) |
| The given data is processed. More...
|
|
|
static uint32_t | create (uint8_t *pu8_SecHdrBuffer, const uint32_t u32_SecHdrSize, uint8_t *pu8_PacketDataBuffer, const uint32_t u32_PacketDataSize, const bool b_AckAcc, const bool b_AckStart, const bool b_AckProg, const bool b_AckComp, const uint8_t u8_Service, const uint8_t u8_SubService, const uint8_t u8_SourceID, const uint8_t *pu8_Data, const uint32_t u32_DataSize) |
| Creates a Telecommand and writes it into the given buffer. More...
|
|
static uint16_t | _calcCRC (const uint8_t *pu8_Buffer, const uint16_t u16_BufferSize) |
|
Class for handling the telecommands as described in the Packet Utilization Standard (PUS), ECSS-E-70-41A.
Beside the description of the structure of space packets, the ECSS-E-70-41A also describes the inner structure of telecommand space packets. This class implements this inner struture. It handles the service and the subservice as well as the acknowledges for a command.
◆ tc()
PUS::tc::tc |
( |
void * |
p_Context = NULL , |
|
|
TPusTcCallback * |
p_PusTcCallback = NULL |
|
) |
| |
Construct a new PUS TC object.
- Parameters
-
p_Context | A pointer to the context which has to be used when a command is received |
p_PusTcCallback | This callback is called when a command is received |
◆ create()
uint32_t PUS::tc::create |
( |
uint8_t * |
pu8_SecHdrBuffer, |
|
|
const uint32_t |
u32_SecHdrSize, |
|
|
uint8_t * |
pu8_PacketDataBuffer, |
|
|
const uint32_t |
u32_PacketDataSize, |
|
|
const bool |
b_AckAcc, |
|
|
const bool |
b_AckStart, |
|
|
const bool |
b_AckProg, |
|
|
const bool |
b_AckComp, |
|
|
const uint8_t |
u8_Service, |
|
|
const uint8_t |
u8_SubService, |
|
|
const uint8_t |
u8_SourceID, |
|
|
const uint8_t * |
pu8_Data, |
|
|
const uint32_t |
u32_DataSize |
|
) |
| |
|
static |
Creates a Telecommand and writes it into the given buffer.
- Parameters
-
pu8_SecHdrBuffer | A pointer to the buffer where the header (service, subservice, acknowledge requests) shall be stored |
u32_SecHdrSize | The size of the header buffer (must be at least 6) |
pu8_PacketDataBuffer | A pointer to the buffer where the data (command parameters) shall be stored |
u32_PacketDataSize | The size of the data buffer |
b_AckAcc | Flag if an Acceptence Report is requested |
b_AckStart | Flag if an Execution Start Report is requested |
b_AckProg | Flag if an Execution Progress Report is requested |
b_AckComp | Flag if an Execution Complete Report is requested |
u8_Service | The service ID of the command |
u8_SubService | The Subservice ID of the command |
u8_SourceID | The source ID of the command |
pu8_Data | Command data (parameters) |
u32_DataSize | The size of the command data |
- Return values
-
0 | No packet could be created |
- Returns
- The size of the created data (without header)
◆ process()
int32_t PUS::tc::process |
( |
const uint8_t * |
pu8_Buffer, |
|
|
const uint32_t |
u32_BufferSize |
|
) |
| |
The given data is processed.
The method can only handle complete telecommands. With the extracted information from the data buffer, the function p_PusTcCallback is called.
- Parameters
-
pu8_Buffer | The data buffer which is to extract |
u32_BufferSize | The size of the data buffer |
- Return values
-
0 | If the buffer was extracted successfully |
-1 | If fhe u32_BufferSize is 0 or the pu8_Buffer is NULL |
The documentation for this class was generated from the following files: