Skip to content

Commit

Permalink
Fix #484, Deprecate output to shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Apr 28, 2020
1 parent 3c616f2 commit 38ca5e7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 300 deletions.
6 changes: 5 additions & 1 deletion cmake/sample_defs/cpu1_msgids.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@
#define CFE_TBL_REG_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */
#define CFE_SB_ALLSUBS_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */
#define CFE_SB_ONESUB_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */
#define CFE_ES_SHELL_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_ES_SHELL_TLM_MSG /* 0x080F */

#ifndef CFE_OMIT_DEPRECATED_6_7
#define CFE_ES_SHELL_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_ES_SHELL_TLM_MSG /* 0x080F */
#endif

#define CFE_ES_MEMSTATS_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */

/*
Expand Down
6 changes: 6 additions & 0 deletions fsw/cfe-core/src/es/cfe_es_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@

#include <string.h>

#ifndef CFE_OMIT_DEPRECATED_6_7 /* Remove entire file eventually */
/* Note - Plan to implement the list functions as real commands,
* shell output no longer part of cFS Framework, recommend implementation in an app if needed
*/

#define CFE_ES_CHECKSIZE 3
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* CFE_ES_ShellOutputCommand() -- Pass thru string to O/S shell or to ES */
Expand Down Expand Up @@ -424,3 +429,4 @@ int32 CFE_ES_ListResources(int32 fd)
*/
return Result;
}
#endif /* CFE_OMIT_DEPRECATED_6_7 */
8 changes: 6 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,14 @@ int32 CFE_ES_TaskInit(void)
CFE_SB_ValueToMsgId(CFE_ES_HK_TLM_MID),
sizeof(CFE_ES_TaskData.HkPacket), true);

#ifndef CFE_OMIT_DEPRECATED_6_7
/*
** Initialize shell output packet (clear user data area)
*/
CFE_SB_InitMsg(&CFE_ES_TaskData.ShellPacket,
CFE_SB_ValueToMsgId(CFE_ES_SHELL_TLM_MID),
sizeof(CFE_ES_TaskData.ShellPacket), true);
#endif

/*
** Initialize single application telemetry packet
Expand Down Expand Up @@ -465,12 +467,14 @@ void CFE_ES_TaskPipe(CFE_SB_MsgPtr_t Msg)
}
break;

#ifndef CFE_OMIT_DEPRECATED_6_7
case CFE_ES_SHELL_CC:
if (CFE_ES_VerifyCmdLength(Msg, sizeof(CFE_ES_Shell_t)))
{
CFE_ES_ShellCmd((CFE_ES_Shell_t*)Msg);
}
break;
#endif

case CFE_ES_START_APP_CC:
if (CFE_ES_VerifyCmdLength(Msg, sizeof(CFE_ES_StartApp_t)))
Expand Down Expand Up @@ -832,7 +836,7 @@ int32 CFE_ES_RestartCmd(const CFE_ES_Restart_t *data)
return CFE_SUCCESS;
} /* End of CFE_ES_RestartCmd() */


#ifndef CFE_OMIT_DEPRECATED_6_7
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* CFE_ES_ShellCmd() -- Pass thru string to O/S shell */
Expand Down Expand Up @@ -877,7 +881,7 @@ int32 CFE_ES_ShellCmd(const CFE_ES_Shell_t *data)

return CFE_SUCCESS;
} /* End of CFE_ES_ShellCmd() */

#endif /* CFE_OMIT_DEPRECATED_6_7 */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down
5 changes: 4 additions & 1 deletion fsw/cfe-core/src/es/cfe_es_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ typedef struct
*/
CFE_ES_HousekeepingTlm_t HkPacket;


#ifndef CFE_OMIT_DEPRECATED_6_7
/*
** ES Shell output telemetry packet
*/
CFE_ES_ShellTlm_t ShellPacket;
#endif

/*
** Single application telemetry packet
Expand Down Expand Up @@ -152,7 +153,9 @@ int32 CFE_ES_HousekeepingCmd(const CCSDS_CommandPacket_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);
#ifndef CFE_OMIT_DEPRECATED_6_7
int32 CFE_ES_ShellCmd(const CFE_ES_Shell_t *data);
#endif
int32 CFE_ES_StartAppCmd(const CFE_ES_StartApp_t *data);
int32 CFE_ES_StopAppCmd(const CFE_ES_StopApp_t *data);
int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartApp_t *data);
Expand Down
7 changes: 7 additions & 0 deletions fsw/cfe-core/src/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
*/
#define CFE_ES_RESTART_CC 2

#ifndef CFE_OMIT_DEPRECATED_6_7
/** \cfeescmd Executive Services O/S Shell Command
**
** \par Description
Expand Down Expand Up @@ -217,6 +218,7 @@
** \sa
*/
#define CFE_ES_SHELL_CC 3
#endif /* CFE_OMIT_DEPRECATED_6_7 */

/** \cfeescmd Load and Start an Application
**
Expand Down Expand Up @@ -1152,6 +1154,7 @@ typedef struct
CFE_ES_RestartCmd_Payload_t Payload;
} CFE_ES_Restart_t;

#ifndef CFE_OMIT_DEPRECATED_6_7
/**
** \brief Shell Command
**
Expand All @@ -1171,6 +1174,8 @@ typedef struct
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_ShellCmd_Payload_t Payload;
} CFE_ES_Shell_t;
#endif /* CFE_OMIT_DEPRECATED_6_7 */


/**
** \brief Payload format for commands which accept a single file name
Expand Down Expand Up @@ -1575,6 +1580,7 @@ typedef struct

} CFE_ES_HousekeepingTlm_t;

#ifndef CFE_OMIT_DEPRECATED_6_7
/**
** \cfeestlm OS Shell Output Packet
**/
Expand All @@ -1589,6 +1595,7 @@ typedef struct
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_ES_ShellPacket_Payload_t Payload;
}CFE_ES_ShellTlm_t;
#endif /* CFE_OMIT_DEPRECATED_6_7 */

/*************************************************************************/

Expand Down
Loading

0 comments on commit 38ca5e7

Please sign in to comment.