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 Mar 31, 2023
1 parent 8626a92 commit 4db3179
Show file tree
Hide file tree
Showing 18 changed files with 471 additions and 471 deletions.
248 changes: 124 additions & 124 deletions fsw/inc/cf_events.h

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions fsw/inc/cf_msg.h

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,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 @@ -119,18 +119,18 @@ 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");
ret = no_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");
ret = crc_alignment; /* must be 1024-byte aligned */
}
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");
ret = outgoing_chunk_size; /* must be smaller than file data character array */
}
Expand All @@ -156,15 +156,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 @@ -174,7 +174,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 @@ -185,7 +185,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 @@ -308,7 +308,7 @@ void CF_ProcessMsg(CFE_SB_Buffer_t *msg)

default:
++CF_AppData.hk.counters.err;
CFE_EVS_SendEvent(CF_EID_ERR_INIT_CMD_LENGTH, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CF_INIT_CMD_LENGTH_ERR_EID, CFE_EVS_EventType_ERROR,
"CF: invalid command packet id=0x%lx", (unsigned long)CFE_SB_MsgIdToValue(msg_id));
break;
}
Expand Down Expand Up @@ -352,7 +352,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 @@ -596,7 +596,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.channel_hk[chan_num].counters.recv.error;
ret = CF_ERROR;
Expand All @@ -609,7 +609,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.channel_hk[chan_num].counters.recv.error;
ret = CF_ERROR;
Expand All @@ -623,7 +623,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.channel_hk[chan_num].counters.recv.error;
ret = CF_SHORT_PDU_ERROR;
Expand Down Expand Up @@ -653,7 +653,7 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *t, 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.channel_hk[t->chan_num].counters.recv.error;
Expand All @@ -675,7 +675,7 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *t, 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.channel_hk[t->chan_num].counters.recv.error;
Expand All @@ -687,15 +687,15 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
&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.channel_hk[t->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", t->history->fnames.src_filename,
t->history->fnames.dst_filename);
}
Expand Down Expand Up @@ -732,7 +732,7 @@ CFE_Status_t CF_CFDP_RecvFd(CF_Transaction_t *t, 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(t, CF_TxnStatus_PROTOCOL_ERROR);
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
Expand All @@ -741,7 +741,7 @@ CFE_Status_t CF_CFDP_RecvFd(CF_Transaction_t *t, 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(t, CF_TxnStatus_PROTOCOL_ERROR);
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
Expand All @@ -765,7 +765,7 @@ CFE_Status_t CF_CFDP_RecvEof(CF_Transaction_t *t, 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 @@ -787,7 +787,7 @@ CFE_Status_t CF_CFDP_RecvAck(CF_Transaction_t *t, 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 @@ -810,7 +810,7 @@ CFE_Status_t CF_CFDP_RecvFin(CF_Transaction_t *t, 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 @@ -834,7 +834,7 @@ CFE_Status_t CF_CFDP_RecvNak(CF_Transaction_t *t, 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 @@ -916,14 +916,14 @@ void CF_CFDP_RecvIdle(CF_Transaction_t *t, 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.channel_hk[t->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.channel_hk[t->chan_num].counters.recv.error;
break;
Expand Down Expand Up @@ -978,7 +978,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 @@ -1009,7 +1009,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 @@ -1244,7 +1244,7 @@ void CF_CFDP_InitTxnTxFile(CF_Transaction_t *t, CF_CFDP_Class_t cfdp_class, uint
static void CF_CFDP_TxFile_Initiate(CF_Transaction_t *t, 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,
t->history->fnames.src_filename, (unsigned long)dest_id, CF_FILENAME_MAX_LEN,
Expand Down Expand Up @@ -1285,7 +1285,7 @@ CFE_Status_t CF_CFDP_TxFile(const char *src_filename, const char *dst_filename,

if (c->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 @@ -1325,7 +1325,7 @@ static CFE_Status_t CF_CFDP_PlaybackDir_Initiate(CF_Playback_t *p, const char *s
ret = OS_DirectoryOpen(&p->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.channel_hk[chan].counters.fault.directory_read;
}
Expand Down Expand Up @@ -1372,7 +1372,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 *t, CF_Logical_PduBuffer_t *ph,
else
{
++CF_AppData.hk.channel_hk[t->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",
(t->state == CF_TxnState_R2), (unsigned long)t->history->src_eid,
(unsigned long)t->history->seq_num, fdh->directive_code, t->state_data.r.sub_state);
Expand Down Expand Up @@ -119,15 +119,15 @@ void CF_CFDP_S_DispatchRecv(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph,
else
{
++CF_AppData.hk.channel_hk[t->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",
(t->state == CF_TxnState_S2), (unsigned long)t->history->src_eid,
(unsigned long)t->history->seq_num, fdh->directive_code, t->state_data.s.sub_state);
}
}
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", (t->state == CF_TxnState_S2),
(unsigned long)t->history->src_eid, (unsigned long)t->history->seq_num);
}
Expand Down
Loading

0 comments on commit 4db3179

Please sign in to comment.