0
0

When you use the gen_app_code tool to auto generate an app

a set of hardcoded message IDs are defined in their unique “_msgids.h” header file.

Ex

#define NEWAPP1_CMD_MID 0x18B0
#define NEWAPP1_SEND_HK_MID 0x18B1
#define NEWAPP1_WAKEUP_MID 0x18F0
#define NEWAPP1_OUT_DATA_MID 0x18F1

Do the command messages ids necessarily have to start with 0x18  and the telemetry message ids have to start with 0x08

  • You must to post comments
1
0

Hi @mbenson, I guess your comment is right. Theoretically, CCSDS allows 11 bits for APID (Application Process Identifier), but cFS use only 8 bits. Nevertheless, inside a given process (with a certain APID), typically there are “service sub-type” identifiers. In cFS, they are called “command function code” (only for TC’s). There are 8 bits devoted to the command function code in the cFS TC secondary header.

My guess is that it was implemented this way because typically most missions don’t use more than 20 to 50 APID’s to identify the different processes that exist onboard. And inside each process one can create 2^8 = 256 TC’s.

  • You must to post comments
0
0

Yes they do. The IDs follow the CCSDS packet standard.  The cFE defines the packets structure in cfe\fsw\cfe-core\src\inc\ccsds.h and I’ve pasted it below. As you can see the top nibble’s LSB identifies the packet type and the second nibble identifies whether a secondary header is present.  For the cFS we use a secondary header for both commands and telemetry.

/*—– CCSDS packet primary header. —–*/

typedef struct {

uint8   StreamId[2];  /* packet identifier word (stream ID) */
/*  bits  shift   ———— description —————- */
/* 0x07FF    0  : application ID                            */
/* 0x0800   11  : secondary header: 0 = absent, 1 = present */
/* 0x1000   12  : packet type:      0 = TLM, 1 = CMD        */
/* 0xE000   13  : CCSDS version, always set to 0            */

uint8   Sequence[2];  /* packet sequence word */
/*  bits  shift   ———— description —————- */
/* 0x3FFF    0  : sequence count                            */
/* 0xC000   14  : segmentation flags:  3 = complete packet  */

uint8  Length[2];     /* packet length word */
/*  bits  shift   ———— description —————- */
/* 0xFFFF    0  : (total packet length) – 7                 */

} CCSDS_PriHdr_t;

  • You must to post comments
0
0

Correct me if I’m wrong, but they don’t need to start with 0x08 or 0x18.  The first 5 bits need to be 0b00001 for telemetry and 0b00011 for commands.  So you can use 0x0800/0x1800 to 0x0FFF/0x1FFF with some exceptions due to reserved message IDs.  Using those additional 3 bits lets you use 2047 different message IDs, rather than restricting you to 255.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.