Skip to content

Commit

Permalink
EDS: Resolve MsgID value mismatches
Browse files Browse the repository at this point in the history
The "base_msgids.h" file needs an EDS specific version for the correct
mappings
  • Loading branch information
jphickey committed Oct 1, 2024
1 parent cb37a04 commit d8e6716
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/Makefile.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions modules/core_api/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
68 changes: 68 additions & 0 deletions modules/core_api/config/default_eds_cfe_core_api_base_msgids.h
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit d8e6716

Please sign in to comment.