Skip to content

Commit

Permalink
Fix #1122, ES and EVS use default message limits
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Jan 25, 2021
1 parent c7363c8 commit 06b226f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 19 deletions.
9 changes: 2 additions & 7 deletions fsw/cfe-core/src/es/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ int32 CFE_ES_TaskInit(void)
strcpy(CFE_ES_TaskData.PipeName, "ES_CMD_PIPE");
CFE_ES_TaskData.PipeDepth = 12;

CFE_ES_TaskData.LimitHK = 2;
CFE_ES_TaskData.LimitCmd = 4;

/*
** Initialize systemlog to default Power On or Processor Reset mode
*/
Expand Down Expand Up @@ -281,8 +278,7 @@ int32 CFE_ES_TaskInit(void)
/*
** Subscribe to Housekeeping request commands
*/
Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_ES_SEND_HK_MID), CFE_ES_TaskData.CmdPipe,
CFE_SB_Default_Qos, CFE_ES_TaskData.LimitHK);
Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_ES_SEND_HK_MID), CFE_ES_TaskData.CmdPipe);
if ( Status != CFE_SUCCESS )
{
CFE_ES_WriteToSysLog("ES:Cannot Subscribe to HK packet, RC = 0x%08X\n", (unsigned int)Status);
Expand All @@ -292,8 +288,7 @@ int32 CFE_ES_TaskInit(void)
/*
** Subscribe to ES task ground command packets
*/
Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_ES_CMD_MID), CFE_ES_TaskData.CmdPipe,
CFE_SB_Default_Qos, CFE_ES_TaskData.LimitCmd);
Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_ES_CMD_MID), CFE_ES_TaskData.CmdPipe);
if ( Status != CFE_SUCCESS )
{
CFE_ES_WriteToSysLog("ES:Cannot Subscribe to ES ground commands, RC = 0x%08X\n", (unsigned int)Status);
Expand Down
3 changes: 0 additions & 3 deletions fsw/cfe-core/src/es/cfe_es_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ typedef struct
char PipeName[OS_MAX_API_NAME];
uint16 PipeDepth;

uint8 LimitHK;
uint8 LimitCmd;

CFE_ES_BackgroundLogDumpGlobal_t BackgroundERLogDumpState;

/*
Expand Down
6 changes: 2 additions & 4 deletions fsw/cfe-core/src/evs/cfe_evs_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,14 @@ int32 CFE_EVS_TaskInit ( void )
}

/* Subscribe to command and telemetry requests coming in on the command pipe */
Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_EVS_CMD_MID), CFE_EVS_GlobalData.EVS_CommandPipe,
CFE_SB_Default_Qos, CFE_EVS_MSG_LIMIT);
Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_EVS_CMD_MID), CFE_EVS_GlobalData.EVS_CommandPipe);
if (Status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("EVS:Subscribing to Cmds Failed:RC=0x%08X\n",(unsigned int)Status);
return Status;
}

Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_EVS_SEND_HK_MID), CFE_EVS_GlobalData.EVS_CommandPipe,
CFE_SB_Default_Qos, CFE_EVS_MSG_LIMIT);
Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_EVS_SEND_HK_MID), CFE_EVS_GlobalData.EVS_CommandPipe);
if (Status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("EVS:Subscribing to HK Request Failed:RC=0x%08X\n",(unsigned int)Status);
Expand Down
1 change: 0 additions & 1 deletion fsw/cfe-core/src/evs/cfe_evs_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
#define CFE_EVS_FREE_SLOT (-1)
#define CFE_EVS_NO_MASK 0
#define CFE_EVS_PIPE_DEPTH 32
#define CFE_EVS_MSG_LIMIT 4
#define CFE_EVS_MAX_EVENT_SEND_COUNT 65535
#define CFE_EVS_MAX_FILTER_COUNT 65535
#define CFE_EVS_PIPE_NAME "EVS_CMD_PIPE"
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/unit-test/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2756,15 +2756,15 @@ void TestTask(void)

/* Test task main process loop with a HK packet subscribe failure */
ES_ResetUnitTest();
UT_SetDeferredRetcode(UT_KEY(CFE_SB_SubscribeEx), 1, -3);
UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 1, -3);
UT_Report(__FILE__, __LINE__,
CFE_ES_TaskInit() == -3,
"CFE_ES_TaskInit",
"HK packet subscribe fail");

/* Test task main process loop with a ground command subscribe failure */
ES_ResetUnitTest();
UT_SetDeferredRetcode(UT_KEY(CFE_SB_SubscribeEx), 2, -4);
UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 2, -4);
UT_Report(__FILE__, __LINE__,
CFE_ES_TaskInit() == -4,
"CFE_ES_TaskInit",
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/unit-test/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void Test_Init(void)

/* Test task initialization where command subscription fails */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(CFE_SB_SubscribeEx), 1, -1);
UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 1, -1);
CFE_EVS_TaskInit();
UT_Report(__FILE__, __LINE__,
UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[13]),
Expand All @@ -456,7 +456,7 @@ void Test_Init(void)

/* Test task initialization where HK request subscription fails */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(CFE_SB_SubscribeEx), 2, -1);
UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 2, -1);
CFE_EVS_TaskInit();
UT_Report(__FILE__, __LINE__,
UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[14]),
Expand Down

0 comments on commit 06b226f

Please sign in to comment.