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 #76, Move function prototypes out of cs_app.c #77

Merged
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
82 changes: 1 addition & 81 deletions fsw/src/cs_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,91 +46,11 @@

/*************************************************************************
**
** Exported data
** CS global application data
**
**************************************************************************/
CS_AppData_t CS_AppData;

/**
* \brief Initialize the Checksum CFS application
*
* \par Description
* Checksum application initialization routine. This
* function performs all the required startup steps to
* get the application registered with the cFE services so
* it can begin to receive command messages and begin
* background checksumming.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 CS_AppInit(void);

/**
* \brief Process a command pipe message
*
* \par Description
* Processes a single software bus command pipe message. Checks
* the message and command IDs and calls the appropriate routine
* to handle the command.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] BufPtr A #CFE_SB_Buffer_t* pointer that
* references the software bus message. The
* calling function verifies that BufPtr is
* non-null.
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 CS_AppPipe(const CFE_SB_Buffer_t *BufPtr);

/**
* \brief Process housekeeping request
*
* \par Description
* Processes an on-board housekeeping request message.
*
* \par Assumptions, External Events, and Notes:
* This command does not affect the command execution counter
*
* \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain
*/
void CS_HousekeepingCmd(const CS_NoArgsCmd_t *CmdPtr);

/**
* \brief Command packet processor
*
* \par Description
* Processes all CS commands
*
* \param [in] BufPtr A CFE_SB_Buffer_t* pointer that
* references the software bus pointer. The
* BufPtr is verified non-null in CS_AppMain.
*/
void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr);

#if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true)
/**
* \brief Restore tables states from CDS if enabled
*
* \par Description
* Restore CS state of tables from CDS
*
* \par Assumptions, External Events, and Notes:
* None
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 CS_CreateRestoreStatesFromCDS(void);
#endif

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* CS application entry point and main process loop */
Expand Down
80 changes: 80 additions & 0 deletions fsw/src/cs_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,84 @@ void CS_UpdateCDS(void);

#endif

/**
* \brief Initialize the Checksum CFS application
*
* \par Description
* Checksum application initialization routine. This
* function performs all the required startup steps to
* get the application registered with the cFE services so
* it can begin to receive command messages and begin
* background checksumming.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 CS_AppInit(void);

/**
* \brief Process a command pipe message
*
* \par Description
* Processes a single software bus command pipe message. Checks
* the message and command IDs and calls the appropriate routine
* to handle the command.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] BufPtr A #CFE_SB_Buffer_t* pointer that
* references the software bus message. The
* calling function verifies that BufPtr is
* non-null.
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 CS_AppPipe(const CFE_SB_Buffer_t *BufPtr);

/**
* \brief Process housekeeping request
*
* \par Description
* Processes an on-board housekeeping request message.
*
* \par Assumptions, External Events, and Notes:
* This command does not affect the command execution counter
*
* \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain
*/
void CS_HousekeepingCmd(const CS_NoArgsCmd_t *CmdPtr);

/**
* \brief Command packet processor
*
* \par Description
* Processes all CS commands
*
* \param [in] BufPtr A CFE_SB_Buffer_t* pointer that
* references the software bus pointer. The
* BufPtr is verified non-null in CS_AppMain.
*/
void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr);

#if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true)
/**
* \brief Restore tables states from CDS if enabled
*
* \par Description
* Restore CS state of tables from CDS
*
* \par Assumptions, External Events, and Notes:
* None
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 CS_CreateRestoreStatesFromCDS(void);
#endif

#endif
8 changes: 0 additions & 8 deletions unit-test/cs_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ void CS_APP_TEST_CFE_ES_RestoreFromCDS_Handler(void *UserObj, UT_EntryKey_t Func
DataStoreBuffer[5] = CS_STATE_ENABLED;
}

int32 CS_AppInit(void);

int32 CS_AppPipe(CFE_SB_Buffer_t *BufPtr);

void CS_HousekeepingCmd(const CS_NoArgsCmd_t *CmdPtr);

int32 CS_CreateRestoreStatesFromCDS(void);

void CS_App_TestCmdTlmAlign(void)
{
/* Ensures the command and telemetry structures are padded to and aligned to 32-bits */
Expand Down