Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #484, Deprecate shell output command #645

Merged
merged 1 commit into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
22 changes: 19 additions & 3 deletions fsw/cfe-core/src/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@
*/
#define CFE_ES_RESTART_CC 2

/** \cfeescmd Executive Services O/S Shell Command
#ifndef CFE_OMIT_DEPRECATED_6_7
/** \cfeescmd DEPRECATED: Executive Services O/S Shell Command
** \deprecated
**
** \par Description
** This command passes an ASCII string as a command line to the
Expand Down Expand Up @@ -217,6 +219,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,8 +1155,10 @@ typedef struct
CFE_ES_RestartCmd_Payload_t Payload;
} CFE_ES_Restart_t;

#ifndef CFE_OMIT_DEPRECATED_6_7
/**
** \brief Shell Command
** \brief DEPRECATED: Shell Command
** \deprecated
**
** For command details, see #CFE_ES_SHELL_CC
**
Expand All @@ -1166,11 +1171,16 @@ typedef struct
be written */
} CFE_ES_ShellCmd_Payload_t;

/**
* \deprecated
*/
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,20 +1585,26 @@ typedef struct

} CFE_ES_HousekeepingTlm_t;

#ifndef CFE_OMIT_DEPRECATED_6_7
/**
** \cfeestlm OS Shell Output Packet
** \cfeestlm DEPRECATED: OS Shell Output Packet
** \deprecated
**/
typedef struct
{
char ShellOutput[CFE_MISSION_ES_MAX_SHELL_PKT]; /**< \brief ASCII text string containing output from OS Shell
that was received in response to an OS Shell Command */
} CFE_ES_ShellPacket_Payload_t;

/**
* \deprecated
*/
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