Skip to content

Commit

Permalink
Fix nasa#2175, Apply consistent Event ID names to common events
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Mar 12, 2023
1 parent e35c3da commit 21e0856
Show file tree
Hide file tree
Showing 38 changed files with 193 additions and 262 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: cFS Documentation and Guides
on:
push:
pull_request:
workflow_dispatch:
schedule:
# 10:45 PM UTC every Sunday
- cron: '45 22 * * 0'


jobs:
# Checks for duplicate actions. Skips push actions if there is a matching or
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: "Code Coverage Analysis"
on:
push:
pull_request:
workflow_dispatch:
schedule:
# 11:00 PM UTC every Sunday
- cron: '0 23 * * 0'

env:
SIMULATION: native
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: "CodeQL Analysis"
on:
push:
pull_request:
workflow_dispatch:
schedule:
# 11:15 PM UTC every Sunday
- cron: '15 23 * * 0'

jobs:
codeql:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ name: Format Check
on:
push:
pull_request:
workflow_dispatch:
schedule:
# 11:30 PM UTC every Sunday
- cron: '30 23 * * 0'

jobs:
format-check:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: "Functional Test"
on:
push:
pull_request:
workflow_dispatch:
schedule:
# 11:45 PM UTC every Sunday
- cron: '45 23 * * 0'

env:
SIMULATION: native
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ name: Static Analysis
on:
push:
pull_request:
workflow_dispatch:
schedule:
# 11:59 PM UTC every Sunday
- cron: '59 23 * * 0'

jobs:
static-analysis:
Expand Down
8 changes: 0 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Changelog

## Development Build: v7.0.0-rc4+dev250
- CFE_TBL_FILEDEF does not need static
- See <https://github.com/nasa/cFE/pull/2244>

## Development Build: v7.0.0-rc4+dev246
- Adds workflow_dispatch to all workflows
- See <https://github.com/nasa/cFE/pull/2236>

## Development Build: v7.0.0-rc4+dev242
- EDS Updates to match the current mainline
- Update UTs to use correct cmd types
Expand Down
18 changes: 18 additions & 0 deletions docs/cFS_IdentifierNamingConvention.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,24 @@ Some general rules/recommendations to follow for cFS identifiers:
__NOTE__: a sufficient number of terms must always be used in order to ensure uniqueness
and avoid ambiguity.

8. Event IDs in cFE (and across the other cFS components/apps) should be capitalized and use
a consistent abbreviated naming pattern in the following order:
&lt;APPLICATION\_NAME&gt;\_&lt;EVENT&gt;\_&lt;EVENT\_TYPE&gt;\_&lt;EID&gt;
<br>
For example:
| Event ID | Application | Command/Event Description | Event Type | Event ID Suffix |
| :---: | :---: | :---: | :---: | :---: |
| CFE_EVS_NOOP_INF_EID | CFE Event Service | NOOP Command | Informational | Event ID |
| HS_CR_PIPE_ERR_EID | Health & Safety | Create Pipe Error | Error | Event ID |

Common events should be named consistently across applications for ease of recognition.
<br>
Common command/event descriptions include:
\_MID\_ERR\_EID: Invalid Message ID Received
\_NOOP\_INF\_EID: No-op Command Success
\_INIT\_INF\_EID: Applicaiton Initialization Success
\_RESET\_INF\_EID: Reset Command Counters Command Success


## Applicability to Actions / Commands

Expand Down
2 changes: 1 addition & 1 deletion docs/src/cfe_es.dox
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@
message length embedded within the header (from `CFE_MSG_GetSize()`) matches the expected
length of that message, based on the size of the C structure defining that command.
If there is any discrepancy between the expected and actual message size, ES will generate
the #CFE_ES_LEN_ERR_EID event, increment the command error counter (\ES_CMDEC), and the
the #CFE_ES_CMD_LEN_ERR_EID event, increment the command error counter (\ES_CMDEC), and the
command will _not_ be accepted for processing.

The following is a list of commands that are processed by the cFE Executive Services Task.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/cfe_evs.dox
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
** message length embedded within the header (from `CFE_MSG_GetSize()`) matches the expected
** length of that message, based on the size of the C structure defining that command.
** If there is any discrepancy between the expected and actual message size, EVS will generate
** the #CFE_EVS_LEN_ERR_EID event, increment the command error counter (\EVS_CMDEC), and the
** the #CFE_EVS_CMD_LEN_ERR_EID event, increment the command error counter (\EVS_CMDEC), and the
** command will _not_ be accepted for processing.
**
** The following is a list of commands that are processed by the cFE Event Services Task.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/cfe_sb.dox
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@
** message length embedded within the header (from `CFE_MSG_GetSize()`) matches the expected
** length of that message, based on the size of the C structure defining that command.
** If there is any discrepancy between the expected and actual message size, SB will generate
** the #CFE_SB_LEN_ERR_EID event, increment the command error counter (\SB_CMDEC), and the
** the #CFE_SB_CMD_LEN_ERR_EID event, increment the command error counter (\SB_CMDEC), and the
** command will _not_ be accepted for processing.
**
** The following is a list of commands that are processed by the cFE Software Bus Task.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/cfe_tbl.dox
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
** message length embedded within the header (from `CFE_MSG_GetSize()`) matches the expected
** length of that message, based on the size of the C structure defining that command.
** If there is any discrepancy between the expected and actual message size, TBL will generate
** the #CFE_TBL_LEN_ERR_EID event, increment the command error counter (\TBL_CMDEC), and the
** the #CFE_TBL_CMD_LEN_ERR_EID event, increment the command error counter (\TBL_CMDEC), and the
** command will _not_ be accepted for processing.
**
** The following is a list of commands that are processed by the cFE Table Services Task.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/cfe_time.dox
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@
** message length embedded within the header (from `CFE_MSG_GetSize()`) matches the expected
** length of that message, based on the size of the C structure defining that command.
** If there is any discrepancy between the expected and actual message size, TIME will generate
** the #CFE_TIME_LEN_ERR_EID event, increment the command error counter (\TIME_CMDEC), and the
** the #CFE_TIME_CMD_LEN_ERR_EID event, increment the command error counter (\TIME_CMDEC), and the
** command will _not_ be accepted for processing.
**
** The following is a list of commands that are processed by the cFE Time Services Task.
Expand Down
93 changes: 20 additions & 73 deletions modules/core_api/fsw/inc/cfe_tbl_filedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,84 +49,30 @@
#include "cfe_tbl_extern_typedefs.h" /* for "CFE_TBL_FileHdr_t" definition */
#include "cfe_fs_extern_typedefs.h" /* for "CFE_FS_HDR_DESC_MAX_LEN" definition */

/**
* \brief Table File summary object
*
/*
* The definition of the file definition metadata that can be used by
* external tools (e.g. elf2cfetbl) to generate CFE table data files.
*/
typedef struct CFE_TBL_FileDef
{
/**
* \brief Name of instantiated variable that contains desired table image
*
* \note For consistency and future compatibility with auto-generated table files
* and table definitions, the "ObjectName" should match the table struct typedef
* name without the "_t" suffix. For example, the limit checker action table (ADT)
* is defined by a type called "LC_ADT_t", the ObjectName should be "LC_ADT".
*
* This naming convention allows the type name to be inferred from the ObjectName
* (and vice-versa) without having to directly specify both the type name and object
* name here.
*
* Although the traditional elf2cfetbl tool does not currently do any type checking,
* future tool versions may add more robust type verification and therefore need to
* know the type name as well as the object name.
*/
char ObjectName[64];

/**
* \brief Name of Table as defined onboard
*
* This should be in the form of "APP_NAME.TABLE_NAME" where APP_NAME matches what
* the app is named at runtime (the 4th column of cfe_es_startup.scr) and TABLE_NAME
* matches the 2nd parameter of the call to CFE_TBL_Register(). Preferably the
* TABLE_NAME should also match the ObjectName here in this structure, although this
* is not strictly required, it helps keep things consistent.
*/
char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN];

/**
* \brief Description of table image that is included in cFE File Header
*
* This is a free-form text string that can be any meaningful value
*/
char Description[CFE_FS_HDR_DESC_MAX_LEN];

/**
* \brief Default filename to be used for output of elf2cfetbl utility
*
* This must match the expected table file name, which is the name of the source file but
* the ".c" extension replaced with ".tbl". This is the filename only - do not include a
* directory/path name here, it can be copied to any runtime directory on the target by
* external scripts, but should not be renamed.
*/
char TgtFilename[CFE_MISSION_MAX_FILE_LEN];

/**
* \brief Size, in bytes, of instantiated object
*
* This may be used by tools to check for consistency between the actual defined table size
* and the expected table size. This is set automatically via the #CFE_TBL_FILEDEF macro.
*/
uint32 ObjectSize;
char ObjectName[64]; /**< \brief Name of instantiated variable that contains desired table image */
char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN]; /**< \brief Name of Table as defined onboard */
char Description[CFE_FS_HDR_DESC_MAX_LEN]; /**< \brief Description of table image that is included in cFE File
Header */
char TgtFilename[CFE_MISSION_MAX_FILE_LEN]; /**< \brief Default filename to be used for output of elf2cfetbl utility
*/
uint32 ObjectSize; /**< \brief Size, in bytes, of instantiated object */
} CFE_TBL_FileDef_t;

/**
* \brief Macro to assist in with table definition object declaration
*
* See notes in the #CFE_TBL_FileDef_t structure type about naming conventions and
* recommended practices for the various fields.
*
* The CFE_TBL_FILEDEF macro can be used to simplify the declaration of a table image
* when using the elf2cfetbl utility.
*
* Note that the macro adds a NULL at the end to ensure that it is null-terminated. (C allows
* a struct to be statically initialized with a string exactly the length of the array, which
* loses the null terminator.) This means the actual length limit of the fields are the above
* LEN - 1.
*
* An example of the source code and how this macro would be used is as follows:
/** The CFE_TBL_FILEDEF macro can be used to simplify the declaration of a table image when using the elf2cfetbl
utility.
**
** Note that the macro adds a NULL at the end to ensure that it is null-terminated. (C allows
** a struct to be statically initialized with a string exactly the length of the array, which
** loses the null terminator.) This means the actual length limit of the fields are the above
** LEN - 1.
**
** An example of the source code and how this macro would be used is as follows:
\code
#include "cfe_tbl_filedef.h"
Expand All @@ -146,8 +92,9 @@ typedef struct CFE_TBL_FileDef
\endcode
*/

#define CFE_TBL_FILEDEF(ObjName, TblName, Desc, Filename) \
CFE_TBL_FileDef_t CFE_TBL_FileDef = {#ObjName "\0", #TblName "\0", #Desc "\0", #Filename "\0", sizeof(ObjName)};
#define CFE_TBL_FILEDEF(ObjName, TblName, Desc, Filename) \
static OS_USED CFE_TBL_FileDef_t CFE_TBL_FileDef = {#ObjName "\0", #TblName "\0", #Desc "\0", #Filename "\0", \
sizeof(ObjName)};

/*************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define CFE_VERSION_H

/* Development Build Macro Definitions */
#define CFE_BUILD_NUMBER 250 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_NUMBER 242 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */

/* See \ref cfsversions for definitions */
Expand Down
4 changes: 2 additions & 2 deletions modules/es/eds/cfe_es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@

Evidence of failure may be found in the following telemetry:
- \b \c \ES_CMDEC - command error counter will increment
- the #CFE_ES_LEN_ERR_EID error event message will be generated
- the #CFE_ES_CMD_LEN_ERR_EID error event message will be generated

\par Criticality
None
Expand Down Expand Up @@ -865,7 +865,7 @@

Evidence of failure may be found in the following telemetry:
- \b \c \ES_CMDEC - command error counter will increment
- the #CFE_ES_LEN_ERR_EID error event message will be generated
- the #CFE_ES_CMD_LEN_ERR_EID error event message will be generated

\par Criticality

Expand Down
4 changes: 2 additions & 2 deletions modules/es/fsw/inc/cfe_es_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
*
* Invalid command code for message ID #CFE_ES_CMD_MID received on the ES message pipe.
*/
#define CFE_ES_CC1_ERR_EID 22
#define CFE_ES_CC_ERR_EID 22

/**
* \brief ES Invalid Command Length Event ID
Expand All @@ -280,7 +280,7 @@
*
* Invalid length for the command code in message ID #CFE_ES_CMD_MID received on the ES message pipe.
*/
#define CFE_ES_LEN_ERR_EID 23
#define CFE_ES_CMD_LEN_ERR_EID 23

/**
* \brief ES Restart Command Invalid Restart Type Event ID
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
**
** Evidence of failure may be found in the following telemetry:
** - \b \c \ES_CMDEC - command error counter will increment
** - the #CFE_ES_LEN_ERR_EID error event message will be generated
** - the #CFE_ES_CMD_LEN_ERR_EID error event message will be generated
**
** \par Criticality
** None
Expand Down
4 changes: 2 additions & 2 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr)
break;

default:
CFE_EVS_SendEvent(CFE_ES_CC1_ERR_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CFE_ES_CC_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid ground command code: ID = 0x%X, CC = %d",
(unsigned int)CFE_SB_MsgIdToValue(MessageID), (int)CommandCode);
CFE_ES_Global.TaskData.CommandErrorCounter++;
Expand Down Expand Up @@ -1702,7 +1702,7 @@ bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength)
CFE_MSG_GetMsgId(MsgPtr, &MsgId);
CFE_MSG_GetFcnCode(MsgPtr, &FcnCode);

CFE_EVS_SendEvent(CFE_ES_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CFE_ES_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u",
(unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength,
(unsigned int)ExpectedLength);
Expand Down
Loading

0 comments on commit 21e0856

Please sign in to comment.