Skip to content

Commit ceed7e7

Browse files
Cameron-Sykesdzbaker
authored andcommitted
Fix #26, Adjust SAMPLE_APP to Work with an EDS Build and Default COSMOS
Packet Definition Files Squashed commit of the following: commit 0827b46280f3f99148f7fa876682784883fd07da Author: Cameron Sykes <cameron.j.sykes@nasa.gov> Date: Thu Mar 26 16:18:43 2026 -0400 Fix #26, Clang format commit f17fc02b33c4277ce2ec43330a604382c5ec2f71 Merge: 8ca95b9 c6e03b0 Author: Joseph Hickey <joseph.p.hickey@nasa.gov> Date: Thu Mar 26 16:09:17 2026 -0400 Merge branch 'jph-rename-tlm' into fix-26-make-sample-app-work-with-eds commit c6e03b00a839e84d6a9e50f649defb6400c34979 Author: Joseph Hickey <joseph.p.hickey@nasa.gov> Date: Thu Mar 26 14:51:40 2026 -0400 Rename CommandCounters commit 8ca95b9900389926ec8fa90d64eecd8151b7e95f Author: Cameron Sykes <cameron.j.sykes@nasa.gov> Date: Wed Mar 11 14:32:34 2026 -0400 Fix #26, Fix alignment on hk packet
1 parent 4dfaa50 commit ceed7e7

5 files changed

Lines changed: 12 additions & 13 deletions

File tree

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.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: 7 additions & 7 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,7 +78,7 @@ 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

8383
CFE_EVS_SendEvent(SAMPLE_APP_NOOP_INF_EID,
8484
CFE_EVS_EventType_INFORMATION,
@@ -97,8 +97,8 @@ CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg)
9797
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
9898
CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Msg)
9999
{
100-
SAMPLE_APP_Data.CmdCounter = 0;
101-
SAMPLE_APP_Data.ErrCounter = 0;
100+
SAMPLE_APP_Data.CommandCounter = 0;
101+
SAMPLE_APP_Data.CommandErrorCounter = 0;
102102

103103
CFE_EVS_SendEvent(SAMPLE_APP_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE: RESET command");
104104

@@ -119,7 +119,7 @@ CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg)
119119
const char *TableName = "SAMPLE_APP.ExampleTable";
120120

121121
/* Sample Use of Example Table */
122-
SAMPLE_APP_Data.CmdCounter++;
122+
SAMPLE_APP_Data.CommandCounter++;
123123
Status = CFE_TBL_GetAddress(&TblAddr, SAMPLE_APP_Data.TblHandles[0]);
124124
if (Status < CFE_SUCCESS)
125125
{
@@ -154,7 +154,7 @@ CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg)
154154
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
155155
CFE_Status_t SAMPLE_APP_DisplayParamCmd(const SAMPLE_APP_DisplayParamCmd_t *Msg)
156156
{
157-
SAMPLE_APP_Data.CmdCounter++;
157+
SAMPLE_APP_Data.CommandCounter++;
158158
CFE_EVS_SendEvent(SAMPLE_APP_VALUE_INF_EID,
159159
CFE_EVS_EventType_INFORMATION,
160160
"SAMPLE_APP: ValU32=%lu, ValI16=%d, ValStr=%s",

fsw/src/sample_app_dispatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bool SAMPLE_APP_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t Expected
6363

6464
result = false;
6565

66-
SAMPLE_APP_Data.ErrCounter++;
66+
SAMPLE_APP_Data.CommandErrorCounter++;
6767
}
6868

6969
return result;

fsw/src/sample_app_eds_dispatch.c

Lines changed: 2 additions & 2 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,7 +75,7 @@ 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
{

0 commit comments

Comments
 (0)