From d8e6716c4c1ed5871454f782d5145ce19f8e5ab1 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 1 Oct 2024 18:09:28 -0400 Subject: [PATCH] EDS: Resolve MsgID value mismatches The "base_msgids.h" file needs an EDS specific version for the correct mappings --- cmake/Makefile.sample | 2 +- modules/core_api/arch_build.cmake | 2 + .../default_eds_cfe_core_api_base_msgids.h | 68 +++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 modules/core_api/config/default_eds_cfe_core_api_base_msgids.h diff --git a/cmake/Makefile.sample b/cmake/Makefile.sample index c64668b8b..080fca5d2 100644 --- a/cmake/Makefile.sample +++ b/cmake/Makefile.sample @@ -101,7 +101,7 @@ endif # The "prep" step requires extra options that are specified via environment variables. # Certain special ones should be passed via cache (-D) options to CMake. # These are only needed for the "prep" target but they are computed globally anyway. -PREP_OPTS := +PREP_OPTS := -DCFE_EDS_ENABLED_BUILD=TRUE ifneq ($(INSTALLPREFIX),) PREP_OPTS += -DCMAKE_INSTALL_PREFIX=$(INSTALLPREFIX) diff --git a/modules/core_api/arch_build.cmake b/modules/core_api/arch_build.cmake index be7d5edc3..4b1c90a73 100644 --- a/modules/core_api/arch_build.cmake +++ b/modules/core_api/arch_build.cmake @@ -23,6 +23,8 @@ foreach(CORE_API_CFGFILE ${CORE_API_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${CORE_API_CFGFILE}" NAME_WE) if (DEFINED CORE_API_CFGFILE_SRC_${CFGKEY}) set(DEFAULT_SOURCE GENERATED_FILE "${CORE_API_CFGFILE_SRC_${CFGKEY}}") + elseif (CFE_EDS_ENABLED_BUILD AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/config/default_eds_${CORE_API_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_eds_${CORE_API_CFGFILE}") else() set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CORE_API_CFGFILE}") endif() diff --git a/modules/core_api/config/default_eds_cfe_core_api_base_msgids.h b/modules/core_api/config/default_eds_cfe_core_api_base_msgids.h new file mode 100644 index 000000000..74bbdd48b --- /dev/null +++ b/modules/core_api/config/default_eds_cfe_core_api_base_msgids.h @@ -0,0 +1,68 @@ +/************************************************************************ + * 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 + * + * This header file contains the platform-specific base msg ID values and + * logic to convert a topic ID to a message ID value. + * + */ + +#ifndef CFE_CORE_BASE_MSGIDS_H +#define CFE_CORE_BASE_MSGIDS_H + +/** + * \brief Convert a command topic ID to a MsgID value + * + * \note The result of this conversion is a simple integer, thus also needs to + * go through CFE_SB_ValueToMsgId() to obtain a properly-typed CFE_SB_MsgId_t + * for interacting with SB APIs. + */ +#define CFE_PLATFORM_CMD_TOPICID_TO_MIDV(topic) CFE_SB_LocalCmdTopicIdToMsgId(topic) + +/** + * \brief Convert a telemetry topic ID to a MsgID value + * + * \note The result of this conversion is a simple integer, thus also needs to + * go through CFE_SB_ValueToMsgId() to obtain a properly-typed CFE_SB_MsgId_t + * for interacting with SB APIs. + */ +#define CFE_PLATFORM_TLM_TOPICID_TO_MIDV(topic) CFE_SB_LocalTlmTopicIdToMsgId(topic) + +/** + * \brief Convert a "global" command topic ID to a MsgID value + * + * A global command is one that is not specific to an individual instance of CFE, + * but rather intended to be broadcast to all CFE instances at the same time. + * + * This is otherwise identical to #CFE_PLATFORM_CMD_TOPICID_TO_MIDV + */ +#define CFE_GLOBAL_CMD_TOPICID_TO_MIDV(topic) CFE_SB_GlobalCmdTopicIdToMsgId(topic) + +/** + * \brief Convert a "global" telemetry topic ID to a MsgID value + * + * A global telemetry is one that is not specific to an individual instance of CFE, + * but rather intended to be broadcast to all CFE instances at the same time. + * + * This is otherwise identical to #CFE_PLATFORM_TLM_TOPICID_TO_MIDV + */ +#define CFE_GLOBAL_TLM_TOPICID_TO_MIDV(topic) CFE_SB_GlobalTlmTopicIdToMsgId(topic) + +#endif /* CFE_CORE_BASE_MSGIDS_H */