Skip to content

Commit

Permalink
Merge pull request #155 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
sample_app Integration candidate: 2021-09-21
  • Loading branch information
astrogeco committed Sep 22, 2021
2 parents 847ba8e + a6b839d commit d009197
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ sample_app is an example for how to build and link an application in cFS. See al

## Version History

### Development Build: v1.2.0-rc1+dev73

- Apply CFE_SB_ValueToMsgId where required
- See <https://github.com/nasa/sample_app/pull/155> and <https://github.com/nasa/cFS/pull/359>
### Development Build: v1.2.0-rc1+dev66

- Implement Coding Standard in CodeQL workflow
Expand Down
9 changes: 5 additions & 4 deletions fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ int32 SAMPLE_APP_Init(void)
/*
** Initialize housekeeping packet (clear user data area).
*/
CFE_MSG_Init(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg, SAMPLE_APP_HK_TLM_MID, sizeof(SAMPLE_APP_Data.HkTlm));
CFE_MSG_Init(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg, CFE_SB_ValueToMsgId(SAMPLE_APP_HK_TLM_MID),
sizeof(SAMPLE_APP_Data.HkTlm));

/*
** Create Software Bus message pipe.
Expand All @@ -178,7 +179,7 @@ int32 SAMPLE_APP_Init(void)
/*
** Subscribe to Housekeeping request commands
*/
status = CFE_SB_Subscribe(SAMPLE_APP_SEND_HK_MID, SAMPLE_APP_Data.CommandPipe);
status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_SEND_HK_MID), SAMPLE_APP_Data.CommandPipe);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to HK request, RC = 0x%08lX\n", (unsigned long)status);
Expand All @@ -188,7 +189,7 @@ int32 SAMPLE_APP_Init(void)
/*
** Subscribe to ground command packets
*/
status = CFE_SB_Subscribe(SAMPLE_APP_CMD_MID, SAMPLE_APP_Data.CommandPipe);
status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_CMD_MID), SAMPLE_APP_Data.CommandPipe);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08lX\n", (unsigned long)status);
Expand Down Expand Up @@ -233,7 +234,7 @@ void SAMPLE_APP_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr)

CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MsgId);

switch (MsgId)
switch (CFE_SB_MsgIdToValue(MsgId))
{
case SAMPLE_APP_CMD_MID:
SAMPLE_APP_ProcessGroundCommand(SBBufPtr);
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/sample_app_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/* Development Build Macro Definitions */

#define SAMPLE_APP_BUILD_NUMBER 66 /*!< Development Build: Number of commits since baseline */
#define SAMPLE_APP_BUILD_NUMBER 73 /*!< Development Build: Number of commits since baseline */
#define SAMPLE_APP_BUILD_BASELINE \
"v1.2.0-rc1" /*!< Development Build: git tag that is the base for the current development */

Expand Down
4 changes: 2 additions & 2 deletions unit-test/coveragetest/coveragetest_sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@ void Test_SAMPLE_APP_ProcessCommandPacket(void)
* The CFE_MSG_GetMsgId() stub uses a data buffer to hold the
* message ID values to return.
*/
TestMsgId = SAMPLE_APP_CMD_MID;
TestMsgId = CFE_SB_ValueToMsgId(SAMPLE_APP_CMD_MID);
FcnCode = SAMPLE_APP_NOOP_CC;
MsgSize = sizeof(TestMsg.Noop);
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false);
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false);
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &MsgSize, sizeof(MsgSize), false);
SAMPLE_APP_ProcessCommandPacket(&TestMsg.SBBuf);

TestMsgId = SAMPLE_APP_SEND_HK_MID;
TestMsgId = CFE_SB_ValueToMsgId(SAMPLE_APP_SEND_HK_MID);
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false);
SAMPLE_APP_ProcessCommandPacket(&TestMsg.SBBuf);

Expand Down

0 comments on commit d009197

Please sign in to comment.