Skip to content
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
50 changes: 25 additions & 25 deletions config/default_cf_fcncode_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,30 @@
* Macro Definitions
************************************************************************/

#define CF_CCVAL(x) CF_FunctionCode_##x
#define CF_CCVAL(x) CF_FunctionCode_##x

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro CF_CCVAL(x) uses token pasting and is not allowed.

enum CF_FunctionCode_
{
CF_FunctionCode_NOOP = 0,
CF_FunctionCode_RESET_COUNTERS = 1,
CF_FunctionCode_TX_FILE = 2,
CF_FunctionCode_PLAYBACK_DIR = 3,
CF_FunctionCode_FREEZE = 4,
CF_FunctionCode_THAW = 5,
CF_FunctionCode_SUSPEND = 6,
CF_FunctionCode_RESUME = 7,
CF_FunctionCode_CANCEL = 8,
CF_FunctionCode_ABANDON = 9,
CF_FunctionCode_SET_PARAM = 10,
CF_FunctionCode_GET_PARAM = 11,
CF_FunctionCode_WRITE_QUEUE = 15,
CF_FunctionCode_ENABLE_DEQUEUE = 16,
CF_FunctionCode_DISABLE_DEQUEUE = 17,
CF_FunctionCode_ENABLE_DIR_POLLING = 18,
CF_FunctionCode_DISABLE_DIR_POLLING = 19,
CF_FunctionCode_PURGE_QUEUE = 21,
CF_FunctionCode_ENABLE_ENGINE = 22,
CF_FunctionCode_DISABLE_ENGINE = 23,
};
enum CF_FunctionCode_
{
CF_FunctionCode_NOOP = 0,
CF_FunctionCode_RESET_COUNTERS = 1,
CF_FunctionCode_TX_FILE = 2,
CF_FunctionCode_PLAYBACK_DIR = 3,
CF_FunctionCode_FREEZE = 4,
CF_FunctionCode_THAW = 5,
CF_FunctionCode_SUSPEND = 6,
CF_FunctionCode_RESUME = 7,
CF_FunctionCode_CANCEL = 8,
CF_FunctionCode_ABANDON = 9,
CF_FunctionCode_SET_PARAM = 10,
CF_FunctionCode_GET_PARAM = 11,
CF_FunctionCode_WRITE_QUEUE = 15,
CF_FunctionCode_ENABLE_DEQUEUE = 16,
CF_FunctionCode_DISABLE_DEQUEUE = 17,
CF_FunctionCode_ENABLE_DIR_POLLING = 18,
CF_FunctionCode_DISABLE_DIR_POLLING = 19,
CF_FunctionCode_PURGE_QUEUE = 21,
CF_FunctionCode_ENABLE_ENGINE = 22,
CF_FunctionCode_DISABLE_ENGINE = 23,
};

#endif
#endif
4 changes: 2 additions & 2 deletions config/default_cf_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ typedef struct CF_HkChannel_Data
uint8 poll_counter; /**< \brief Number of active polling directories */
uint8 playback_counter; /**< \brief Number of active playback directories */
uint8 frozen; /**< \brief Frozen state: 0 == not frozen, else frozen */
uint8 spare[7]; /**< \brief Alignment spare (uint64 values in the counters) */
uint8 spare; /**< \brief Alignment spare (uint64 values in the counters) */
} CF_HkChannel_Data_t;

/**
Expand All @@ -116,7 +116,7 @@ typedef struct CF_HkChannel_Data
typedef struct CF_HkPacket_Payload
{
CF_HkCmdCounters_t counters; /**< \brief Command counters */
uint8 spare[4]; /**< \brief Alignment spare (CF_HkCmdCounters_t is 4 bytes) */
uint8 Padding[4];

CF_HkChannel_Data_t channel_hk[CF_NUM_CHANNELS]; /**< \brief Per channel housekeeping data */
} CF_HkPacket_Payload_t;
Expand Down
2 changes: 1 addition & 1 deletion config/default_cf_msgids.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/

/** \brief Message ID for housekeeping telemetry */
#define CF_HK_TLM_MID CFE_PLATFORM_CF_TLM_MIDVAL(HK_TLM)
#define CF_HK_TLM_MID CFE_PLATFORM_CF_TLM_MIDVAL(HK_TLM)

/** \brief Message ID for end of transaction telemetry */
#define CF_EOT_TLM_MID CFE_PLATFORM_CF_TLM_MIDVAL(EOT_TLM)
Expand Down
10 changes: 2 additions & 8 deletions config/default_cf_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@
* @par Limits:
*
*/
#define CF_CHANNEL_NUM_RX_CHUNKS_PER_TRANSACTION \
{ \
CF_NAK_MAX_SEGMENTS, CF_NAK_MAX_SEGMENTS \
}
#define CF_CHANNEL_NUM_RX_CHUNKS_PER_TRANSACTION { CF_NAK_MAX_SEGMENTS, CF_NAK_MAX_SEGMENTS }

/**
* @brief TX chunks per transaction (per channel)
Expand All @@ -72,10 +69,7 @@
* @par Limits:
*
*/
#define CF_CHANNEL_NUM_TX_CHUNKS_PER_TRANSACTION \
{ \
CF_NAK_MAX_SEGMENTS, CF_NAK_MAX_SEGMENTS \
}
#define CF_CHANNEL_NUM_TX_CHUNKS_PER_TRANSACTION { CF_NAK_MAX_SEGMENTS, CF_NAK_MAX_SEGMENTS }

/**
* @brief Total number of chunks (tx, rx, all channels)
Expand Down
8 changes: 4 additions & 4 deletions config/default_cf_tblstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ typedef struct CF_ConfigTable

CF_ChannelConfig_t chan[CF_NUM_CHANNELS]; /**< \brief Channel configuration */

uint16 outgoing_file_chunk_size; /**< \brief maximum size of outgoing file data chunk in a PDU.
* Limited by CF_MAX_PDU_SIZE minus the PDU header(s) */
char tmp_dir[CF_FILENAME_MAX_PATH]; /**< \brief directory to put temp files */
char fail_dir[CF_FILENAME_MAX_PATH]; /**< \brief fail directory */
uint16 outgoing_file_chunk_size; /**< \brief maximum size of outgoing file data chunk in a PDU.
* Limited by CF_MAX_PDU_SIZE minus the PDU header(s) */
char tmp_dir[CF_FILENAME_MAX_PATH]; /**< \brief directory to put temp files */
char fail_dir[CF_FILENAME_MAX_PATH]; /**< \brief fail directory */
} CF_ConfigTable_t;

#endif
4 changes: 2 additions & 2 deletions config/eds_cf_extern_typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
************************************************************************/

/**
/**
* @file
*
* Declarations and prototypes for cf_extern_typedefs module
Expand All @@ -35,7 +35,7 @@
/* Define type mappings for CF-specific types */
typedef CF_QueueIdx_Enum_t CF_QueueIdx_t;

#define CF_QueueIdx_NUM (1 + EdsDataType_EdsEnum_CF_QueueIdx_t_MAX)
#define CF_QueueIdx_NUM (1 + EdsDataType_EdsEnum_CF_QueueIdx_t_MAX)
#define CF_GetSet_ValueID_MAX (1 + EdsDataType_EdsEnum_CF_GetSet_ValueID_t_MAX)

typedef CF_EntityId_Atom_t CF_EntityId_t;
Expand Down
4 changes: 2 additions & 2 deletions eds/cf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
<Entry name="poll_counter" type="BASE_TYPES/uint8" shortDescription="Number of active polling directories" />
<Entry name="playback_counter" type="BASE_TYPES/uint8" shortDescription="Number of active playback directories" />
<Entry name="frozen" type="BASE_TYPES/uint8" shortDescription="Frozen state" />
<PaddingEntry sizeInBits="56" shortDescription="Spare bytes for alignment"/>
<PaddingEntry sizeInBits="8" shortDescription="Spare bytes for alignment"/>
</EntryList>
</ContainerDataType>

Expand All @@ -276,7 +276,7 @@
<ContainerDataType name="HkPacket_Payload">
<EntryList>
<Entry name="counters" type="HKCommandCounters" />
<PaddingEntry sizeInBits="32" shortDescription="Spare bytes for alignment"/>
<PaddingEntry sizeInBits="32" shortDescription="Padding for 32-bit alignment"/>
<Entry name="channel_hk" type="Channel_Hk" />
</EntryList>
</ContainerDataType>
Expand Down
2 changes: 1 addition & 1 deletion fsw/inc/cf_interface_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
/**
* @brief Max filename and path length.
*
* @par Limits:
* @par Limits:
*
*/
#define CF_FILENAME_MAX_LEN CF_INTERFACE_CFGVAL(FILENAME_MAX_LEN)
Expand Down
4 changes: 2 additions & 2 deletions fsw/inc/cf_internal_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
* The maximum size dictated by cFE platform configuration
* parameter is OS_QUEUE_MAX_DEPTH
*/
#define CF_PIPE_DEPTH CF_INTERNAL_CFGVAL(PIPE_DEPTH)
#define DEFAULT_CF_PIPE_DEPTH 32
#define CF_PIPE_DEPTH CF_INTERNAL_CFGVAL(PIPE_DEPTH)
#define DEFAULT_CF_PIPE_DEPTH 32

/**
* @brief Number of max commanded playback files per chan.
Expand Down
8 changes: 4 additions & 4 deletions fsw/inc/cf_topicids.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
* These are for the normal CF app commands and telemtry
*/

#define CFE_MISSION_CF_CMD_TOPICID CFE_MISSION_CF_TIDVAL(CMD)
#define DEFAULT_CFE_MISSION_CF_CMD_TOPICID 0xB3 /**< \brief Message ID for commands */
#define CFE_MISSION_CF_CMD_TOPICID CFE_MISSION_CF_TIDVAL(CMD)
#define DEFAULT_CFE_MISSION_CF_CMD_TOPICID 0xB3 /**< \brief Message ID for commands */

#define CFE_MISSION_CF_SEND_HK_TOPICID CFE_MISSION_CF_TIDVAL(SEND_HK)
#define DEFAULT_CFE_MISSION_CF_SEND_HK_TOPICID 0xB4 /**< \brief Message ID to request housekeeping telemetry */

#define CFE_MISSION_CF_WAKE_UP_TOPICID CFE_MISSION_CF_TIDVAL(WAKE_UP)
#define DEFAULT_CFE_MISSION_CF_WAKE_UP_TOPICID 0xB5 /**< \brief Message ID for waking up the processing cycle */

#define CFE_MISSION_CF_HK_TLM_TOPICID CFE_MISSION_CF_TIDVAL(HK_TLM)
#define DEFAULT_CFE_MISSION_CF_HK_TLM_TOPICID 0xB0 /**< \brief Message ID for housekeeping telemetry */
#define CFE_MISSION_CF_HK_TLM_TOPICID CFE_MISSION_CF_TIDVAL(HK_TLM)
#define DEFAULT_CFE_MISSION_CF_HK_TLM_TOPICID 0xB0 /**< \brief Message ID for housekeeping telemetry */

#define CFE_MISSION_CF_EOT_TLM_TOPICID CFE_MISSION_CF_TIDVAL(EOT_TLM)
#define DEFAULT_CFE_MISSION_CF_EOT_TLM_TOPICID 0xB3 /**< \brief Message ID for end of transaction telemetry */
Expand Down
82 changes: 56 additions & 26 deletions fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,30 @@ void CF_CheckTables(void)
status = CFE_TBL_ReleaseAddress(CF_AppData.config_handle);
if (status < CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_INIT_TBL_CHECK_REL_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: error in CFE_TBL_ReleaseAddress (check), returned 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_TBL_CHECK_REL_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: error in CFE_TBL_ReleaseAddress (check), returned 0x%08lx",
(unsigned long)status);
CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
}

status = CFE_TBL_Manage(CF_AppData.config_handle);
if (status < CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_INIT_TBL_CHECK_MAN_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: error in CFE_TBL_Manage (check), returned 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_TBL_CHECK_MAN_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: error in CFE_TBL_Manage (check), returned 0x%08lx",
(unsigned long)status);
CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
}

status = CFE_TBL_GetAddress((void *)&CF_AppData.config_table, CF_AppData.config_handle);
if (status < CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_INIT_TBL_CHECK_GA_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: failed to get table address (check), returned 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_TBL_CHECK_GA_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: failed to get table address (check), returned 0x%08lx",
(unsigned long)status);
CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
}
}
Expand All @@ -109,12 +115,14 @@ CFE_Status_t CF_ValidateConfigTable(void *tbl_ptr)
}
else if (!tbl->rx_crc_calc_bytes_per_wakeup || (tbl->rx_crc_calc_bytes_per_wakeup & 0x3ff))
{
CFE_EVS_SendEvent(CF_INIT_CRC_ALIGN_ERR_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_INIT_CRC_ALIGN_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: config table has rx CRC size not aligned with 1024");
}
else if (tbl->outgoing_file_chunk_size > sizeof(CF_CFDP_PduFileDataContent_t))
{
CFE_EVS_SendEvent(CF_INIT_OUTGOING_SIZE_ERR_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_INIT_OUTGOING_SIZE_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: config table has outgoing file chunk size too large");
}
else
Expand All @@ -135,20 +143,27 @@ CFE_Status_t CF_TableInit(void)
{
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);
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);
if (status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_INIT_TBL_REG_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: error registering table, returned 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_TBL_REG_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: error registering table, returned 0x%08lx",
(unsigned long)status);
}
else
{
status = CFE_TBL_Load(CF_AppData.config_handle, CFE_TBL_SRC_FILE, CF_CONFIG_TABLE_FILENAME);
if (status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_INIT_TBL_LOAD_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: error loading table, returned 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_TBL_LOAD_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: error loading table, returned 0x%08lx",
(unsigned long)status);
}
}

Expand All @@ -157,8 +172,10 @@ CFE_Status_t CF_TableInit(void)
status = CFE_TBL_Manage(CF_AppData.config_handle);
if (status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_INIT_TBL_MANAGE_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: error in CFE_TBL_Manage, returned 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_TBL_MANAGE_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: error in CFE_TBL_Manage, returned 0x%08lx",
(unsigned long)status);
}
}

Expand All @@ -168,8 +185,10 @@ CFE_Status_t CF_TableInit(void)
/* status will be CFE_TBL_INFO_UPDATED because it was just loaded, but we can use CFE_SUCCESS too */
if ((status != CFE_TBL_INFO_UPDATED) && (status != CFE_SUCCESS))
{
CFE_EVS_SendEvent(CF_INIT_TBL_GETADDR_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: error getting table address, returned 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_TBL_GETADDR_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: error getting table address, returned 0x%08lx",
(unsigned long)status);
}
else
{
Expand All @@ -189,7 +208,7 @@ CFE_Status_t CF_TableInit(void)
CFE_Status_t CF_AppInit(void)
{
CFE_Status_t status;
const CFE_SB_MsgId_Atom_t MID_VALUES[] = {CF_CMD_MID, CF_SEND_HK_MID, CF_WAKE_UP_MID};
const CFE_SB_MsgId_Atom_t MID_VALUES[] = { CF_CMD_MID, CF_SEND_HK_MID, CF_WAKE_UP_MID };
uint32 i;

/* Zero-out global data structure */
Expand All @@ -209,8 +228,11 @@ CFE_Status_t CF_AppInit(void)
status = CFE_SB_CreatePipe(&CF_AppData.CmdPipe, CF_PIPE_DEPTH, CF_PIPE_NAME);
if (status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
"CF app: error creating pipe %s, returned 0x%08lx", CF_PIPE_NAME, (unsigned long)status);
CFE_EVS_SendEvent(CF_CR_PIPE_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF app: error creating pipe %s, returned 0x%08lx",
CF_PIPE_NAME,
(unsigned long)status);
}
}

Expand All @@ -222,7 +244,8 @@ CFE_Status_t CF_AppInit(void)
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("CF app: failed to subscribe to MID 0x%04lx, returned 0x%08lx",
(unsigned long)MID_VALUES[i], (unsigned long)status);
(unsigned long)MID_VALUES[i],
(unsigned long)status);
break;
}
}
Expand All @@ -240,8 +263,13 @@ CFE_Status_t CF_AppInit(void)

if (status == CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "CF Initialized. Version %d.%d.%d.%d",
CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION, CF_MISSION_REV);
CFE_EVS_SendEvent(CF_INIT_INF_EID,
CFE_EVS_EventType_INFORMATION,
"CF Initialized. Version %d.%d.%d.%d",
CF_MAJOR_VERSION,
CF_MINOR_VERSION,
CF_REVISION,
CF_MISSION_REV);
}

return status;
Expand Down Expand Up @@ -279,8 +307,10 @@ void CF_AppMain(void)
}
else if (status != CFE_SB_TIME_OUT && status != CFE_SB_NO_MESSAGE)
{
CFE_EVS_SendEvent(CF_INIT_MSG_RECV_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: exiting due to CFE_SB_ReceiveBuffer error 0x%08lx", (unsigned long)status);
CFE_EVS_SendEvent(CF_INIT_MSG_RECV_ERR_EID,
CFE_EVS_EventType_ERROR,
"CF: exiting due to CFE_SB_ReceiveBuffer error 0x%08lx",
(unsigned long)status);
CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
}
else
Expand Down
Loading
Loading