Skip to content

Commit

Permalink
Merge pull request nasa#729 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
Integration Candidate: 2020-05-27
  • Loading branch information
astrogeco authored Jun 10, 2020
2 parents d217ca3 + 767bc55 commit ad2190a
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 31 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ This is a collection of services and associated framework to be located in the `

## Version History

### Development Build: 6.7.19

- API Change: cFE ut_sb_stubs now has CFE_SB_DeletePipe available.
Behavior Change: App unit tests requiring this will not fail to build due to undefined reference to CFE_SB_DeletePipe
- Hook functions may now use the va_list form and obtain the full set of variable arguments passed to CFE_EVS_SendEvent and variants.
- Replace all direct references to data types defined in ccsds.h with the abstract type defined in cfe_sb.h.
- See <https://github.com/nasa/cFE/pull/729> for details.

### Development Build: 6.7.18

- Using ut stubs CFE_EVS_SendEvent and CFE_ES_WriteToSysLog, the register buffer will have the correct size. access to register buffer element will exist
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void CFE_ES_TaskPipe(CFE_SB_MsgPtr_t Msg)
** Housekeeping telemetry request
*/
case CFE_ES_SEND_HK_MID:
CFE_ES_HousekeepingCmd((CCSDS_CommandPacket_t*)Msg);
CFE_ES_HousekeepingCmd((CFE_SB_CmdHdr_t*)Msg);
break;

/*
Expand Down Expand Up @@ -662,7 +662,7 @@ void CFE_ES_TaskPipe(CFE_SB_MsgPtr_t Msg)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 CFE_ES_HousekeepingCmd(const CCSDS_CommandPacket_t *data)
int32 CFE_ES_HousekeepingCmd(const CFE_SB_CmdHdr_t *data)
{
OS_heap_prop_t HeapProp;
int32 stat;
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/es/cfe_es_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void CFE_ES_BackgroundCleanup(void);
/*
** ES Task message dispatch functions
*/
int32 CFE_ES_HousekeepingCmd(const CCSDS_CommandPacket_t *data);
int32 CFE_ES_HousekeepingCmd(const CFE_SB_CmdHdr_t *data);
int32 CFE_ES_NoopCmd(const CFE_ES_Noop_t *Cmd);
int32 CFE_ES_ResetCountersCmd(const CFE_ES_ResetCounters_t *data);
int32 CFE_ES_RestartCmd(const CFE_ES_Restart_t *data);
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/evs/cfe_evs_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void CFE_EVS_ProcessCommandPacket ( CFE_SB_MsgPtr_t EVS_MsgPtr )

case CFE_EVS_SEND_HK_MID:
/* Housekeeping request */
CFE_EVS_ReportHousekeepingCmd((CCSDS_CommandPacket_t*)EVS_MsgPtr);
CFE_EVS_ReportHousekeepingCmd((CFE_SB_CmdHdr_t*)EVS_MsgPtr);
break;

default:
Expand Down Expand Up @@ -687,7 +687,7 @@ int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLog_t *data)
** Assumptions and Notes:
**
*/
int32 CFE_EVS_ReportHousekeepingCmd (const CCSDS_CommandPacket_t *data)
int32 CFE_EVS_ReportHousekeepingCmd (const CFE_SB_CmdHdr_t *data)
{
uint32 i, j;

Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/evs/cfe_evs_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extern void CFE_EVS_ProcessCommandPacket ( CFE_SB_MsgPtr_t EVS_MsgPtr );
/*
* EVS Message Handler Functions
*/
int32 CFE_EVS_ReportHousekeepingCmd (const CCSDS_CommandPacket_t *data);
int32 CFE_EVS_ReportHousekeepingCmd (const CFE_SB_CmdHdr_t *data);
int32 CFE_EVS_NoopCmd(const CFE_EVS_Noop_t *data);
int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLog_t *data);
int32 CFE_EVS_ResetCountersCmd(const CFE_EVS_ResetCounters_t *data);
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
*/
#define CFE_MAJOR_VERSION 6
#define CFE_MINOR_VERSION 7
#define CFE_REVISION 18
#define CFE_REVISION 19


#endif /* _cfe_version_ */
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/sb/cfe_sb_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ int32 CFE_SB_NoopCmd(const CFE_SB_Noop_t *data);
int32 CFE_SB_ResetCountersCmd(const CFE_SB_ResetCounters_t *data);
int32 CFE_SB_EnableSubReportingCmd(const CFE_SB_EnableSubReporting_t *data);
int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReporting_t *data);
int32 CFE_SB_SendHKTlmCmd(const CCSDS_CommandPacket_t *data);
int32 CFE_SB_SendHKTlmCmd(const CFE_SB_CmdHdr_t *data);
int32 CFE_SB_EnableRouteCmd(const CFE_SB_EnableRoute_t *data);
int32 CFE_SB_DisableRouteCmd(const CFE_SB_DisableRoute_t *data);
int32 CFE_SB_SendStatsCmd(const CFE_SB_SendSbStats_t *data);
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/sb/cfe_sb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void CFE_SB_ProcessCmdPipePkt(void) {

case CFE_SB_SEND_HK_MID:
/* Note: Command counter not incremented for this command */
CFE_SB_SendHKTlmCmd((CCSDS_CommandPacket_t *)CFE_SB.CmdPipePktPtr);
CFE_SB_SendHKTlmCmd((CFE_SB_CmdHdr_t *)CFE_SB.CmdPipePktPtr);
break;

case CFE_SB_SUB_RPT_CTRL_MID:
Expand Down Expand Up @@ -556,7 +556,7 @@ int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReporting_t *data)
** Return:
** none
*/
int32 CFE_SB_SendHKTlmCmd(const CCSDS_CommandPacket_t *data)
int32 CFE_SB_SendHKTlmCmd(const CFE_SB_CmdHdr_t *data)
{
CFE_SB.HKTlmMsg.Payload.MemInUse = CFE_SB.StatTlmMsg.Payload.MemInUse;
CFE_SB.HKTlmMsg.Payload.UnmarkedMem = CFE_PLATFORM_SB_BUF_MEMORY_BYTES - CFE_SB.StatTlmMsg.Payload.PeakMemInUse;
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/tbl/cfe_tbl_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ CFE_TBL_TaskData_t CFE_TBL_TaskData;
* For generic message entries, which only have a MID and a handler function (no command payload)
*/
#define CFE_TBL_MESSAGE_ENTRY(mid,handlerfunc) \
{ CFE_SB_MSGID_WRAP_VALUE(mid), 0, sizeof(CCSDS_CommandPacket_t), (CFE_TBL_MsgProcFuncPtr_t)handlerfunc, CFE_TBL_MSG_MSGTYPE }
{ CFE_SB_MSGID_WRAP_VALUE(mid), 0, sizeof(CFE_SB_CmdHdr_t), (CFE_TBL_MsgProcFuncPtr_t)handlerfunc, CFE_TBL_MSG_MSGTYPE }

/*
* Macros to assist in building the CFE_TBL_CmdHandlerTbl -
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h'
********************************************************************/

int32 CFE_TBL_HousekeepingCmd(const CCSDS_CommandPacket_t *data)
int32 CFE_TBL_HousekeepingCmd(const CFE_SB_CmdHdr_t *data)
{
int32 Status;
uint32 i;
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extern void CFE_TBL_GetTblRegData(void);
**
** \retval #CFE_TBL_DONT_INC_CTR \copydoc CFE_TBL_DONT_INC_CTR
******************************************************************************/
int32 CFE_TBL_HousekeepingCmd(const CCSDS_CommandPacket_t *data);
int32 CFE_TBL_HousekeepingCmd(const CFE_SB_CmdHdr_t *data);

/*****************************************************************************/
/**
Expand Down
24 changes: 12 additions & 12 deletions fsw/cfe-core/src/time/cfe_time_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ CFE_TIME_TaskData_t CFE_TIME_TaskData;
/*
** Command handler for "HK request"...
*/
int32 CFE_TIME_HousekeepingCmd(const CCSDS_CommandPacket_t *data);
int32 CFE_TIME_HousekeepingCmd(const CFE_SB_CmdHdr_t *data);

/*
** Command handler for "tone signal detected"...
*/
int32 CFE_TIME_ToneSignalCmd(const CCSDS_CommandPacket_t *data);
int32 CFE_TIME_ToneSignalCmd(const CFE_SB_CmdHdr_t *data);

/*
** Command handler for "time at the tone"...
Expand All @@ -61,7 +61,7 @@ int32 CFE_TIME_ToneDataCmd(const CFE_TIME_ToneDataCmd_t *data);
/*
** Command handler for 1Hz signal...
*/
int32 CFE_TIME_OneHzCmd(const CCSDS_CommandPacket_t *data);
int32 CFE_TIME_OneHzCmd(const CFE_SB_CmdHdr_t *data);

/*
** Command handler for "request time at the tone"...
Expand All @@ -79,7 +79,7 @@ int32 CFE_TIME_OneHzCmd(const CCSDS_CommandPacket_t *data);
** non-fake tone mode.
*/
#if (CFE_PLATFORM_TIME_CFG_SERVER == true)
int32 CFE_TIME_ToneSendCmd(const CCSDS_CommandPacket_t *data);
int32 CFE_TIME_ToneSendCmd(const CFE_SB_CmdHdr_t *data);
#endif

/*
Expand Down Expand Up @@ -471,14 +471,14 @@ void CFE_TIME_TaskPipe(CFE_SB_MsgPtr_t MessagePtr)
** Housekeeping telemetry request...
*/
case CFE_TIME_SEND_HK_MID:
CFE_TIME_HousekeepingCmd((CCSDS_CommandPacket_t *)MessagePtr);
CFE_TIME_HousekeepingCmd((CFE_SB_CmdHdr_t *)MessagePtr);
break;

/*
** Time at the tone "signal"...
*/
case CFE_TIME_TONE_CMD_MID:
CFE_TIME_ToneSignalCmd((CCSDS_CommandPacket_t *)MessagePtr);
CFE_TIME_ToneSignalCmd((CFE_SB_CmdHdr_t *)MessagePtr);
break;

/*
Expand All @@ -492,15 +492,15 @@ void CFE_TIME_TaskPipe(CFE_SB_MsgPtr_t MessagePtr)
** Run time state machine at 1Hz...
*/
case CFE_TIME_1HZ_CMD_MID:
CFE_TIME_OneHzCmd((CCSDS_CommandPacket_t *)MessagePtr);
CFE_TIME_OneHzCmd((CFE_SB_CmdHdr_t *)MessagePtr);
break;

/*
** Request for time at the tone "data"...
*/
#if (CFE_PLATFORM_TIME_CFG_SERVER == true)
case CFE_TIME_SEND_CMD_MID:
CFE_TIME_ToneSendCmd((CCSDS_CommandPacket_t *)MessagePtr);
CFE_TIME_ToneSendCmd((CFE_SB_CmdHdr_t *)MessagePtr);
break;
#endif

Expand Down Expand Up @@ -665,7 +665,7 @@ void CFE_TIME_TaskPipe(CFE_SB_MsgPtr_t MessagePtr)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 CFE_TIME_HousekeepingCmd(const CCSDS_CommandPacket_t *data)
int32 CFE_TIME_HousekeepingCmd(const CFE_SB_CmdHdr_t *data)
{
CFE_TIME_Reference_t Reference;

Expand Down Expand Up @@ -705,7 +705,7 @@ int32 CFE_TIME_HousekeepingCmd(const CCSDS_CommandPacket_t *data)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 CFE_TIME_ToneSignalCmd(const CCSDS_CommandPacket_t *data)
int32 CFE_TIME_ToneSignalCmd(const CFE_SB_CmdHdr_t *data)
{
/*
** Indication that tone signal occurred recently...
Expand Down Expand Up @@ -754,7 +754,7 @@ int32 CFE_TIME_ToneDataCmd(const CFE_TIME_ToneDataCmd_t *data)
* as we do not need a separate MID for this job.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 CFE_TIME_OneHzCmd(const CCSDS_CommandPacket_t *data)
int32 CFE_TIME_OneHzCmd(const CFE_SB_CmdHdr_t *data)
{
/*
* Run the state machine updates required at 1Hz.
Expand Down Expand Up @@ -787,7 +787,7 @@ int32 CFE_TIME_OneHzCmd(const CCSDS_CommandPacket_t *data)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#if (CFE_PLATFORM_TIME_CFG_SERVER == true)
int32 CFE_TIME_ToneSendCmd(const CCSDS_CommandPacket_t *data)
int32 CFE_TIME_ToneSendCmd(const CFE_SB_CmdHdr_t *data)
{
/*
** Request for "time at tone" data packet (probably scheduler)...
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/unit-test/sb_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -4648,7 +4648,7 @@ void Test_CFE_SB_SetGetUserDataLength(void)
SizeReturned = CFE_SB_GetUserDataLength(SBCmdPtr);
ActualPktLenField = UT_GetActualPktLenField(SBCmdPtr);

ExpPktLenField = sizeof(CCSDS_CommandPacket_t) + SetSize - sizeof(CCSDS_PriHdr_t) - 1; /* SecHdrSize + data - 1 */
ExpPktLenField = sizeof(CFE_SB_CmdHdr_t) + SetSize - sizeof(CCSDS_PriHdr_t) - 1; /* SecHdrSize + data - 1 */

if (SizeReturned != SetSize ||
ActualPktLenField != ExpPktLenField)
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/unit-test/time_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ void Test_PipeCmds(void)
union
{
CFE_SB_Msg_t message;
CCSDS_CommandPacket_t cmd;
CFE_SB_CmdHdr_t cmd;
CFE_TIME_ToneDataCmd_t tonedatacmd;
CFE_TIME_Noop_t noopcmd;
CFE_TIME_ResetCounters_t resetcountercmd;
Expand Down
6 changes: 5 additions & 1 deletion fsw/cfe-core/ut-stubs/ut_es_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,13 @@ int32 CFE_ES_RegisterChildTask(void)
int32 CFE_ES_WriteToSysLog(const char *pSpecString, ...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_ES_WriteToSysLog), pSpecString); // allow this input to be used by hook functions

status = UT_DEFAULT_IMPL(CFE_ES_WriteToSysLog);
va_start(va,pSpecString);
status = UT_DEFAULT_IMPL_VARARGS(CFE_ES_WriteToSysLog, va);
va_end(va);

if (status >= 0)
{
Expand Down
21 changes: 18 additions & 3 deletions fsw/cfe-core/ut-stubs/ut_evs_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@ int32 CFE_EVS_SendEvent(uint16 EventID,
...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventID);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventType);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), Spec);
status = UT_DEFAULT_IMPL(CFE_EVS_SendEvent);
va_start(va, Spec);
status = UT_DEFAULT_IMPL_VARARGS(CFE_EVS_SendEvent, va);
va_end(va);

if (status >= 0)
{
Expand Down Expand Up @@ -145,9 +148,15 @@ int32 CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time,
...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventID);
status = UT_DEFAULT_IMPL(CFE_EVS_SendEvent);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventType);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &Time);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), Spec);
va_start(va, Spec);
status = UT_DefaultStubImplWithArgs(__func__, UT_KEY(CFE_EVS_SendTimedEvent), CFE_SUCCESS, va);
va_end(va);

if (status >= 0)
{
Expand Down Expand Up @@ -218,9 +227,15 @@ int32 CFE_EVS_SendEventWithAppID(uint16 EventID,
...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventID);
status = UT_DEFAULT_IMPL(CFE_EVS_SendEventWithAppID);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventType);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &AppID);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), Spec);
va_start(va, Spec);
status = UT_DefaultStubImplWithArgs(__func__, UT_KEY(CFE_EVS_SendEventWithAppID), CFE_SUCCESS, va);
va_end(va);

if (status >= 0)
{
Expand Down
29 changes: 29 additions & 0 deletions fsw/cfe-core/ut-stubs/ut_sb_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,35 @@ int32 CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth,
return status;
}

/*****************************************************************************/
/**
** \brief CFE_SB_DeletePipe stub function
**
** \par Description
** This function is used to mimic the response of the cFE SB function
** CFE_SB_DeletePipe.
**
** \par Assumptions, External Events, and Notes:
** None
**
** \returns
** Returns either a user-defined status flag or CFE_SUCCESS.
**
******************************************************************************/
int32 CFE_SB_DeletePipe(CFE_SB_PipeId_t PipeId)
{
int32 status;

status = UT_DEFAULT_IMPL(CFE_SB_DeletePipe);

if (status >= 0)
{
UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_DeletePipe), &PipeId, sizeof(PipeId));
}

return status;
}

/*****************************************************************************/
/**
** \brief CFE_SB_GetPipeName stub function
Expand Down

0 comments on commit ad2190a

Please sign in to comment.