Skip to content

Commit

Permalink
Merge pull request #2272 from thnkslprpt:fix-1407-add-event-for-evs-l…
Browse files Browse the repository at this point in the history
…og-header-write-fail

Fix #1407, Add error report on EVS failure during log header write
  • Loading branch information
GitHub Actions committed Jun 8, 2023
2 parents bfc4cb6 + 4eeba08 commit e9d21f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/evs/fsw/inc/cfe_evs_eventids.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@
*/
#define CFE_EVS_ERR_CRDATFILE_EID 13

/**
* \brief EVS Write File Header to Log File Failure Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Bytes written during Write File Header to Log File was not equal to the expected header size.
*/
#define CFE_EVS_WRITE_HEADER_ERR_EID 14

/**
* \brief EVS Invalid Command Code Received Event ID
*
Expand Down
6 changes: 6 additions & 0 deletions modules/evs/fsw/src/cfe_evs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data)
LogFilename);
}
}
else
{
EVS_SendEvent(CFE_EVS_WRITE_HEADER_ERR_EID, CFE_EVS_EventType_ERROR,
"Write File Header to Log File Error: WriteHdr RC: %d, Expected: %d, filename = %s",
(int)BytesWritten, (int)sizeof(LogFileHdr), LogFilename);
}

OS_close(LogFileHandle);
}
Expand Down

0 comments on commit e9d21f2

Please sign in to comment.