Skip to content

Commit d9c1034

Browse files
authored
Merge pull request #88 from havencarlson/fix#74
Fix #74, cmd and tlm messages use payload sub-structure
2 parents 408f5de + 8607da2 commit d9c1034

21 files changed

+1280
-1233
lines changed

fsw/inc/cs_msg.h

+58-11
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@
3333
*/
3434

3535
/**
36-
* \brief Housekeeping Packet Structure
36+
* \brief Housekeeping Payload Structure
3737
*/
3838
typedef struct
3939
{
40-
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief cFE SB Tlm Msg Hdr */
41-
4240
uint8 CmdCounter; /**< \brief CS Application Command Counter */
4341
uint8 CmdErrCounter; /**< \brief CS Application Command Error Counter */
4442
uint8 ChecksumState; /**< \brief CS Application global checksum state */
@@ -67,6 +65,15 @@ typedef struct
6765
uint32 LastOneShotMaxBytesPerCycle; /**< \brief Max bytes per cycle for last one shot checksum command */
6866
uint32 LastOneShotChecksum; /**< \brief Checksum of the last one shot checksum command */
6967
uint32 PassCounter; /**< \brief Number of times CS has passed through all of its tables */
68+
} CS_HkPacket_Payload_t;
69+
70+
/**
71+
* \brief Housekeeping Packet Structure
72+
*/
73+
typedef struct
74+
{
75+
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief cFE SB Tlm Msg Hdr */
76+
CS_HkPacket_Payload_t Payload; /**< \brief CS HK Payload */
7077
} CS_HkPacket_t;
7178

7279
/**\}*/
@@ -76,6 +83,49 @@ typedef struct
7683
* \{
7784
*/
7885

86+
/**
87+
* \brief Get entry ID command payload
88+
*/
89+
typedef struct
90+
{
91+
cpuaddr Address; /**< \brief Address to get the ID for */
92+
} CS_GetEntryIDCmd_Payload_t;
93+
94+
/**
95+
* \brief Payload for commands using Memory or EEPROM tables
96+
*/
97+
typedef struct
98+
{
99+
uint32 EntryID; /**< \brief EntryID to perform a command on */
100+
} CS_EntryCmd_Payload_t;
101+
102+
/**
103+
* \brief Payload for commanding by table name
104+
*/
105+
typedef struct
106+
{
107+
char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief Table name to perform a command on */
108+
} CS_TableNameCmd_Payload_t;
109+
110+
/**
111+
* \brief Payload for commanding by app name
112+
*/
113+
typedef struct
114+
{
115+
char Name[OS_MAX_API_NAME]; /**< \brief App name to perform a command on */
116+
} CS_AppNameCmd_Payload_t;
117+
118+
/**
119+
* \brief Payload for sending one shot calculation
120+
*/
121+
typedef struct
122+
{
123+
cpuaddr Address; /**< \brief Address to start checksum */
124+
uint32 Size; /**< \brief Number of bytes to checksum */
125+
uint32 MaxBytesPerCycle; /**< \brief Max Number of bytes to compute per cycle. Value of Zero to use platform config
126+
value */
127+
} CS_OneShotCmd_Payload_t;
128+
79129
/**
80130
* \brief No arguments command data type
81131
*
@@ -98,7 +148,7 @@ typedef struct
98148
typedef struct
99149
{
100150
CFE_MSG_CommandHeader_t CmdHeader;
101-
cpuaddr Address; /**< \brief Address to get the ID for */
151+
CS_GetEntryIDCmd_Payload_t Payload;
102152
} CS_GetEntryIDCmd_t;
103153

104154
/**
@@ -110,7 +160,7 @@ typedef struct
110160
typedef struct
111161
{
112162
CFE_MSG_CommandHeader_t CmdHeader;
113-
uint32 EntryID; /**< \brief EntryID to perform a command on */
163+
CS_EntryCmd_Payload_t Payload;
114164
} CS_EntryCmd_t;
115165

116166
/**
@@ -122,7 +172,7 @@ typedef struct
122172
typedef struct
123173
{
124174
CFE_MSG_CommandHeader_t CmdHeader;
125-
char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief Table name to perform a command on */
175+
CS_TableNameCmd_Payload_t Payload;
126176
} CS_TableNameCmd_t;
127177

128178
/**
@@ -134,7 +184,7 @@ typedef struct
134184
typedef struct
135185
{
136186
CFE_MSG_CommandHeader_t CmdHeader;
137-
char Name[OS_MAX_API_NAME]; /**< \brief App name to perform a command on */
187+
CS_AppNameCmd_Payload_t Payload;
138188
} CS_AppNameCmd_t;
139189

140190
/**
@@ -145,10 +195,7 @@ typedef struct
145195
typedef struct
146196
{
147197
CFE_MSG_CommandHeader_t CmdHeader;
148-
cpuaddr Address; /**< \brief Address to start checksum */
149-
uint32 Size; /**< \brief Number of bytes to checksum */
150-
uint32 MaxBytesPerCycle; /**< \brief Max Number of bytes to compute per cycle. Value of Zero to use platform config
151-
value */
198+
CS_OneShotCmd_Payload_t Payload;
152199
} CS_OneShotCmd_t;
153200

154201
/**\}*/

0 commit comments

Comments
 (0)