Skip to content

Commit

Permalink
Fix nasa#338, Move 'EID' to the end of Event ID names
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Jul 9, 2024
1 parent 7639e40 commit 1388d07
Show file tree
Hide file tree
Showing 18 changed files with 461 additions and 461 deletions.
138 changes: 69 additions & 69 deletions config/default_cf_fcncodes.h

Large diffs are not rendered by default.

248 changes: 124 additions & 124 deletions fsw/inc/cf_events.h

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ void CF_CheckTables(void)
status = CFE_TBL_ReleaseAddress(CF_AppData.config_handle);
if (status < CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_TBL_CHECK_REL, CFE_EVS_EventType_ERROR,
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.run_status = CFE_ES_RunStatus_APP_ERROR;
}

status = CFE_TBL_Manage(CF_AppData.config_handle);
if (status < CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_TBL_CHECK_MAN, CFE_EVS_EventType_ERROR,
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.run_status = 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_EID_ERR_INIT_TBL_CHECK_GA, CFE_EVS_EventType_ERROR,
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.run_status = CFE_ES_RunStatus_APP_ERROR;
}
Expand All @@ -105,16 +105,16 @@ CFE_Status_t CF_ValidateConfigTable(void *tbl_ptr)

if (!tbl->ticks_per_second)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_TPS, CFE_EVS_EventType_ERROR, "CF: config table has zero ticks per second");
CFE_EVS_SendEvent(CF_INIT_TPS_ERR_EID, CFE_EVS_EventType_ERROR, "CF: config table has zero ticks per second");
}
else if (!tbl->rx_crc_calc_bytes_per_wakeup || (tbl->rx_crc_calc_bytes_per_wakeup & 0x3ff))
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_CRC_ALIGN, 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_EID_ERR_INIT_OUTGOING_SIZE, 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 @@ -139,15 +139,15 @@ CFE_Status_t CF_TableInit(void)
CFE_TBL_OPT_SNGL_BUFFER | CFE_TBL_OPT_LOAD_DUMP, CF_ValidateConfigTable);
if (status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_TBL_REG, CFE_EVS_EventType_ERROR,
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_EID_ERR_INIT_TBL_LOAD, CFE_EVS_EventType_ERROR,
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,7 +157,7 @@ CFE_Status_t CF_TableInit(void)
status = CFE_TBL_Manage(CF_AppData.config_handle);
if (status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_TBL_MANAGE, CFE_EVS_EventType_ERROR,
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,7 +168,7 @@ 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_EID_ERR_INIT_TBL_GETADDR, CFE_EVS_EventType_ERROR,
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 Down Expand Up @@ -287,7 +287,7 @@ void CF_AppMain(void)
}
else if (status != CFE_SB_TIME_OUT && status != CFE_SB_NO_MESSAGE)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_MSG_RECV, CFE_EVS_EventType_ERROR,
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.run_status = CFE_ES_RunStatus_APP_ERROR;
}
Expand Down
42 changes: 21 additions & 21 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ CFE_Status_t CF_CFDP_RecvPh(uint8 chan_num, CF_Logical_PduBuffer_t *ph)
*/
if (CF_CFDP_DecodeHeader(ph->pdec, &ph->pdu_header) != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_TRUNCATION, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_TRUNCATION_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: PDU rejected due to EID/seq number field truncation");
++CF_AppData.hk.Payload.channel_hk[chan_num].counters.recv.error;
ret = CF_ERROR;
Expand All @@ -594,7 +594,7 @@ CFE_Status_t CF_CFDP_RecvPh(uint8 chan_num, CF_Logical_PduBuffer_t *ph)
*/
else if (CF_CODEC_IS_OK(ph->pdec) && ph->pdu_header.large_flag)
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_LARGE_FILE, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_LARGE_FILE_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: PDU with large file bit received (unsupported)");
++CF_AppData.hk.Payload.channel_hk[chan_num].counters.recv.error;
ret = CF_ERROR;
Expand All @@ -608,7 +608,7 @@ CFE_Status_t CF_CFDP_RecvPh(uint8 chan_num, CF_Logical_PduBuffer_t *ph)

if (!CF_CODEC_IS_OK(ph->pdec))
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_SHORT_HEADER, CFE_EVS_EventType_ERROR, "CF: PDU too short (%lu received)",
CFE_EVS_SendEvent(CF_PDU_SHORT_HEADER_ERR_EID, CFE_EVS_EventType_ERROR, "CF: PDU too short (%lu received)",
(unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
++CF_AppData.hk.Payload.channel_hk[chan_num].counters.recv.error;
ret = CF_SHORT_PDU_ERROR;
Expand Down Expand Up @@ -638,7 +638,7 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
CF_CFDP_DecodeMd(ph->pdec, &ph->int_header.md);
if (!CF_CODEC_IS_OK(ph->pdec))
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_MD_SHORT, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_MD_SHORT_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: metadata packet too short: %lu bytes received",
(unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error;
Expand All @@ -660,7 +660,7 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
&md->source_filename);
if (lv_ret < 0)
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_INVALID_SRC_LEN, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_INVALID_SRC_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: metadata PDU rejected due to invalid length in source filename of 0x%02x",
md->source_filename.length);
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error;
Expand All @@ -672,15 +672,15 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
sizeof(txn->history->fnames.dst_filename), &md->dest_filename);
if (lv_ret < 0)
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_INVALID_DST_LEN, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_INVALID_DST_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: metadata PDU rejected due to invalid length in dest filename of 0x%02x",
md->dest_filename.length);
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error;
ret = CF_PDU_METADATA_ERROR;
}
else
{
CFE_EVS_SendEvent(CF_EID_INF_PDU_MD_RECVD, CFE_EVS_EventType_INFORMATION,
CFE_EVS_SendEvent(CF_PDU_MD_RECVD_INF_EID, CFE_EVS_EventType_INFORMATION,
"CF: md received for source: %s, dest: %s", txn->history->fnames.src_filename,
txn->history->fnames.dst_filename);
}
Expand Down Expand Up @@ -717,7 +717,7 @@ CFE_Status_t CF_CFDP_RecvFd(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)

if (!CF_CODEC_IS_OK(ph->pdec))
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_FD_SHORT, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_FD_SHORT_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: filedata PDU too short: %lu bytes received", (unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
CF_CFDP_SetTxnStatus(txn, CF_TxnStatus_PROTOCOL_ERROR);
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error;
Expand All @@ -726,7 +726,7 @@ CFE_Status_t CF_CFDP_RecvFd(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
else if (ph->pdu_header.segment_meta_flag)
{
/* If recv PDU has the "segment_meta_flag" set, this is not currently handled in CF. */
CFE_EVS_SendEvent(CF_EID_ERR_PDU_FD_UNSUPPORTED, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_FD_UNSUPPORTED_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: filedata PDU with segment metadata received");
CF_CFDP_SetTxnStatus(txn, CF_TxnStatus_PROTOCOL_ERROR);
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error;
Expand All @@ -750,7 +750,7 @@ CFE_Status_t CF_CFDP_RecvEof(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)

if (!CF_CODEC_IS_OK(ph->pdec))
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_EOF_SHORT, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_EOF_SHORT_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: EOF PDU too short: %lu bytes received", (unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
ret = CF_SHORT_PDU_ERROR;
}
Expand All @@ -772,7 +772,7 @@ CFE_Status_t CF_CFDP_RecvAck(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)

if (!CF_CODEC_IS_OK(ph->pdec))
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_ACK_SHORT, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_ACK_SHORT_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: ACK PDU too short: %lu bytes received", (unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
ret = CF_SHORT_PDU_ERROR;
}
Expand All @@ -795,7 +795,7 @@ CFE_Status_t CF_CFDP_RecvFin(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)

if (!CF_CODEC_IS_OK(ph->pdec))
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_FIN_SHORT, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_FIN_SHORT_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: FIN PDU too short: %lu bytes received", (unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
ret = CF_SHORT_PDU_ERROR;
}
Expand All @@ -819,7 +819,7 @@ CFE_Status_t CF_CFDP_RecvNak(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)

if (!CF_CODEC_IS_OK(ph->pdec))
{
CFE_EVS_SendEvent(CF_EID_ERR_PDU_NAK_SHORT, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_PDU_NAK_SHORT_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: NAK PDU too short: %lu bytes received", (unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
ret = CF_SHORT_PDU_ERROR;
}
Expand Down Expand Up @@ -901,14 +901,14 @@ void CF_CFDP_RecvIdle(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_IDLE_MD, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_CFDP_IDLE_MD_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: got invalid md PDU -- abandoning transaction");
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error;
/* leave state as idle, which will reset below */
}
break;
default:
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_FD_UNHANDLED, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_CFDP_FD_UNHANDLED_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: unhandled file directive code 0x%02x in idle state", fdh->directive_code);
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error;
break;
Expand Down Expand Up @@ -963,7 +963,7 @@ CFE_Status_t CF_CFDP_InitEngine(void)
CF_AppData.config_table->chan[i].pipe_depth_input);
if (ret != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_SUB, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_INIT_SUB_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: failed to subscribe to MID 0x%lx, returned 0x%08lx",
(unsigned long)CF_AppData.config_table->chan[i].mid_input, (unsigned long)ret);
break;
Expand Down Expand Up @@ -994,7 +994,7 @@ CFE_Status_t CF_CFDP_InitEngine(void)

if (ret != OS_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_INIT_SEM, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_INIT_SEM_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: failed to get sem id for name %s, error=%ld",
CF_AppData.config_table->chan[i].sem_name, (long)ret);
break;
Expand Down Expand Up @@ -1229,7 +1229,7 @@ void CF_CFDP_InitTxnTxFile(CF_Transaction_t *txn, CF_CFDP_Class_t cfdp_class, ui
static void CF_CFDP_TxFile_Initiate(CF_Transaction_t *txn, CF_CFDP_Class_t cfdp_class, uint8 keep, uint8 chan,
uint8 priority, CF_EntityId_t dest_id)
{
CFE_EVS_SendEvent(CF_EID_INF_CFDP_S_START_SEND, CFE_EVS_EventType_INFORMATION,
CFE_EVS_SendEvent(CF_CFDP_S_START_SEND_INF_EID, CFE_EVS_EventType_INFORMATION,
"CF: start class %d tx of file %lu:%.*s -> %lu:%.*s", cfdp_class + 1,
(unsigned long)CF_AppData.config_table->local_eid, CF_FILENAME_MAX_LEN,
txn->history->fnames.src_filename, (unsigned long)dest_id, CF_FILENAME_MAX_LEN,
Expand Down Expand Up @@ -1270,7 +1270,7 @@ CFE_Status_t CF_CFDP_TxFile(const char *src_filename, const char *dst_filename,

if (chan->num_cmd_tx == CF_MAX_COMMANDED_PLAYBACK_FILES_PER_CHAN)
{
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_MAX_CMD_TX, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_CFDP_MAX_CMD_TX_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: max number of commanded files reached");
ret = CF_ERROR;
}
Expand Down Expand Up @@ -1310,7 +1310,7 @@ static CFE_Status_t CF_CFDP_PlaybackDir_Initiate(CF_Playback_t *pb, const char *
ret = OS_DirectoryOpen(&pb->dir_id, src_filename);
if (ret != OS_SUCCESS)
{
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_OPENDIR, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_CFDP_OPENDIR_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: failed to open playback directory %s, error=%ld", src_filename, (long)ret);
++CF_AppData.hk.Payload.channel_hk[chan].counters.fault.directory_read;
}
Expand Down Expand Up @@ -1357,7 +1357,7 @@ CFE_Status_t CF_CFDP_PlaybackDir(const char *src_filename, const char *dst_filen

if (i == CF_MAX_COMMANDED_PLAYBACK_DIRECTORIES_PER_CHAN)
{
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_DIR_SLOT, CFE_EVS_EventType_ERROR, "CF: no playback dir slot available");
CFE_EVS_SendEvent(CF_CFDP_DIR_SLOT_ERR_EID, CFE_EVS_EventType_ERROR, "CF: no playback dir slot available");
return CF_ERROR;
}

Expand Down
6 changes: 3 additions & 3 deletions fsw/src/cf_cfdp_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void CF_CFDP_R_DispatchRecv(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph,
else
{
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.spurious;
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_R_DC_INV, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_CFDP_R_DC_INV_ERR_EID, CFE_EVS_EventType_ERROR,
"CF R%d(%lu:%lu): received PDU with invalid directive code %d for sub-state %d",
(txn->state == CF_TxnState_R2), (unsigned long)txn->history->src_eid,
(unsigned long)txn->history->seq_num, fdh->directive_code,
Expand Down Expand Up @@ -120,7 +120,7 @@ void CF_CFDP_S_DispatchRecv(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph,
else
{
++CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.spurious;
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_S_DC_INV, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_CFDP_S_DC_INV_ERR_EID, CFE_EVS_EventType_ERROR,
"CF S%d(%lu:%lu): received PDU with invalid directive code %d for sub-state %d",
(txn->state == CF_TxnState_S2), (unsigned long)txn->history->src_eid,
(unsigned long)txn->history->seq_num, fdh->directive_code,
Expand All @@ -129,7 +129,7 @@ void CF_CFDP_S_DispatchRecv(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph,
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_S_NON_FD_PDU, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_CFDP_S_NON_FD_PDU_ERR_EID, CFE_EVS_EventType_ERROR,
"CF S%d(%lu:%lu): received non-file directive PDU", (txn->state == CF_TxnState_S2),
(unsigned long)txn->history->src_eid, (unsigned long)txn->history->seq_num);
}
Expand Down
Loading

0 comments on commit 1388d07

Please sign in to comment.