Skip to content

Commit

Permalink
Fix nasa#793, Clarify restart/reload app behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Jan 11, 2021
1 parent 1ede295 commit ec10744
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
20 changes: 11 additions & 9 deletions docs/src/cfe_es.dox
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,12 @@
/**
\page cfeesugapprestart Restarting an Application

The #CFE_ES_RESTART_APP_CC command is used to restart an application.
This command stops and restarts an application using the parameters
defined when the application was originally started, either through
The #CFE_ES_RESTART_APP_CC command is used to restart an application
using the same file name as the last start.

This command stops the application, unloads the object file, loads the object file
using the previous file name, and restarts an application using the parameters
defined when the application was previously started, either through
the startup script or by way of the #CFE_ES_START_APP_CC command.

Next: \ref cfeesugappreload <BR>
Expand All @@ -379,12 +382,11 @@
/**
\page cfeesugappreload Reloading an Application

The #CFE_ES_RELOAD_APP_CC command is used to reload an application.
This command stops the application, unloads the object file, loads
the new object file specified in the command and starts the application
again using the parameters defined when the application was originally
started, either through the startup script or by way of the
#CFE_ES_START_APP_CC command.
The #CFE_ES_RELOAD_APP_CC command is used to reload an application
using a new file name.

The new file is checked for existance, and if confirmed performs
the same actions as #CFE_ES_RESTART_APP_CC only using the new file.

Next: \ref cfeesugapplist <BR>
Prev: \ref cfeesugapprestart <BR>
Expand Down
20 changes: 17 additions & 3 deletions fsw/cfe-core/src/inc/cfe_es.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,20 @@ CFE_Status_t CFE_ES_ResetCFE(uint32 ResetType);
** \brief Restart a single cFE Application
**
** \par Description
** This API causes a cFE Application to be stopped and restarted.
** This API causes a cFE Application to be unloaded and restarted
** from the same file name as the last start.
**
** \par Assumptions, External Events, and Notes:
** None
** Goes through the standard CFE_ES_CleanUpApp which unloads,
** then attempts a load using the original file name. File
** is not checked for existance prior to unload.
**
** In the event that an application cannot be reloaded due to a
** missing file or any other load issue, the application may no longer be
** restarted or reloaded when given a valid load file (the app has been
** deleted and no longer exists). To recover, the application
** may be started by loading the application via the ES_STARTAPP
** command (#CFE_ES_START_APP_CC).
**
** \param[in] AppID Identifies the application to be reset.
**
Expand All @@ -483,11 +493,15 @@ CFE_Status_t CFE_ES_RestartApp(CFE_ES_ResourceID_t AppID);
** the specified file.
**
** \par Assumptions, External Events, and Notes:
** The filename is checked for existance prior to load. A missing file
** will be reported and the reload operation will be aborted prior
** to unloading the app.
**
** The specified application will be deleted before it is reloaded from the
** specified file. In the event that an application cannot be reloaded due to
** a corrupt file, the application may no longer be reloaded when given a valid
** load file (it has been deleted and no longer exists). To recover, the
** application may be restarted by loading the application via the ES_STARTAPP
** application may be started by loading the application via the ES_STARTAPP
** command (#CFE_ES_START_APP_CC).
**
** \param[in] AppID Identifies the application to be reset.
Expand Down
14 changes: 9 additions & 5 deletions fsw/cfe-core/src/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,15 @@
*/
#define CFE_ES_STOP_APP_CC 5

/** \cfeescmd Stops and Restarts an Application
/** \cfeescmd Stops, Unloads, Loads using the previous File name, and Restarts an Application
**
** \par Description
** This command halts and restarts the specified Application.
** This command does \b NOT reload the application from the onboard
** filesystem.
** This command halts and removes the specified Application
** from the system. Then it immediately loads the Application from
** the same filename last used to start. This command is
** especially useful for restarting a Command Ingest Application
** since once it has been stopped, no further commands can come in
** to restart it.
**
** \cfecmdmnemonic \ES_RESTARTAPP
**
Expand Down Expand Up @@ -310,7 +313,7 @@
*/
#define CFE_ES_RESTART_APP_CC 6

/** \cfeescmd Stops, Unloads, Loads from a File and Restarts an Application
/** \cfeescmd Stops, Unloads, Loads from the command specfied File and Restarts an Application
**
** \par Description
** This command halts and removes the specified Application
Expand All @@ -337,6 +340,7 @@
** \par Error Conditions
** This command may fail for the following reason(s):
** - The command packet length is incorrect
** - The reload file is missing
** - The specified application name is not recognized as an active application
** - The specified application is one of the cFE's Core applications (ES, EVS, SB, TBL, TIME)
**
Expand Down

0 comments on commit ec10744

Please sign in to comment.