Skip to content

Commit c656998

Browse files
authored
Merge pull request #244 from nasa/v7.0.1-integration
Part cFS/Documents#11, Merge Internal Updates
2 parents 068f756 + 0325fda commit c656998

16 files changed

+115
-70
lines changed

config/default_sample_app_msgdefs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ typedef struct SAMPLE_APP_HkTlm_Payload
4343
{
4444
uint8 CommandCounter;
4545
uint8 CommandErrorCounter;
46-
uint8 spare[2];
4746
} SAMPLE_APP_HkTlm_Payload_t;
4847

4948
#endif

fsw/src/sample_app.c

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ void SAMPLE_APP_Main(void)
8787
}
8888
else
8989
{
90-
CFE_EVS_SendEvent(SAMPLE_APP_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
90+
CFE_EVS_SendEvent(SAMPLE_APP_PIPE_ERR_EID,
91+
CFE_EVS_EventType_ERROR,
9192
"SAMPLE APP: SB Pipe Read Error, App Will Exit");
9293

9394
SAMPLE_APP_Data.RunStatus = CFE_ES_RunStatus_APP_ERROR;
@@ -130,18 +131,22 @@ CFE_Status_t SAMPLE_APP_Init(void)
130131
/*
131132
** Initialize housekeeping packet (clear user data area).
132133
*/
133-
CFE_MSG_Init(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader), CFE_SB_ValueToMsgId(SAMPLE_APP_HK_TLM_MID),
134+
CFE_MSG_Init(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader),
135+
CFE_SB_ValueToMsgId(SAMPLE_APP_HK_TLM_MID),
134136
sizeof(SAMPLE_APP_Data.HkTlm));
135137

136138
/*
137139
** Create Software Bus message pipe.
138140
*/
139-
status = CFE_SB_CreatePipe(&SAMPLE_APP_Data.CommandPipe, SAMPLE_APP_PLATFORM_PIPE_DEPTH,
141+
status = CFE_SB_CreatePipe(&SAMPLE_APP_Data.CommandPipe,
142+
SAMPLE_APP_PLATFORM_PIPE_DEPTH,
140143
SAMPLE_APP_PLATFORM_PIPE_NAME);
141144
if (status != CFE_SUCCESS)
142145
{
143-
CFE_EVS_SendEvent(SAMPLE_APP_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
144-
"Sample App: Error creating SB Command Pipe, RC = 0x%08lX", (unsigned long)status);
146+
CFE_EVS_SendEvent(SAMPLE_APP_CR_PIPE_ERR_EID,
147+
CFE_EVS_EventType_ERROR,
148+
"Sample App: Error creating SB Command Pipe, RC = 0x%08lX",
149+
(unsigned long)status);
145150
}
146151
}
147152

@@ -153,8 +158,10 @@ CFE_Status_t SAMPLE_APP_Init(void)
153158
status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_SEND_HK_MID), SAMPLE_APP_Data.CommandPipe);
154159
if (status != CFE_SUCCESS)
155160
{
156-
CFE_EVS_SendEvent(SAMPLE_APP_SUB_HK_ERR_EID, CFE_EVS_EventType_ERROR,
157-
"Sample App: Error Subscribing to HK request, RC = 0x%08lX", (unsigned long)status);
161+
CFE_EVS_SendEvent(SAMPLE_APP_SUB_HK_ERR_EID,
162+
CFE_EVS_EventType_ERROR,
163+
"Sample App: Error Subscribing to HK request, RC = 0x%08lX",
164+
(unsigned long)status);
158165
}
159166
}
160167

@@ -166,8 +173,10 @@ CFE_Status_t SAMPLE_APP_Init(void)
166173
status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_CMD_MID), SAMPLE_APP_Data.CommandPipe);
167174
if (status != CFE_SUCCESS)
168175
{
169-
CFE_EVS_SendEvent(SAMPLE_APP_SUB_CMD_ERR_EID, CFE_EVS_EventType_ERROR,
170-
"Sample App: Error Subscribing to Commands, RC = 0x%08lX", (unsigned long)status);
176+
CFE_EVS_SendEvent(SAMPLE_APP_SUB_CMD_ERR_EID,
177+
CFE_EVS_EventType_ERROR,
178+
"Sample App: Error Subscribing to Commands, RC = 0x%08lX",
179+
(unsigned long)status);
171180
}
172181
}
173182

@@ -176,22 +185,33 @@ CFE_Status_t SAMPLE_APP_Init(void)
176185
/*
177186
** Register Example Table(s)
178187
*/
179-
status = CFE_TBL_Register(&SAMPLE_APP_Data.TblHandles[0], "ExampleTable", sizeof(SAMPLE_APP_ExampleTable_t),
180-
CFE_TBL_OPT_DEFAULT, SAMPLE_APP_TblValidationFunc);
188+
status = CFE_TBL_Register(&SAMPLE_APP_Data.TblHandles[0],
189+
"ExampleTable",
190+
sizeof(SAMPLE_APP_ExampleTable_t),
191+
CFE_TBL_OPT_DEFAULT,
192+
SAMPLE_APP_TblValidationFunc);
181193
if (status != CFE_SUCCESS)
182194
{
183-
CFE_EVS_SendEvent(SAMPLE_APP_TABLE_REG_ERR_EID, CFE_EVS_EventType_ERROR,
184-
"Sample App: Error Registering Example Table, RC = 0x%08lX", (unsigned long)status);
195+
CFE_EVS_SendEvent(SAMPLE_APP_TABLE_REG_ERR_EID,
196+
CFE_EVS_EventType_ERROR,
197+
"Sample App: Error Registering Example Table, RC = 0x%08lX",
198+
(unsigned long)status);
185199
}
186200
else
187201
{
188202
status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_PLATFORM_TABLE_FILE);
189203
}
190204

191-
CFE_Config_GetVersionString(VersionString, SAMPLE_APP_CFG_MAX_VERSION_STR_LEN, "Sample App", SAMPLE_APP_VERSION,
192-
SAMPLE_APP_BUILD_CODENAME, SAMPLE_APP_LAST_OFFICIAL);
205+
CFE_Config_GetVersionString(VersionString,
206+
SAMPLE_APP_CFG_MAX_VERSION_STR_LEN,
207+
"Sample App",
208+
SAMPLE_APP_VERSION,
209+
SAMPLE_APP_BUILD_CODENAME,
210+
SAMPLE_APP_LAST_OFFICIAL);
193211

194-
CFE_EVS_SendEvent(SAMPLE_APP_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "Sample App Initialized.%s",
212+
CFE_EVS_SendEvent(SAMPLE_APP_INIT_INF_EID,
213+
CFE_EVS_EventType_INFORMATION,
214+
"Sample App Initialized.%s",
195215
VersionString);
196216
}
197217

fsw/src/sample_app.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ typedef struct
5050
/*
5151
** Command interface counters...
5252
*/
53-
uint8 CmdCounter;
54-
uint8 ErrCounter;
53+
uint8 CommandCounter;
54+
uint8 CommandErrorCounter;
5555

5656
/*
5757
** Housekeeping telemetry packet...

fsw/src/sample_app_cmds.c

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ CFE_Status_t SAMPLE_APP_SendHkCmd(const SAMPLE_APP_SendHkCmd_t *Msg)
5151
/*
5252
** Get command execution counters...
5353
*/
54-
SAMPLE_APP_Data.HkTlm.Payload.CommandErrorCounter = SAMPLE_APP_Data.ErrCounter;
55-
SAMPLE_APP_Data.HkTlm.Payload.CommandCounter = SAMPLE_APP_Data.CmdCounter;
54+
SAMPLE_APP_Data.HkTlm.Payload.CommandErrorCounter = SAMPLE_APP_Data.CommandErrorCounter;
55+
SAMPLE_APP_Data.HkTlm.Payload.CommandCounter = SAMPLE_APP_Data.CommandCounter;
5656

5757
/*
5858
** Send housekeeping telemetry packet...
@@ -78,9 +78,11 @@ CFE_Status_t SAMPLE_APP_SendHkCmd(const SAMPLE_APP_SendHkCmd_t *Msg)
7878
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
7979
CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg)
8080
{
81-
SAMPLE_APP_Data.CmdCounter++;
81+
SAMPLE_APP_Data.CommandCounter++;
8282

83-
CFE_EVS_SendEvent(SAMPLE_APP_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE: NOOP command %s",
83+
CFE_EVS_SendEvent(SAMPLE_APP_NOOP_INF_EID,
84+
CFE_EVS_EventType_INFORMATION,
85+
"SAMPLE: NOOP command %s",
8486
SAMPLE_APP_VERSION);
8587

8688
return CFE_SUCCESS;
@@ -95,8 +97,8 @@ CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg)
9597
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
9698
CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Msg)
9799
{
98-
SAMPLE_APP_Data.CmdCounter = 0;
99-
SAMPLE_APP_Data.ErrCounter = 0;
100+
SAMPLE_APP_Data.CommandCounter = 0;
101+
SAMPLE_APP_Data.CommandErrorCounter = 0;
100102

101103
CFE_EVS_SendEvent(SAMPLE_APP_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE: RESET command");
102104

@@ -112,12 +114,12 @@ CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Ms
112114
CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg)
113115
{
114116
CFE_Status_t Status;
115-
void * TblAddr;
117+
void *TblAddr;
116118
SAMPLE_APP_ExampleTable_t *TblPtr;
117-
const char * TableName = "SAMPLE_APP.ExampleTable";
119+
const char *TableName = "SAMPLE_APP.ExampleTable";
118120

119121
/* Sample Use of Example Table */
120-
SAMPLE_APP_Data.CmdCounter++;
122+
SAMPLE_APP_Data.CommandCounter++;
121123
Status = CFE_TBL_GetAddress(&TblAddr, SAMPLE_APP_Data.TblHandles[0]);
122124
if (Status < CFE_SUCCESS)
123125
{
@@ -152,10 +154,13 @@ CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg)
152154
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
153155
CFE_Status_t SAMPLE_APP_DisplayParamCmd(const SAMPLE_APP_DisplayParamCmd_t *Msg)
154156
{
155-
SAMPLE_APP_Data.CmdCounter++;
156-
CFE_EVS_SendEvent(SAMPLE_APP_VALUE_INF_EID, CFE_EVS_EventType_INFORMATION,
157-
"SAMPLE_APP: ValU32=%lu, ValI16=%d, ValStr=%s", (unsigned long)Msg->Payload.ValU32,
158-
(int)Msg->Payload.ValI16, Msg->Payload.ValStr);
157+
SAMPLE_APP_Data.CommandCounter++;
158+
CFE_EVS_SendEvent(SAMPLE_APP_VALUE_INF_EID,
159+
CFE_EVS_EventType_INFORMATION,
160+
"SAMPLE_APP: ValU32=%lu, ValI16=%d, ValStr=%s",
161+
(unsigned long)Msg->Payload.ValU32,
162+
(int)Msg->Payload.ValI16,
163+
Msg->Payload.ValStr);
159164

160165
return CFE_SUCCESS;
161166
}

fsw/src/sample_app_cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
#include "sample_app_msg.h"
3232

3333
CFE_Status_t SAMPLE_APP_SendHkCmd(const SAMPLE_APP_SendHkCmd_t *Msg);
34+
CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg);
3435
CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Msg);
3536
CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg);
36-
CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg);
3737
CFE_Status_t SAMPLE_APP_DisplayParamCmd(const SAMPLE_APP_DisplayParamCmd_t *Msg);
3838

3939
#endif /* SAMPLE_APP_CMDS_H */

fsw/src/sample_app_dispatch.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ bool SAMPLE_APP_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t Expected
5353
CFE_MSG_GetMsgId(MsgPtr, &MsgId);
5454
CFE_MSG_GetFcnCode(MsgPtr, &FcnCode);
5555

56-
CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
56+
CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID,
57+
CFE_EVS_EventType_ERROR,
5758
"Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u",
58-
(unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength,
59+
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
60+
(unsigned int)FcnCode,
61+
(unsigned int)ActualLength,
5962
(unsigned int)ExpectedLength);
6063

6164
result = false;
6265

63-
SAMPLE_APP_Data.ErrCounter++;
66+
SAMPLE_APP_Data.CommandErrorCounter++;
6467
}
6568

6669
return result;
@@ -110,9 +113,10 @@ void SAMPLE_APP_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr)
110113
}
111114
break;
112115

113-
/* default case already found during FC vs length test */
114116
default:
115-
CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid ground command code: CC = %d",
117+
CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID,
118+
CFE_EVS_EventType_ERROR,
119+
"Invalid ground command code: CC = %d",
116120
CommandCode);
117121
break;
118122
}
@@ -155,7 +159,9 @@ void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr)
155159
else
156160
{
157161
/* Unknown command */
158-
CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID, CFE_EVS_EventType_ERROR, "SAMPLE: invalid command packet,MID = 0x%x",
162+
CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID,
163+
CFE_EVS_EventType_ERROR,
164+
"SAMPLE: invalid command packet,MID = 0x%x",
159165
(unsigned int)CFE_SB_MsgIdToValue(MsgId));
160166
}
161167
}

fsw/src/sample_app_dispatch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "cfe.h"
3232
#include "sample_app_msg.h"
3333

34-
void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr);
35-
void SAMPLE_APP_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr);
3634
bool SAMPLE_APP_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength);
35+
void SAMPLE_APP_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr);
36+
void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr);
3737

3838
#endif /* SAMPLE_APP_DISPATCH_H */

fsw/src/sample_app_eds_dispatch.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* Define a lookup table for SAMPLE app command codes
3939
*/
4040
/* clang-format off */
41-
static const EdsDispatchTable_EdsComponent_SAMPLE_APP_Application_CFE_SB_Telecommand_t SAMPLE_TC_DISPATCH_TABLE =
41+
static const EdsDispatchTable_EdsComponent_SAMPLE_APP_Application_CFE_SB_Telecommand_t SAMPLE_TC_DISPATCH_TABLE =
4242
{
4343
.CMD =
4444
{
@@ -75,23 +75,30 @@ void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr)
7575
CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MsgId);
7676
CFE_MSG_GetSize(&SBBufPtr->Msg, &MsgSize);
7777
CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &MsgFc);
78-
++SAMPLE_APP_Data.ErrCounter;
78+
++SAMPLE_APP_Data.CommandErrorCounter;
7979

8080
if (Status == CFE_STATUS_UNKNOWN_MSG_ID)
8181
{
82-
CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID, CFE_EVS_EventType_ERROR,
83-
"SAMPLE: invalid command packet,MID = 0x%x", (unsigned int)CFE_SB_MsgIdToValue(MsgId));
82+
CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID,
83+
CFE_EVS_EventType_ERROR,
84+
"SAMPLE: invalid command packet,MID = 0x%x",
85+
(unsigned int)CFE_SB_MsgIdToValue(MsgId));
8486
}
8587
else if (Status == CFE_STATUS_WRONG_MSG_LENGTH)
8688
{
87-
CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
89+
CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID,
90+
CFE_EVS_EventType_ERROR,
8891
"Invalid Msg length: ID = 0x%X, CC = %u, Len = %u",
89-
(unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)MsgFc, (unsigned int)MsgSize);
92+
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
93+
(unsigned int)MsgFc,
94+
(unsigned int)MsgSize);
9095
}
9196
else
9297
{
93-
CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID, CFE_EVS_EventType_ERROR,
94-
"SAMPLE: Invalid ground command code: CC = %d", (int)MsgFc);
98+
CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID,
99+
CFE_EVS_EventType_ERROR,
100+
"SAMPLE: Invalid ground command code: CC = %d",
101+
(int)MsgFc);
95102
}
96103
}
97104
}

fsw/src/sample_app_version.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@
2727

2828
/* Development Build Macro Definitions */
2929

30-
#define SAMPLE_APP_BUILD_NUMBER 0
31-
#define SAMPLE_APP_BUILD_BASELINE "v7.0.0" /*!< Development Build: git tag that is the base for the current development */
30+
#define SAMPLE_APP_BUILD_NUMBER 0
31+
#define SAMPLE_APP_BUILD_BASELINE \
32+
"v7.0.0" /*!< Development Build: git tag that is the base for the current development */
3233
#define SAMPLE_APP_BUILD_DEV_CYCLE "v7.0.0" /**< @brief Development: Release name for current development cycle */
33-
#define SAMPLE_APP_BUILD_CODENAME "Draco" /**< @brief: Development: Code name for the current build */
34+
#define SAMPLE_APP_BUILD_CODENAME "Draco" /**< @brief: Development: Code name for the current build */
3435

3536
/*
3637
* Version Macros, see \ref cfsversions for definitions.
3738
*/
38-
#define SAMPLE_APP_MAJOR_VERSION 7 /*!< @brief Major version number. */
39-
#define SAMPLE_APP_MINOR_VERSION 0 /*!< @brief Minor version number. */
40-
#define SAMPLE_APP_REVISION 0 /*!< @brief Revision version number. Value of 0 indicates a development version.*/
39+
#define SAMPLE_APP_MAJOR_VERSION 7 /*!< @brief Major version number. */
40+
#define SAMPLE_APP_MINOR_VERSION 0 /*!< @brief Minor version number. */
41+
#define SAMPLE_APP_REVISION 0 /*!< @brief Revision version number. Value of 0 indicates a development version.*/
4142

4243
/**
4344
* @brief Last official release.
@@ -65,9 +66,9 @@
6566

6667
/**
6768
* @brief Max Version String length.
68-
*
69+
*
6970
* Maximum length that an OSAL version string can be.
70-
*
71+
*
7172
*/
7273
#define SAMPLE_APP_CFG_MAX_VERSION_STR_LEN 256
7374

fsw/tables/sample_app_tbl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
** The following is an example of the declaration statement that defines the desired
2424
** contents of the table image.
2525
*/
26-
SAMPLE_APP_ExampleTable_t ExampleTable = {1, 2};
26+
SAMPLE_APP_ExampleTable_t ExampleTable = { 1, 2 };
2727

2828
/*
2929
** The macro below identifies:

0 commit comments

Comments
 (0)