diff --git a/modules/evs/arch_build.cmake b/modules/evs/arch_build.cmake new file mode 100644 index 000000000..63c50f8e2 --- /dev/null +++ b/modules/evs/arch_build.cmake @@ -0,0 +1,32 @@ +########################################################### +# +# EVS Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the EVS configuration +set(EVS_PLATFORM_CONFIG_FILE_LIST + cfe_evs_internal_cfg.h + cfe_evs_msgids.h + cfe_evs_platform_cfg.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(EVS_CFGFILE ${EVS_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${EVS_CFGFILE}" NAME_WE) + if (DEFINED EVS_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${EVS_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${EVS_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h b/modules/evs/config/default_cfe_evs_extern_typedefs.h similarity index 92% rename from modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h rename to modules/evs/config/default_cfe_evs_extern_typedefs.h index 1b8124d41..d10de9fb8 100644 --- a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h +++ b/modules/evs/config/default_cfe_evs_extern_typedefs.h @@ -25,16 +25,6 @@ #ifndef CFE_EVS_EXTERN_TYPEDEFS_H #define CFE_EVS_EXTERN_TYPEDEFS_H -/* This header may be generated from an EDS file, - * tools are available and the feature is enabled */ -#ifdef CFE_EDS_ENABLED_BUILD - -/* Use the EDS generated version of these types */ -#include "cfe_evs_eds_typedefs.h" - -#else -/* Use the local definitions of these types */ - #include "common_types.h" /** @@ -167,6 +157,4 @@ enum CFE_EVS_EventOutput */ typedef uint8 CFE_EVS_EventOutput_Enum_t; -#endif /* CFE_EDS_ENABLED_BUILD */ - #endif /* CFE_EVS_EXTERN_TYPEDEFS_H */ diff --git a/modules/evs/fsw/inc/cfe_evs_msg.h b/modules/evs/config/default_cfe_evs_fcncodes.h similarity index 68% rename from modules/evs/fsw/inc/cfe_evs_msg.h rename to modules/evs/config/default_cfe_evs_fcncodes.h index 1a106fcd3..7f639081e 100644 --- a/modules/evs/fsw/inc/cfe_evs_msg.h +++ b/modules/evs/config/default_cfe_evs_fcncodes.h @@ -18,27 +18,15 @@ /** * @file + * Specification for the CFE Event Services (CFE_EVS) command function codes * - * Title: Event Services Message definition header file Header File - * - * Purpose: - * Unit specification for Event services command codes and data structures. - * - * Design Notes: - * - * References: - * Flight Software Branch C Coding Standard Version 1.0a - * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. */ - -#ifndef CFE_EVS_MSG_H -#define CFE_EVS_MSG_H - -/********************************** Include Files ************************************/ -#include "common_types.h" /* Basic data types */ -#include "cfe_msg_hdr.h" /* for header definitions */ -#include "cfe_evs_extern_typedefs.h" /* for EVS-specific types such as CFE_EVS_LogMode_Enum_t */ -#include "cfe_es_extern_typedefs.h" /* for CFE_ES_AppId_t type */ +#ifndef CFE_EVS_FCNCODES_H +#define CFE_EVS_FCNCODES_H /** \name Event Services Command Codes */ /** \{ */ @@ -885,384 +873,4 @@ #define CFE_EVS_CLEAR_LOG_CC 20 /** \} */ -/* Event Type bit masks */ -#define CFE_EVS_DEBUG_BIT 0x0001 -#define CFE_EVS_INFORMATION_BIT 0x0002 -#define CFE_EVS_ERROR_BIT 0x0004 -#define CFE_EVS_CRITICAL_BIT 0x0008 - -/* Output Port bit masks */ -#define CFE_EVS_PORT1_BIT 0x0001 -#define CFE_EVS_PORT2_BIT 0x0002 -#define CFE_EVS_PORT3_BIT 0x0004 -#define CFE_EVS_PORT4_BIT 0x0008 - -/****************** Structure Definitions *********************/ - -/** -** \brief Command with no additional arguments -**/ -typedef struct CFE_EVS_NoArgsCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ -} CFE_EVS_NoArgsCmd_t; - -/* - * The NoArgsCmd is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_NoopCmd_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ResetCountersCmd_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ClearLogCmd_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_SendHkCmd_t; - -/** -** \brief Write Event Log to File Command Payload -** -** For command details, see #CFE_EVS_WRITE_LOG_DATA_FILE_CC -** -**/ -typedef struct CFE_EVS_LogFileCmd_Payload -{ - char LogFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where log data is to be written */ -} CFE_EVS_LogFileCmd_Payload_t; - -/** - * \brief Write Event Log to File Command - */ -typedef struct CFE_EVS_WriteLogDataFileCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_LogFileCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_WriteLogDataFileCmd_t; - -/** -** \brief Write Event Services Application Information to File Command Payload -** -** For command details, see #CFE_EVS_WRITE_APP_DATA_FILE_CC -** -**/ -typedef struct CFE_EVS_AppDataCmd_Payload -{ - char AppDataFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where application data is to be written */ -} CFE_EVS_AppDataCmd_Payload_t; - -/** - * \brief Write Event Services Application Information to File Command - */ -typedef struct CFE_EVS_WriteAppDataFileCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppDataCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_WriteAppDataFileCmd_t; - -/** -** \brief Set Log Mode Command Payload -** -** For command details, see #CFE_EVS_SET_LOG_MODE_CC -** -**/ -typedef struct CFE_EVS_SetLogMode_Payload -{ - CFE_EVS_LogMode_Enum_t LogMode; /**< \brief Mode to use in the command*/ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_SetLogMode_Payload_t; - -/** - * \brief Set Log Mode Command - */ -typedef struct CFE_EVS_SetLogModeCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_SetLogMode_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_SetLogModeCmd_t; - -/** -** \brief Set Event Format Mode Command Payload -** -** For command details, see #CFE_EVS_SET_EVENT_FORMAT_MODE_CC -** -**/ -typedef struct CFE_EVS_SetEventFormatCode_Payload -{ - CFE_EVS_MsgFormat_Enum_t MsgFormat; /**< \brief Mode to use in the command*/ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_SetEventFormatMode_Payload_t; - -/** - * \brief Set Event Format Mode Command - */ -typedef struct CFE_EVS_SetEventFormatModeCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_SetEventFormatMode_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_SetEventFormatModeCmd_t; - -/** -** \brief Generic Bitmask Command Payload -** -** For command details, see #CFE_EVS_ENABLE_EVENT_TYPE_CC, #CFE_EVS_DISABLE_EVENT_TYPE_CC, -** #CFE_EVS_ENABLE_PORTS_CC and/or #CFE_EVS_DISABLE_PORTS_CC -** -**/ -typedef struct CFE_EVS_BitMaskCmd_Payload -{ - uint8 BitMask; /**< \brief BitMask to use in the command */ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_BitMaskCmd_Payload_t; - -/** - * \brief Generic Bitmask Command - */ -typedef struct CFE_EVS_BitMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_BitMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_BitMaskCmd_t; - -/* - * The CFE_EVS_BitMaskCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnablePortsCmd_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisablePortsCmd_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnableEventTypeCmd_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisableEventTypeCmd_t; - -/** -** \brief Generic App Name Command Payload -** -** For command details, see #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC, -** #CFE_EVS_RESET_APP_COUNTER_CC and/or #CFE_EVS_RESET_ALL_FILTERS_CC -** -**/ -typedef struct CFE_EVS_AppNameCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ -} CFE_EVS_AppNameCmd_Payload_t; - -/** - * \brief Generic App Name Command - */ -typedef struct CFE_EVS_AppNameCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameCmd_t; - -/* - * The CFE_EVS_AppNameCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameCmd_t CFE_EVS_EnableAppEventsCmd_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_DisableAppEventsCmd_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAppCounterCmd_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAllFiltersCmd_t; - -/** -** \brief Generic App Name and Event ID Command Payload -** -** For command details, see #CFE_EVS_RESET_FILTER_CC and #CFE_EVS_DELETE_EVENT_FILTER_CC -** -**/ -typedef struct CFE_EVS_AppNameEventIDCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ - uint16 EventID; /**< \brief Event ID to use in the command*/ -} CFE_EVS_AppNameEventIDCmd_Payload_t; - -/** - * \brief Generic App Name and Event ID Command - */ -typedef struct CFE_EVS_AppNameEventIDCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameEventIDCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameEventIDCmd_t; - -/* - * The CFE_EVS_AppNameEventIDCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_ResetFilterCmd_t; -typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_DeleteEventFilterCmd_t; - -/** -** \brief Generic App Name and Bitmask Command Payload -** -** For command details, see #CFE_EVS_ENABLE_APP_EVENT_TYPE_CC and/or #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC -** -**/ -typedef struct CFE_EVS_AppNameBitMaskCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ - uint8 BitMask; /**< \brief BitMask to use in the command*/ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_AppNameBitMaskCmd_Payload_t; - -/** - * \brief Generic App Name and Bitmask Command - */ -typedef struct CFE_EVS_AppNameBitMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameBitMaskCmd_t; - -/* - * The CFE_EVS_AppNameBitMaskCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_EnableAppEventTypeCmd_t; -typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_DisableAppEventTypeCmd_t; - -/** -** \brief Generic App Name, Event ID, Mask Command Payload -** -** For command details, see #CFE_EVS_SET_FILTER_CC, #CFE_EVS_ADD_EVENT_FILTER_CC -** and/or #CFE_EVS_DELETE_EVENT_FILTER_CC -** -**/ -typedef struct CFE_EVS_AppNameEventIDMaskCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ - uint16 EventID; /**< \brief Event ID to use in the command*/ - uint16 Mask; /**< \brief Mask to use in the command */ -} CFE_EVS_AppNameEventIDMaskCmd_Payload_t; - -/** - * \brief Generic App Name, Event ID, Mask Command - */ -typedef struct CFE_EVS_AppNameEventIDMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameEventIDMaskCmd_t; - -/* - * The CFE_EVS_AppNameEventIDMaskCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_AddEventFilterCmd_t; -typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_SetFilterCmd_t; - -/*************************************************************************/ -/**********************************/ -/* Telemetry Message Data Formats */ -/**********************************/ -typedef struct CFE_EVS_AppTlmData -{ - CFE_ES_AppId_t AppID; /**< \cfetlmmnemonic \EVS_APPID - \brief Numerical application identifier */ - uint16 AppMessageSentCounter; /**< \cfetlmmnemonic \EVS_APPMSGSENTC - \brief Application message sent counter */ - uint8 AppEnableStatus; /**< \cfetlmmnemonic \EVS_APPENASTAT - \brief Application event service enable status */ - uint8 AppMessageSquelchedCounter; /**< \cfetlmmnemonic \EVS_SQUELCHEDC - \brief Number of events squelched */ -} CFE_EVS_AppTlmData_t; - -/** -** \cfeevstlm Event Services Housekeeping Telemetry Packet -**/ -typedef struct CFE_EVS_HousekeepingTlm_Payload -{ - uint8 CommandCounter; /**< \cfetlmmnemonic \EVS_CMDPC - \brief EVS Command Counter */ - uint8 CommandErrorCounter; /**< \cfetlmmnemonic \EVS_CMDEC - \brief EVS Command Error Counter */ - uint8 MessageFormatMode; /**< \cfetlmmnemonic \EVS_MSGFMTMODE - \brief Event message format mode (short/long) */ - uint8 MessageTruncCounter; /**< \cfetlmmnemonic \EVS_MSGTRUNC - \brief Event message truncation counter */ - - uint8 UnregisteredAppCounter; /**< \cfetlmmnemonic \EVS_UNREGAPPC - \brief Unregistered application message send counter */ - uint8 OutputPort; /**< \cfetlmmnemonic \EVS_OUTPUTPORT - \brief Output port mask */ - uint8 LogFullFlag; /**< \cfetlmmnemonic \EVS_LOGFULL - \brief Local event log full flag */ - uint8 LogMode; /**< \cfetlmmnemonic \EVS_LOGMODE - \brief Local event logging mode (overwrite/discard) */ - - uint16 MessageSendCounter; /**< \cfetlmmnemonic \EVS_MSGSENTC - \brief Event message send counter */ - uint16 LogOverflowCounter; /**< \cfetlmmnemonic \EVS_LOGOVERFLOWC - \brief Local event log overflow counter */ - - uint8 LogEnabled; /**< \cfetlmmnemonic \EVS_LOGENABLED - \brief Current event log enable/disable state */ - uint8 Spare1; /**< \cfetlmmnemonic \EVS_HK_SPARE1 - \brief Padding for 32 bit boundary */ - uint8 Spare2; /**< \cfetlmmnemonic \EVS_HK_SPARE2 - \brief Padding for 32 bit boundary */ - uint8 Spare3; /**< \cfetlmmnemonic \EVS_HK_SPARE3 - \brief Padding for 32 bit boundary */ - - CFE_EVS_AppTlmData_t AppData[CFE_MISSION_ES_MAX_APPLICATIONS]; /**< \cfetlmmnemonic \EVS_APP - \brief Array of registered application table data */ -} CFE_EVS_HousekeepingTlm_Payload_t; - -typedef struct CFE_EVS_HousekeepingTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_EVS_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_EVS_HousekeepingTlm_t; - -/** Telemetry packet structures */ - -typedef struct CFE_EVS_PacketID -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \EVS_APPNAME - \brief Application name */ - uint16 EventID; /**< \cfetlmmnemonic \EVS_EVENTID - \brief Numerical event identifier */ - uint16 EventType; /**< \cfetlmmnemonic \EVS_EVENTTYPE - \brief Numerical event type identifier */ - uint32 SpacecraftID; /**< \cfetlmmnemonic \EVS_SCID - \brief Spacecraft identifier */ - uint32 ProcessorID; /**< \cfetlmmnemonic \EVS_PROCESSORID - \brief Numerical processor identifier */ -} CFE_EVS_PacketID_t; - -/** -** \cfeevstlm Event Message Telemetry Packet (Long format) -**/ -typedef struct CFE_EVS_LongEventTlm_Payload -{ - CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ - char Message[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; /**< \cfetlmmnemonic \EVS_EVENT - \brief Event message string */ - uint8 Spare1; /**< \cfetlmmnemonic \EVS_SPARE1 - \brief Structure padding */ - uint8 Spare2; /**< \cfetlmmnemonic \EVS_SPARE2 - \brief Structure padding */ -} CFE_EVS_LongEventTlm_Payload_t; - -/** -** \cfeevstlm Event Message Telemetry Packet (Short format) -**/ -typedef struct CFE_EVS_ShortEventTlm_Payload -{ - CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ -} CFE_EVS_ShortEventTlm_Payload_t; - -typedef struct CFE_EVS_LongEventTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_EVS_LongEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_EVS_LongEventTlm_t; - -typedef struct CFE_EVS_ShortEventTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_EVS_ShortEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_EVS_ShortEventTlm_t; - -#endif /* CFE_EVS_MSG_H */ +#endif diff --git a/modules/evs/config/default_cfe_evs_interface_cfg.h b/modules/evs/config/default_cfe_evs_interface_cfg.h new file mode 100644 index 000000000..a8f6643fc --- /dev/null +++ b/modules/evs/config/default_cfe_evs_interface_cfg.h @@ -0,0 +1,49 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_INTERFACE_CFG_H +#define CFE_EVS_INTERFACE_CFG_H + +/** +** \cfeevscfg Maximum Event Message Length +** +** \par Description: +** Indicates the maximum length (in characters) of the formatted text +** string portion of an event message +** +** This length does not need to include an extra character for NULL termination. +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_EVS_MAX_MESSAGE_LENGTH 122 + +#endif diff --git a/modules/evs/config/default_cfe_evs_internal_cfg.h b/modules/evs/config/default_cfe_evs_internal_cfg.h new file mode 100644 index 000000000..728b7d07d --- /dev/null +++ b/modules/evs/config/default_cfe_evs_internal_cfg.h @@ -0,0 +1,199 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_INTERNAL_CFG_H +#define CFE_EVS_INTERNAL_CFG_H + +/** +** \cfeescfg Define EVS Task Priority +** +** \par Description: +** Defines the cFE_EVS Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_EVS_START_TASK_PRIORITY 61 + +/** +** \cfeescfg Define EVS Task Stack Size +** +** \par Description: +** Defines the cFE_EVS Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_EVS_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/** +** \cfeevscfg Define Maximum Number of Event Filters per Application +** +** \par Description: +** Maximum number of events that may be filtered per application. +** +** \par Limits +** There are no restrictions on the lower and upper limits however, +** the maximum number of event filters is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_EVS_MAX_EVENT_FILTERS 8 + +/** +** \cfeevscfg Maximum number of event before squelching +** +** \par Description: +** Maximum number of events that may be emitted per app per second. +** Setting this to 0 will cause events to be unrestricted. +** +** \par Limits +** This number must be less than or equal to INT_MAX/1000 +*/ +#define CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST 32 + +/** +** \cfeevscfg Sustained number of event messages per second per app before squelching +** +** \par Description: +** Sustained number of events that may be emitted per app per second. +** +** \par Limits +** This number must be less than or equal to #CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST. +** Values lower than 8 may cause functional and unit test failures. +*/ +#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 8 + +/** +** \cfeevscfg Default Event Log Filename +** +** \par Description: +** The value of this constant defines the filename used to store the Event +** Services local event log. This filename is used only when no filename is +** specified in the command to dump the event log. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_LOG_FILE "/ram/cfe_evs.log" + +/** +** \cfeevscfg Maximum Number of Events in EVS Local Event Log +** +** \par Description: +** Dictates the EVS local event log capacity. Units are the number of events. +** +** \par Limits +** There are no restrictions on the lower and upper limits however, +** the maximum log size is system dependent and should be verified. +*/ +#define CFE_PLATFORM_EVS_LOG_MAX 20 + +/** +** \cfeevscfg Default EVS Application Data Filename +** +** \par Description: +** The value of this constant defines the filename used to store the EVS +** Application Data(event counts/filtering information). This filename is +** used only when no filename is specified in the command to dump the event +** log. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE "/ram/cfe_evs_app.dat" + +/** +** \cfeevscfg Default EVS Output Port State +** +** \par Description: +** Defines the default port state (enabled or disabled) for the four output +** ports defined within the Event Service. Port 1 is usually the uart output +** terminal. To enable a port, set the proper bit to a 1. Bit 0 is port 1, +** bit 1 is port2 etc. +** +** \par Limits +** The valid settings are 0x0 to 0xF. +*/ +#define CFE_PLATFORM_EVS_PORT_DEFAULT 0x0001 + +/** +** \cfeevscfg Default EVS Event Type Filter Mask +** +** \par Description: +** Defines a state of on or off for all four event types. The term event +** 'type' refers to the criticality level and may be Debug, Informational, +** Error or Critical. Each event type has a bit position. (bit 0 = Debug, +** bit 1 = Info, bit 2 = Error, bit 3 = Critical). This is a global setting, +** meaning it applies to all applications. To filter an event type, set its +** bit to zero. For example, +** 0xE means Debug = OFF, Info = ON, Error = ON, Critical = ON +** +** \par Limits +** The valid settings are 0x0 to 0xF. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_TYPE_FLAG 0xE + +/** +** \cfeevscfg Default EVS Local Event Log Mode +** +** \par Description: +** Defines a state of overwrite(0) or discard(1) for the operation of the +** EVS local event log. The log may operate in either Overwrite mode = 0, +** where once the log becomes full the oldest event in the log will be +** overwritten, or Discard mode = 1, where once the log becomes full the +** contents of the log are preserved and the new event is discarded. +** Overwrite Mode = 0, Discard Mode = 1. +** +** \par Limits +** The valid settings are 0 or 1 +*/ +#define CFE_PLATFORM_EVS_DEFAULT_LOG_MODE 1 + +/** +** \cfeevscfg Default EVS Message Format Mode +** +** \par Description: +** Defines the default message format (long or short) for event messages being +** sent to the ground. Choose between #CFE_EVS_MsgFormat_LONG or +** #CFE_EVS_MsgFormat_SHORT. +** +** \par Limits +** The valid settings are #CFE_EVS_MsgFormat_LONG or #CFE_EVS_MsgFormat_SHORT +*/ +#define CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE CFE_EVS_MsgFormat_LONG + +#endif diff --git a/modules/evs/config/default_cfe_evs_mission_cfg.h b/modules/evs/config/default_cfe_evs_mission_cfg.h new file mode 100644 index 000000000..5146773c2 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Event Services (CFE_EVS) Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_MISSION_CFG_H +#define CFE_EVS_MISSION_CFG_H + +#include "cfe_evs_interface_cfg.h" + +#endif diff --git a/modules/evs/config/default_cfe_evs_msg.h b/modules/evs/config/default_cfe_evs_msg.h new file mode 100644 index 000000000..6f30ea47f --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msg.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_EVS) command and telemetry + * message data types. + * + * This is a compatibility header for the "cfe_evs_msg.h" file that has + * traditionally provided the message definitions for cFS apps. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_MSG_H +#define CFE_EVS_MSG_H + +#include "cfe_mission_cfg.h" +#include "cfe_evs_fcncodes.h" +#include "cfe_evs_msgstruct.h" + +#endif diff --git a/modules/evs/config/default_cfe_evs_msgdefs.h b/modules/evs/config/default_cfe_evs_msgdefs.h new file mode 100644 index 000000000..654829e29 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msgdefs.h @@ -0,0 +1,43 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_EVS) command and telemetry + * message constant definitions. + * + * For CFE_EVS this is only the function/command code definitions + */ +#ifndef CFE_EVS_MSGDEFS_H +#define CFE_EVS_MSGDEFS_H + +#include "cfe_evs_fcncodes.h" + +/* Event Type bit masks */ +#define CFE_EVS_DEBUG_BIT 0x0001 +#define CFE_EVS_INFORMATION_BIT 0x0002 +#define CFE_EVS_ERROR_BIT 0x0004 +#define CFE_EVS_CRITICAL_BIT 0x0008 + +/* Output Port bit masks */ +#define CFE_EVS_PORT1_BIT 0x0001 +#define CFE_EVS_PORT2_BIT 0x0002 +#define CFE_EVS_PORT3_BIT 0x0004 +#define CFE_EVS_PORT4_BIT 0x0008 + +#endif diff --git a/modules/evs/config/default_cfe_evs_msgids.h b/modules/evs/config/default_cfe_evs_msgids.h new file mode 100644 index 000000000..1d31ddb5b --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msgids.h @@ -0,0 +1,42 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Message IDs + */ +#ifndef CFE_EVS_MSGIDS_H +#define CFE_EVS_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_evs_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_CMD_MSG /* 0x1801 */ +#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_SEND_HK_MSG /* 0x1809 */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_HK_TLM_MSG /* 0x0801 */ +#define CFE_EVS_LONG_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_LONG_EVENT_MSG_MSG /* 0x0808 */ +#define CFE_EVS_SHORT_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG /* 0x0809 */ + +#endif diff --git a/modules/evs/config/default_cfe_evs_msgstruct.h b/modules/evs/config/default_cfe_evs_msgstruct.h new file mode 100644 index 000000000..ba0b394a7 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msgstruct.h @@ -0,0 +1,411 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * cFE Executive Services (EVS) Command and Telemetry packet definition file. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ +#ifndef CFE_EVS_MSGSTRUCT_H +#define CFE_EVS_MSGSTRUCT_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "common_types.h" +#include "cfe_evs_msgdefs.h" +#include "cfe_evs_extern_typedefs.h" +#include "cfe_msg_hdr.h" + +/****************** Structure Definitions *********************/ + +/** +** \brief Command with no additional arguments +**/ +typedef struct CFE_EVS_NoArgsCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ +} CFE_EVS_NoArgsCmd_t; + +/* + * The NoArgsCmd is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_NoopCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ResetCountersCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ClearLogCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_SendHkCmd_t; + +/** +** \brief Write Event Log to File Command Payload +** +** For command details, see #CFE_EVS_WRITE_LOG_DATA_FILE_CC +** +**/ +typedef struct CFE_EVS_LogFileCmd_Payload +{ + char LogFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where log data is to be written */ +} CFE_EVS_LogFileCmd_Payload_t; + +/** + * \brief Write Event Log to File Command + */ +typedef struct CFE_EVS_WriteLogDataFileCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_LogFileCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_WriteLogDataFileCmd_t; + +/** +** \brief Write Event Services Application Information to File Command Payload +** +** For command details, see #CFE_EVS_WRITE_APP_DATA_FILE_CC +** +**/ +typedef struct CFE_EVS_AppDataCmd_Payload +{ + char AppDataFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where application data is to be written */ +} CFE_EVS_AppDataCmd_Payload_t; + +/** + * \brief Write Event Services Application Information to File Command + */ +typedef struct CFE_EVS_WriteAppDataFileCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppDataCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_WriteAppDataFileCmd_t; + +/** +** \brief Set Log Mode Command Payload +** +** For command details, see #CFE_EVS_SET_LOG_MODE_CC +** +**/ +typedef struct CFE_EVS_SetLogMode_Payload +{ + CFE_EVS_LogMode_Enum_t LogMode; /**< \brief Mode to use in the command*/ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_SetLogMode_Payload_t; + +/** + * \brief Set Log Mode Command + */ +typedef struct CFE_EVS_SetLogModeCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_SetLogMode_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_SetLogModeCmd_t; + +/** +** \brief Set Event Format Mode Command Payload +** +** For command details, see #CFE_EVS_SET_EVENT_FORMAT_MODE_CC +** +**/ +typedef struct CFE_EVS_SetEventFormatCode_Payload +{ + CFE_EVS_MsgFormat_Enum_t MsgFormat; /**< \brief Mode to use in the command*/ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_SetEventFormatMode_Payload_t; + +/** + * \brief Set Event Format Mode Command + */ +typedef struct CFE_EVS_SetEventFormatModeCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_SetEventFormatMode_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_SetEventFormatModeCmd_t; + +/** +** \brief Generic Bitmask Command Payload +** +** For command details, see #CFE_EVS_ENABLE_EVENT_TYPE_CC, #CFE_EVS_DISABLE_EVENT_TYPE_CC, +** #CFE_EVS_ENABLE_PORTS_CC and/or #CFE_EVS_DISABLE_PORTS_CC +** +**/ +typedef struct CFE_EVS_BitMaskCmd_Payload +{ + uint8 BitMask; /**< \brief BitMask to use in the command */ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_BitMaskCmd_Payload_t; + +/** + * \brief Generic Bitmask Command + */ +typedef struct CFE_EVS_BitMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_BitMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_BitMaskCmd_t; + +/* + * The CFE_EVS_BitMaskCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnablePortsCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisablePortsCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnableEventTypeCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisableEventTypeCmd_t; + +/** +** \brief Generic App Name Command Payload +** +** For command details, see #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC, +** #CFE_EVS_RESET_APP_COUNTER_CC and/or #CFE_EVS_RESET_ALL_FILTERS_CC +** +**/ +typedef struct CFE_EVS_AppNameCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ +} CFE_EVS_AppNameCmd_Payload_t; + +/** + * \brief Generic App Name Command + */ +typedef struct CFE_EVS_AppNameCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameCmd_t; + +/* + * The CFE_EVS_AppNameCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameCmd_t CFE_EVS_EnableAppEventsCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_DisableAppEventsCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAppCounterCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAllFiltersCmd_t; + +/** +** \brief Generic App Name and Event ID Command Payload +** +** For command details, see #CFE_EVS_RESET_FILTER_CC and #CFE_EVS_DELETE_EVENT_FILTER_CC +** +**/ +typedef struct CFE_EVS_AppNameEventIDCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ + uint16 EventID; /**< \brief Event ID to use in the command*/ +} CFE_EVS_AppNameEventIDCmd_Payload_t; + +/** + * \brief Generic App Name and Event ID Command + */ +typedef struct CFE_EVS_AppNameEventIDCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameEventIDCmd_t; + +/* + * The CFE_EVS_AppNameEventIDCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_ResetFilterCmd_t; +typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_DeleteEventFilterCmd_t; + +/** +** \brief Generic App Name and Bitmask Command Payload +** +** For command details, see #CFE_EVS_ENABLE_APP_EVENT_TYPE_CC and/or #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC +** +**/ +typedef struct CFE_EVS_AppNameBitMaskCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ + uint8 BitMask; /**< \brief BitMask to use in the command*/ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_AppNameBitMaskCmd_Payload_t; + +/** + * \brief Generic App Name and Bitmask Command + */ +typedef struct CFE_EVS_AppNameBitMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameBitMaskCmd_t; + +/* + * The CFE_EVS_AppNameBitMaskCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_EnableAppEventTypeCmd_t; +typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_DisableAppEventTypeCmd_t; + +/** +** \brief Generic App Name, Event ID, Mask Command Payload +** +** For command details, see #CFE_EVS_SET_FILTER_CC, #CFE_EVS_ADD_EVENT_FILTER_CC +** and/or #CFE_EVS_DELETE_EVENT_FILTER_CC +** +**/ +typedef struct CFE_EVS_AppNameEventIDMaskCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ + uint16 EventID; /**< \brief Event ID to use in the command*/ + uint16 Mask; /**< \brief Mask to use in the command */ +} CFE_EVS_AppNameEventIDMaskCmd_Payload_t; + +/** + * \brief Generic App Name, Event ID, Mask Command + */ +typedef struct CFE_EVS_AppNameEventIDMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameEventIDMaskCmd_t; + +/* + * The CFE_EVS_AppNameEventIDMaskCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_AddEventFilterCmd_t; +typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_SetFilterCmd_t; + +/*************************************************************************/ +/**********************************/ +/* Telemetry Message Data Formats */ +/**********************************/ +typedef struct CFE_EVS_AppTlmData +{ + CFE_ES_AppId_t AppID; /**< \cfetlmmnemonic \EVS_APPID + \brief Numerical application identifier */ + uint16 AppMessageSentCounter; /**< \cfetlmmnemonic \EVS_APPMSGSENTC + \brief Application message sent counter */ + uint8 AppEnableStatus; /**< \cfetlmmnemonic \EVS_APPENASTAT + \brief Application event service enable status */ + uint8 AppMessageSquelchedCounter; /**< \cfetlmmnemonic \EVS_SQUELCHEDC + \brief Number of events squelched */ +} CFE_EVS_AppTlmData_t; + +/** +** \cfeevstlm Event Services Housekeeping Telemetry Packet +**/ +typedef struct CFE_EVS_HousekeepingTlm_Payload +{ + uint8 CommandCounter; /**< \cfetlmmnemonic \EVS_CMDPC + \brief EVS Command Counter */ + uint8 CommandErrorCounter; /**< \cfetlmmnemonic \EVS_CMDEC + \brief EVS Command Error Counter */ + uint8 MessageFormatMode; /**< \cfetlmmnemonic \EVS_MSGFMTMODE + \brief Event message format mode (short/long) */ + uint8 MessageTruncCounter; /**< \cfetlmmnemonic \EVS_MSGTRUNC + \brief Event message truncation counter */ + + uint8 UnregisteredAppCounter; /**< \cfetlmmnemonic \EVS_UNREGAPPC + \brief Unregistered application message send counter */ + uint8 OutputPort; /**< \cfetlmmnemonic \EVS_OUTPUTPORT + \brief Output port mask */ + uint8 LogFullFlag; /**< \cfetlmmnemonic \EVS_LOGFULL + \brief Local event log full flag */ + uint8 LogMode; /**< \cfetlmmnemonic \EVS_LOGMODE + \brief Local event logging mode (overwrite/discard) */ + + uint16 MessageSendCounter; /**< \cfetlmmnemonic \EVS_MSGSENTC + \brief Event message send counter */ + uint16 LogOverflowCounter; /**< \cfetlmmnemonic \EVS_LOGOVERFLOWC + \brief Local event log overflow counter */ + + uint8 LogEnabled; /**< \cfetlmmnemonic \EVS_LOGENABLED + \brief Current event log enable/disable state */ + uint8 Spare1; /**< \cfetlmmnemonic \EVS_HK_SPARE1 + \brief Padding for 32 bit boundary */ + uint8 Spare2; /**< \cfetlmmnemonic \EVS_HK_SPARE2 + \brief Padding for 32 bit boundary */ + uint8 Spare3; /**< \cfetlmmnemonic \EVS_HK_SPARE3 + \brief Padding for 32 bit boundary */ + + CFE_EVS_AppTlmData_t AppData[CFE_MISSION_ES_MAX_APPLICATIONS]; /**< \cfetlmmnemonic \EVS_APP + \brief Array of registered application table data */ +} CFE_EVS_HousekeepingTlm_Payload_t; + +typedef struct CFE_EVS_HousekeepingTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_EVS_HousekeepingTlm_t; + +/** Telemetry packet structures */ + +typedef struct CFE_EVS_PacketID +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \EVS_APPNAME + \brief Application name */ + uint16 EventID; /**< \cfetlmmnemonic \EVS_EVENTID + \brief Numerical event identifier */ + uint16 EventType; /**< \cfetlmmnemonic \EVS_EVENTTYPE + \brief Numerical event type identifier */ + uint32 SpacecraftID; /**< \cfetlmmnemonic \EVS_SCID + \brief Spacecraft identifier */ + uint32 ProcessorID; /**< \cfetlmmnemonic \EVS_PROCESSORID + \brief Numerical processor identifier */ +} CFE_EVS_PacketID_t; + +/** +** \cfeevstlm Event Message Telemetry Packet (Long format) +**/ +typedef struct CFE_EVS_LongEventTlm_Payload +{ + CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ + char Message[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; /**< \cfetlmmnemonic \EVS_EVENT + \brief Event message string */ + uint8 Spare1; /**< \cfetlmmnemonic \EVS_SPARE1 + \brief Structure padding */ + uint8 Spare2; /**< \cfetlmmnemonic \EVS_SPARE2 + \brief Structure padding */ +} CFE_EVS_LongEventTlm_Payload_t; + +/** +** \cfeevstlm Event Message Telemetry Packet (Short format) +**/ +typedef struct CFE_EVS_ShortEventTlm_Payload +{ + CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ +} CFE_EVS_ShortEventTlm_Payload_t; + +typedef struct CFE_EVS_LongEventTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_LongEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_EVS_LongEventTlm_t; + +typedef struct CFE_EVS_ShortEventTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_ShortEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_EVS_ShortEventTlm_t; + +#endif diff --git a/modules/evs/config/default_cfe_evs_platform_cfg.h b/modules/evs/config/default_cfe_evs_platform_cfg.h new file mode 100644 index 000000000..83f40168c --- /dev/null +++ b/modules/evs/config/default_cfe_evs_platform_cfg.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Event Services (CFE_EVS) Application Platform Configuration Header File + * + * This is a compatibility header for the "platform_cfg.h" file that has + * traditionally provided both public and private config definitions + * for each CFS app. + * + * These definitions are now provided in two separate files, one for + * the public/mission scope and one for internal scope. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_PLATFORM_CFG_H +#define CFE_EVS_PLATFORM_CFG_H + +#include "cfe_evs_mission_cfg.h" +#include "cfe_evs_internal_cfg.h" + +#endif diff --git a/modules/evs/config/default_cfe_evs_topicids.h b/modules/evs/config/default_cfe_evs_topicids.h new file mode 100644 index 000000000..842758da0 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_topicids.h @@ -0,0 +1,51 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Topic IDs + */ +#ifndef CFE_EVS_TOPICIDS_H +#define CFE_EVS_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE EVS command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_EVS_CMD_MSG 1 +#define CFE_MISSION_EVS_SEND_HK_MSG 9 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE EVS telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_EVS_HK_TLM_MSG 1 +#define CFE_MISSION_EVS_LONG_EVENT_MSG_MSG 8 +#define CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG 9 + +#endif diff --git a/modules/evs/fsw/inc/cfe_evs_events.h b/modules/evs/fsw/inc/cfe_evs_eventids.h similarity index 100% rename from modules/evs/fsw/inc/cfe_evs_events.h rename to modules/evs/fsw/inc/cfe_evs_eventids.h diff --git a/modules/evs/fsw/src/cfe_evs_module_all.h b/modules/evs/fsw/src/cfe_evs_module_all.h index 312d60789..206a44e52 100644 --- a/modules/evs/fsw/src/cfe_evs_module_all.h +++ b/modules/evs/fsw/src/cfe_evs_module_all.h @@ -39,10 +39,10 @@ #include "cfe_evs_core_internal.h" -#include "cfe_evs_events.h" /* EVS event IDs */ -#include "cfe_evs_task.h" /* EVS internal definitions */ -#include "cfe_evs_log.h" /* EVS log file definitions */ -#include "cfe_evs_utils.h" /* EVS utility function definitions */ +#include "cfe_evs_eventids.h" /* EVS event IDs */ +#include "cfe_evs_task.h" /* EVS internal definitions */ +#include "cfe_evs_log.h" /* EVS log file definitions */ +#include "cfe_evs_utils.h" /* EVS utility function definitions */ #include "cfe_evs_dispatch.h" #endif /* CFE_EVS_MODULE_ALL_H */ diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index f8274057e..bd111c7a8 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -48,7 +48,7 @@ #include "cfe_evs_api_typedefs.h" #include "cfe_evs_log_typedef.h" #include "cfe_sb_api_typedefs.h" -#include "cfe_evs_events.h" +#include "cfe_evs_eventids.h" /********************* Macro and Constant Type Definitions ***************************/ diff --git a/modules/evs/mission_build.cmake b/modules/evs/mission_build.cmake new file mode 100644 index 000000000..cb1581740 --- /dev/null +++ b/modules/evs/mission_build.cmake @@ -0,0 +1,37 @@ +########################################################### +# +# EVS Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the EVS configuration +set(EVS_MISSION_CONFIG_FILE_LIST + cfe_evs_mission_cfg.h + cfe_evs_interface_cfg.h + cfe_evs_extern_typedefs.h + cfe_evs_fcncodes.h + cfe_evs_msgdefs.h + cfe_evs_msg.h + cfe_evs_msgstruct.h + cfe_evs_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(EVS_CFGFILE ${EVS_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${EVS_CFGFILE}" NAME_WE) + if (DEFINED EVS_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${EVS_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${EVS_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach()