Skip to content

Commit

Permalink
Merge pull request #364 from thnkslprpt/fix-145-clean-up-cf-return-codes
Browse files Browse the repository at this point in the history
Fix #145, Clean up CF return codes
  • Loading branch information
dzbaker authored Mar 13, 2023
2 parents 70eb257 + 9c523fb commit 3c2889f
Show file tree
Hide file tree
Showing 35 changed files with 615 additions and 612 deletions.
2 changes: 1 addition & 1 deletion fsw/inc/cf_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
#define CF_EID_ERR_PDU_SHORT_HEADER (41)

/**
* \brief CF Metadata PDU Too Shourt Event ID
* \brief CF Metadata PDU Too Short Event ID
*
* \par Type: ERROR
*
Expand Down
12 changes: 6 additions & 6 deletions fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ void CF_CheckTables(void)
* See description in cf_app.h for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CF_ValidateConfigTable(void *tbl_ptr)
CFE_Status_t CF_ValidateConfigTable(void *tbl_ptr)
{
CF_ConfigTable_t * tbl = (CF_ConfigTable_t *)tbl_ptr;
int32 ret; /* initialized below */
CFE_Status_t ret; /* initialized below */
static const int32 no_ticks_per_second = -1;
static const int32 crc_alignment = -2;
static const int32 outgoing_chunk_size = -3;
Expand Down Expand Up @@ -148,9 +148,9 @@ int32 CF_ValidateConfigTable(void *tbl_ptr)
* See description in cf_app.h for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CF_TableInit(void)
CFE_Status_t CF_TableInit(void)
{
int32 status;
CFE_Status_t status;

status = CFE_TBL_Register(&CF_AppData.config_handle, CF_CONFIG_TABLE_NAME, sizeof(CF_ConfigTable_t),
CFE_TBL_OPT_SNGL_BUFFER | CFE_TBL_OPT_LOAD_DUMP, CF_ValidateConfigTable);
Expand Down Expand Up @@ -203,9 +203,9 @@ int32 CF_TableInit(void)
* See description in cf_app.h for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CF_Init(void)
CFE_Status_t CF_Init(void)
{
int32 status;
CFE_Status_t status;
static const CFE_SB_MsgId_Atom_t MID_VALUES[] = {CF_CMD_MID, CF_SEND_HK_MID, CF_WAKE_UP_MID};
uint32 i;

Expand Down
43 changes: 40 additions & 3 deletions fsw/src/cf_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@
#include "cf_cfdp.h"
#include "cf_clist.h"

/**************************************************************************
**
** Macro definitions
**
**************************************************************************/

/**
* \name CF Error Codes
* \{
*/
#define CF_ERROR -1 /**< \brief Generic CF error return code */
#define CF_PDU_METADATA_ERROR -2 /**< \brief Invalid metadata PDU */
#define CF_SHORT_PDU_ERROR -3 /**< \brief PDU too short */
#define CF_REC_PDU_FSIZE_MISMATCH_ERROR -4 /**< \brief Receive PDU: EOF file size mismatch */
#define CF_REC_PDU_BAD_EOF_ERROR -5 /**< \brief Receive PDU: Invalid EOF packet */
#define CF_SEND_PDU_NO_BUF_AVAIL_ERROR -6 /**< \brief Send PDU: No send buffer available, throttling limit reached */
#define CF_SEND_PDU_ERROR -7 /**< \brief Send PDU: Send failed */
/**\}*/

/**
* @brief The name of the application command pipe for CF
*/
Expand All @@ -45,6 +64,12 @@
*/
#define CF_CHANNEL_PIPE_PREFIX ("CF_CHAN_")

/*************************************************************************
**
** Type definitions
**
**************************************************************************/

/**
* @brief The CF application global state structure
*
Expand All @@ -64,11 +89,23 @@ typedef struct
CF_Engine_t engine;
} CF_AppData_t;

/**************************************************************************
**
** Exported data
**
**************************************************************************/

/**
* @brief Singleton instance of the application global data
*/
extern CF_AppData_t CF_AppData;

/**************************************************************************
**
** Function Prototypes
**
**************************************************************************/

/************************************************************************/
/** @brief Send CF housekeeping packet
*
Expand Down Expand Up @@ -105,7 +142,7 @@ void CF_CheckTables(void);
* @retval Returns anything else on error.
*
*/
int32 CF_ValidateConfigTable(void *tbl_ptr);
CFE_Status_t CF_ValidateConfigTable(void *tbl_ptr);

/************************************************************************/
/** @brief Load the table on application start
Expand All @@ -118,7 +155,7 @@ int32 CF_ValidateConfigTable(void *tbl_ptr);
* @retval Returns anything else on error.
*
*/
int32 CF_TableInit(void);
CFE_Status_t CF_TableInit(void);

/************************************************************************/
/** @brief CF app init function
Expand All @@ -135,7 +172,7 @@ int32 CF_TableInit(void);
* @retval Returns anything else on error.
*
*/
int32 CF_Init(void);
CFE_Status_t CF_Init(void);

/************************************************************************/
/** @brief CF wakeup function
Expand Down
Loading

0 comments on commit 3c2889f

Please sign in to comment.