From 1b824dc7c41fc67a81a7dde0046e3bba9d08ace7 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 6 Dec 2023 10:51:36 -0500 Subject: [PATCH] Fix #2473, document and use topicid numbers for cfe A topic ID is the same concept as was previously referred to as a portable message number. This just formalizes it, gives it a name, and adds some macros for easier customization of the behavior. --- cmake/arch_build.cmake | 79 ++++++++++++++++++- cmake/mission_build.cmake | 75 ++++++++++++++++++ .../config/default_cfe_test_msgids.h | 4 +- .../config/default_cfe_test_topicids.h | 4 +- .../cfe_testcase/src/sb_subscription_test.c | 2 +- modules/core_api/arch_build.cmake | 34 +++++--- .../config/default_cfe_core_api_base_msgids.h | 72 +++++++++++++++-- modules/es/arch_build.cmake | 9 ++- modules/es/config/default_cfe_es_msgids.h | 10 +-- modules/es/config/default_cfe_es_topicids.h | 10 +-- modules/evs/arch_build.cmake | 6 +- modules/evs/config/default_cfe_evs_msgids.h | 13 +-- modules/evs/config/default_cfe_evs_topicids.h | 10 +-- modules/sb/arch_build.cmake | 6 +- modules/sb/config/default_cfe_sb_msgids.h | 14 ++-- modules/sb/config/default_cfe_sb_topicids.h | 14 ++-- modules/sb/ut-coverage/sb_UT.h | 4 +- modules/tbl/arch_build.cmake | 6 +- modules/tbl/config/default_cfe_tbl_msgids.h | 8 +- modules/tbl/config/default_cfe_tbl_topicids.h | 8 +- modules/time/arch_build.cmake | 6 +- modules/time/config/default_cfe_time_msgids.h | 16 ++-- .../time/config/default_cfe_time_topicids.h | 16 ++-- 23 files changed, 326 insertions(+), 100 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index e94f86fe4..f173e5d06 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -606,6 +606,81 @@ function(cfs_app_check_intf MODULE_NAME) endfunction(cfs_app_check_intf) +################################################################## +# +# FUNCTION: setup_platform_msgids +# +# This is intended to support cases where MsgIDs for all apps +# and modules are assigned in a single/unified header file +# +function(setup_platform_msgids) + + set(PLATFORM_MSGID_HEADERFILE) + + # In an EDS build, the msg IDs always come from EDS, there should not be a local msgids.h file + if (NOT CFE_EDS_ENABLED_BUILD) + + # Check for the presence of a platform-specific msgid file + # This uses cfe_locate_implementation_file() as this returns whether or not it found one + cfe_locate_implementation_file(PLATFORM_MSGID_HEADERFILE "msgids.h" + PREFIX ${BUILD_CONFIG} cfs + SUBDIR config + ) + + # If a top level file was found, then create a wrapper around it called "cfs_msgids.h" + # Note that at this point it could be a list + if (PLATFORM_MSGID_HEADERFILE) + + set(TEMP_WRAPPER_FILE_CONTENT) + foreach(SELECTED_FILE ${PLATFORM_MSGID_HEADERFILE}) + file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH) + list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") + endforeach() + + # Generate a header file + generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_msgids.h" ${TEMP_WRAPPER_FILE_CONTENT}) + unset(TEMP_WRAPPER_FILE_CONTENT) + + # From here on use the wrapper file + set(PLATFORM_MSGID_HEADERFILE "cfs_msgids.h") + + endif(PLATFORM_MSGID_HEADERFILE) + + endif(NOT CFE_EDS_ENABLED_BUILD) + + # Finally, export a CFGFILE_SRC variable for each of the deps + # This should make each respective "mission_build" create a wrapper + # that points directly at this global file, ignoring the default + if (PLATFORM_MSGID_HEADERFILE) + + # Historically there has been a cfe_msgids.h defined at the core api level + # be sure to include this in the export list + set (OUTPUT_VAR_LIST + CORE_API_CFGFILE_SRC_cfe_msgids + ) + + # Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME + # To make this work without major impact, add it back in here + foreach(DEP_NAME ${MISSION_CORE_MODULES}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_msgids) + endforeach(DEP_NAME ${MISSION_CORE_MODULES}) + + foreach(DEP_NAME ${TGTSYS_${SYSVAR}_APPS} ${TGTSYS_${SYSVAR}_STATICAPPS}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_msgids) + endforeach(DEP_NAME ${MISSION_APPS}) + + # This is the actual export to parent scope + foreach(VAR_NAME ${OUTPUT_VAR_LIST}) + message("${VAR_NAME}=${PLATFORM_MSGID_HEADERFILE}") + set(${VAR_NAME} ${PLATFORM_MSGID_HEADERFILE} PARENT_SCOPE) + endforeach(VAR_NAME ${OUTPUT_VAR_LIST}) + + endif (PLATFORM_MSGID_HEADERFILE) + +endfunction(setup_platform_msgids) + ################################################################## @@ -658,6 +733,9 @@ function(prepare) list(REMOVE_AT BUILD_CONFIG 0) set(BUILD_CONFIG ${BUILD_CONFIG} PARENT_SCOPE) + # Check if the user has provided a platform-specific "msgids.h" file and set up a wrapper to it + setup_platform_msgids() + # Pull in any application-specific platform-scope configuration # This may include user configuration files such as cfe_platform_cfg.h, # or any other configuration/preparation that needs to happen at @@ -746,7 +824,6 @@ function(process_arch SYSVAR) endif() endforeach() - # Add all core modules # The osal is handled explicitly (above) since this has special extra config foreach(DEP ${MISSION_CORE_INTERFACES} ${MISSION_CORE_MODULES}) diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 192c2e6c4..567131f49 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -161,6 +161,78 @@ function(generate_build_version_templates) endfunction(generate_build_version_templates) +################################################################## +# +# FUNCTION: setup_global_topicids +# +# This is intended to support cases where topic IDs for all apps +# and modules are assigned in a single/unified header file +# +function(setup_global_topicids) + + if (CFE_EDS_ENABLED_BUILD) + + # In an EDS build, the topic IDs always come from EDS + set(MISSION_GLOBAL_TOPICID_HEADERFILE "mission_eds_designparameters.h") + + else(CFE_EDS_ENABLED_BUILD) + + # Check for the presence of a mission-wide/global topic ID file + # This uses cfe_locate_implementation_file() as this returns whether or not it found one + cfe_locate_implementation_file(MISSION_GLOBAL_TOPICID_HEADERFILE "global_topicids.h" + PREFIX ${MISSIONCONFIG} cfs + SUBDIR config + ) + + # If a top level file was found, then create a wrapper around it called "cfs_global_topicids.h" + # Note that at this point it could be a list + if (MISSION_GLOBAL_TOPICID_HEADERFILE) + + set(TEMP_WRAPPER_FILE_CONTENT) + foreach(SELECTED_FILE ${MISSION_GLOBAL_TOPICID_HEADERFILE}) + file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH) + list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") + endforeach() + + # Generate a header file + generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_global_topicids.h" ${TEMP_WRAPPER_FILE_CONTENT}) + unset(TEMP_WRAPPER_FILE_CONTENT) + + # From here on use the wrapper file + set(MISSION_GLOBAL_TOPICID_HEADERFILE "cfs_global_topicids.h") + + endif(MISSION_GLOBAL_TOPICID_HEADERFILE) + + endif(CFE_EDS_ENABLED_BUILD) + + # Finally, export a CFGFILE_SRC variable for each of the deps + # This should make each respective "mission_build" create a wrapper + # that points directly at this global file, ignoring the default + if (MISSION_GLOBAL_TOPICID_HEADERFILE) + + set (OUTPUT_VAR_LIST) + + # Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME + # To make this work without major impact, add it back in here + foreach(DEP_NAME ${MISSION_CORE_MODULES}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_topicids) + endforeach(DEP_NAME ${MISSION_CORE_MODULES}) + + foreach(DEP_NAME ${MISSION_APPS}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_topicids) + endforeach(DEP_NAME ${MISSION_APPS}) + + # This is the actual export to parent scope + foreach(VAR_NAME ${OUTPUT_VAR_LIST}) + set(${VAR_NAME} ${MISSION_GLOBAL_TOPICID_HEADERFILE} PARENT_SCOPE) + endforeach(VAR_NAME ${OUTPUT_VAR_LIST}) + + endif (MISSION_GLOBAL_TOPICID_HEADERFILE) + +endfunction(setup_global_topicids) + ################################################################## # # FUNCTION: prepare @@ -348,6 +420,9 @@ function(prepare) add_dependencies(cfe-usersguide doc-prebuild) add_dependencies(mission-doc doc-prebuild) + # Set up the global topicid header file, if present + setup_global_topicids() + # Pull in any application-specific mission-scope configuration # This may include user configuration files such as cfe_mission_cfg.h, # msgid definitions, or any other configuration/preparation that needs to diff --git a/modules/cfe_testcase/config/default_cfe_test_msgids.h b/modules/cfe_testcase/config/default_cfe_test_msgids.h index a4b41aa30..ba1a9a879 100644 --- a/modules/cfe_testcase/config/default_cfe_test_msgids.h +++ b/modules/cfe_testcase/config/default_cfe_test_msgids.h @@ -29,11 +29,11 @@ /* ** cFE Command Message Id's */ -#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ +#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TEST_CMD_TOPICID) /* 0x1802 */ /* ** CFE Telemetry Message Id's */ -#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ +#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TEST_HK_TLM_TOPICID) /* 0x0802 */ #endif diff --git a/modules/cfe_testcase/config/default_cfe_test_topicids.h b/modules/cfe_testcase/config/default_cfe_test_topicids.h index 6ecca4fb5..4d90e525e 100644 --- a/modules/cfe_testcase/config/default_cfe_test_topicids.h +++ b/modules/cfe_testcase/config/default_cfe_test_topicids.h @@ -32,7 +32,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TEST_CMD_MSG 2 +#define CFE_MISSION_TEST_CMD_TOPICID 2 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -43,6 +43,6 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TEST_HK_TLM_MSG 2 +#define CFE_MISSION_TEST_HK_TLM_TOPICID 2 #endif diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index a55c73716..8e9a80cbc 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -206,7 +206,7 @@ void TestSBMaxSubscriptions(void) while (NumSubs <= CFE_PLATFORM_SB_MAX_MSG_IDS) { /* fabricate a msgid to subscribe to (this may overlap real msgids) */ - TestMsgId = CFE_SB_ValueToMsgId(CFE_PLATFORM_CMD_MID_BASE + NumSubs); + TestMsgId = CFE_SB_ValueToMsgId(CFE_PLATFORM_CMD_TOPICID_TO_MIDV(NumSubs)); Status = CFE_SB_Subscribe(TestMsgId, PipeId); if (Status != CFE_SUCCESS) diff --git a/modules/core_api/arch_build.cmake b/modules/core_api/arch_build.cmake index 738d770bd..61d476012 100644 --- a/modules/core_api/arch_build.cmake +++ b/modules/core_api/arch_build.cmake @@ -9,17 +9,29 @@ ########################################################### # Generate the "cfe_platform_cfg.h" and "cfe_msgids.h" header files -# these must come from mission config +# these usually come from user config, but CFE provides defaults -generate_config_includefile( - FILE_NAME "cfe_msgids.h" - MATCH_SUFFIX "msgids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_msgids.h" - PREFIXES ${BUILD_CONFIG} cfe +set(CORE_API_PLATFORM_CONFIG_FILE_LIST + cfe_core_api_base_msgids.h + cfe_msgids.h ) -generate_config_includefile( - FILE_NAME "cfe_core_api_base_msgids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_api_base_msgids.h" - PREFIXES ${BUILD_CONFIG} -) +message("CORE_API_CFGFILE_SRC_cfe_msgids = ${CORE_API_CFGFILE_SRC_cfe_msgids}") + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +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}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CORE_API_CFGFILE}") + endif() + + generate_config_includefile( + FILE_NAME "${CORE_API_CFGFILE}" + PREFIXES ${BUILD_CONFIG} cfe + ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/config/default_cfe_core_api_base_msgids.h b/modules/core_api/config/default_cfe_core_api_base_msgids.h index ffb8b6d62..f210d8c8b 100644 --- a/modules/core_api/config/default_cfe_core_api_base_msgids.h +++ b/modules/core_api/config/default_cfe_core_api_base_msgids.h @@ -19,9 +19,8 @@ /** * @file * - * Purpose: - * This header file contains the Message Id's for messages used by the - * cFE core. + * This header file contains the platform-specific base msg ID values and + * logic to convert a topic ID to a message ID value. * */ @@ -44,7 +43,7 @@ * of MIDs in the framework it will not scale so an alternative * method of deconfliction is recommended. */ -#define CFE_PLATFORM_CMD_MID_BASE 0x1800 +#define CFE_CPU1_CMD_MID_BASE 0x1800 /** * \brief Platform telemetry message ID base offset @@ -54,9 +53,9 @@ * 0x0000-0x007F since the command bit is 0x0080. Alternative * method of deconfliction is recommended. * - * See #CFE_PLATFORM_CMD_MID_BASE for more information + * See #CFE_CPU1_CMD_MID_BASE for more information */ -#define CFE_PLATFORM_TLM_MID_BASE 0x0800 +#define CFE_CPU1_TLM_MID_BASE 0x0800 /** * \brief "Global" command message ID base offset @@ -65,8 +64,65 @@ * 0x00E0 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. * Works in limited cases only, alternative method of deconfliction * is recommended. - * See #CFE_PLATFORM_CMD_MID_BASE for more information + * See #CFE_CPU1_CMD_MID_BASE for more information */ -#define CFE_PLATFORM_CMD_MID_BASE_GLOB 0x1860 +#define CFE_GLOBAL_CMD_MID_BASE 0x1860 + +/** + * \brief "Global" telemetry message ID base offset + * + * 0x0860 - Nominal value for message ID V1 + * 0x0060 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. + * Works in limited cases only, alternative method of deconfliction + * is recommended. + * See #CFE_CPU1_CMD_MID_BASE for more information + */ +#define CFE_GLOBAL_TLM_MID_BASE 0x0860 + +/** + * \brief Convert a command topic ID to a MsgID value + * + * This defines the logic to convert a topic ID value into a message ID value. + * This operates on integer values and should resolve at compile time such + * that it can be used in e.g. switch/case statements. + * + * \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_CPU1_CMD_MID_BASE | (topic)) + +/** + * \brief Convert a telemetry topic ID to a MsgID value + * + * This defines the logic to convert a topic ID value into a message ID value. + * This operates on integer values and should resolve at compile time such + * that it can be used in e.g. switch/case statements. + * + * \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_CPU1_TLM_MID_BASE | (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_GLOBAL_CMD_MID_BASE | (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_GLOBAL_TLM_MID_BASE | (topic)) #endif /* CFE_CORE_BASE_MSGIDS_H */ diff --git a/modules/es/arch_build.cmake b/modules/es/arch_build.cmake index 27403bd88..28707caa0 100644 --- a/modules/es/arch_build.cmake +++ b/modules/es/arch_build.cmake @@ -15,18 +15,21 @@ set(ES_PLATFORM_CONFIG_FILE_LIST cfe_es_platform_cfg.h ) +message("ES_CFGFILE_SRC_cfe_es_msgids = ${ES_CFGFILE_SRC_cfe_es_msgids}") + + # Create wrappers around the all the config header files # This makes them individually overridable by the missions, without modifying # the distribution default copies foreach(ES_CFGFILE ${ES_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${ES_CFGFILE}" NAME_WE) if (DEFINED ES_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${ES_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${ES_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${ES_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/es/config/default_cfe_es_msgids.h b/modules/es/config/default_cfe_es_msgids.h index 9ee2bb252..cb442c326 100644 --- a/modules/es/config/default_cfe_es_msgids.h +++ b/modules/es/config/default_cfe_es_msgids.h @@ -29,14 +29,14 @@ /* ** cFE ES Command Message Id's */ -#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_CMD_MSG /* 0x1806 */ -#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_SEND_HK_MSG /* 0x1808 */ +#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_ES_CMD_TOPICID) /* 0x1806 */ +#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_ES_SEND_HK_TOPICID) /* 0x1808 */ /* ** CFE ES Telemetry Message Id's */ -#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_HK_TLM_MSG /* 0x0800 */ -#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_APP_TLM_MSG /* 0x080B */ -#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */ +#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_HK_TLM_TOPICID) /* 0x0800 */ +#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_APP_TLM_TOPICID) /* 0x080B */ +#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_MEMSTATS_TLM_TOPICID) /* 0x0810 */ #endif diff --git a/modules/es/config/default_cfe_es_topicids.h b/modules/es/config/default_cfe_es_topicids.h index b45705c21..267411945 100644 --- a/modules/es/config/default_cfe_es_topicids.h +++ b/modules/es/config/default_cfe_es_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_ES_CMD_MSG 6 -#define CFE_MISSION_ES_SEND_HK_MSG 8 +#define CFE_MISSION_ES_CMD_TOPICID 6 +#define CFE_MISSION_ES_SEND_HK_TOPICID 8 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,8 +44,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_ES_HK_TLM_MSG 0 -#define CFE_MISSION_ES_APP_TLM_MSG 11 -#define CFE_MISSION_ES_MEMSTATS_TLM_MSG 16 +#define CFE_MISSION_ES_HK_TLM_TOPICID 0 +#define CFE_MISSION_ES_APP_TLM_TOPICID 11 +#define CFE_MISSION_ES_MEMSTATS_TLM_TOPICID 16 #endif diff --git a/modules/evs/arch_build.cmake b/modules/evs/arch_build.cmake index 63c50f8e2..0822defb0 100644 --- a/modules/evs/arch_build.cmake +++ b/modules/evs/arch_build.cmake @@ -21,12 +21,12 @@ set(EVS_PLATFORM_CONFIG_FILE_LIST 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}}") + set(DEFAULT_SOURCE GENERATED_FILE "${EVS_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${EVS_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/evs/config/default_cfe_evs_msgids.h b/modules/evs/config/default_cfe_evs_msgids.h index 1d31ddb5b..2ee5292d3 100644 --- a/modules/evs/config/default_cfe_evs_msgids.h +++ b/modules/evs/config/default_cfe_evs_msgids.h @@ -29,14 +29,17 @@ /* ** 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 */ +#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_EVS_CMD_TOPICID) /* 0x1801 */ +#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_EVS_SEND_HK_TOPICID) /* 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 */ +#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_HK_TLM_TOPICID) /* 0x0801 */ +#define CFE_EVS_LONG_EVENT_MSG_MID \ + CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_LONG_EVENT_MSG_TOPICID) /* 0x0808 \ + */ +#define CFE_EVS_SHORT_EVENT_MSG_MID \ + CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_SHORT_EVENT_MSG_TOPICID) /* 0x0809 */ #endif diff --git a/modules/evs/config/default_cfe_evs_topicids.h b/modules/evs/config/default_cfe_evs_topicids.h index 842758da0..f03aecb4f 100644 --- a/modules/evs/config/default_cfe_evs_topicids.h +++ b/modules/evs/config/default_cfe_evs_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_EVS_CMD_MSG 1 -#define CFE_MISSION_EVS_SEND_HK_MSG 9 +#define CFE_MISSION_EVS_CMD_TOPICID 1 +#define CFE_MISSION_EVS_SEND_HK_TOPICID 9 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,8 +44,8 @@ ** \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 +#define CFE_MISSION_EVS_HK_TLM_TOPICID 1 +#define CFE_MISSION_EVS_LONG_EVENT_MSG_TOPICID 8 +#define CFE_MISSION_EVS_SHORT_EVENT_MSG_TOPICID 9 #endif diff --git a/modules/sb/arch_build.cmake b/modules/sb/arch_build.cmake index 10f7372f0..57e38509e 100644 --- a/modules/sb/arch_build.cmake +++ b/modules/sb/arch_build.cmake @@ -21,12 +21,12 @@ set(SB_PLATFORM_CONFIG_FILE_LIST foreach(SB_CFGFILE ${SB_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${SB_CFGFILE}" NAME_WE) if (DEFINED SB_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${SB_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${SB_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${SB_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/sb/config/default_cfe_sb_msgids.h b/modules/sb/config/default_cfe_sb_msgids.h index 21fce9c10..338684d62 100644 --- a/modules/sb/config/default_cfe_sb_msgids.h +++ b/modules/sb/config/default_cfe_sb_msgids.h @@ -29,16 +29,16 @@ /* ** cFE Command Message Id's */ -#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_CMD_MSG /* 0x1803 */ -#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SEND_HK_MSG /* 0x180B */ -#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SUB_RPT_CTRL_MSG /* 0x180E */ +#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_CMD_TOPICID) /* 0x1803 */ +#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_SEND_HK_TOPICID) /* 0x180B */ +#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_SUB_RPT_CTRL_TOPICID) /* 0x180E */ /* ** CFE Telemetry Message Id's */ -#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_HK_TLM_MSG /* 0x0803 */ -#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_STATS_TLM_MSG /* 0x080A */ -#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */ -#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */ +#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_HK_TLM_TOPICID) /* 0x0803 */ +#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_STATS_TLM_TOPICID) /* 0x080A */ +#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_ALLSUBS_TLM_TOPICID) /* 0x080D */ +#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_ONESUB_TLM_TOPICID) /* 0x080E */ #endif diff --git a/modules/sb/config/default_cfe_sb_topicids.h b/modules/sb/config/default_cfe_sb_topicids.h index 3c3e7be37..1009385ca 100644 --- a/modules/sb/config/default_cfe_sb_topicids.h +++ b/modules/sb/config/default_cfe_sb_topicids.h @@ -32,9 +32,9 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_SB_CMD_MSG 3 -#define CFE_MISSION_SB_SEND_HK_MSG 11 -#define CFE_MISSION_SB_SUB_RPT_CTRL_MSG 14 +#define CFE_MISSION_SB_CMD_TOPICID 3 +#define CFE_MISSION_SB_SEND_HK_TOPICID 11 +#define CFE_MISSION_SB_SUB_RPT_CTRL_TOPICID 14 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -45,9 +45,9 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_SB_HK_TLM_MSG 3 -#define CFE_MISSION_SB_STATS_TLM_MSG 10 -#define CFE_MISSION_SB_ALLSUBS_TLM_MSG 13 -#define CFE_MISSION_SB_ONESUB_TLM_MSG 14 +#define CFE_MISSION_SB_HK_TLM_TOPICID 3 +#define CFE_MISSION_SB_STATS_TLM_TOPICID 10 +#define CFE_MISSION_SB_ALLSUBS_TLM_TOPICID 13 +#define CFE_MISSION_SB_ONESUB_TLM_TOPICID 14 #endif diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index 45e15fcf3..bf72d1055 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -79,8 +79,8 @@ typedef struct uint16 Tlm16Param2; } SB_UT_TstPktWoSecHdr_t; -#define SB_UT_CMD_MID_VALUE_BASE CFE_PLATFORM_CMD_MID_BASE + 1 -#define SB_UT_TLM_MID_VALUE_BASE CFE_PLATFORM_TLM_MID_BASE + 1 +#define SB_UT_CMD_MID_VALUE_BASE 0x100 +#define SB_UT_TLM_MID_VALUE_BASE 0x200 /* SB unit test functions */ /*****************************************************************************/ diff --git a/modules/tbl/arch_build.cmake b/modules/tbl/arch_build.cmake index 25495554c..40c771288 100644 --- a/modules/tbl/arch_build.cmake +++ b/modules/tbl/arch_build.cmake @@ -21,12 +21,12 @@ set(TBL_PLATFORM_CONFIG_FILE_LIST foreach(TBL_CFGFILE ${TBL_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${TBL_CFGFILE}" NAME_WE) if (DEFINED TBL_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${TBL_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${TBL_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${TBL_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/tbl/config/default_cfe_tbl_msgids.h b/modules/tbl/config/default_cfe_tbl_msgids.h index 58d492c9f..54b93261d 100644 --- a/modules/tbl/config/default_cfe_tbl_msgids.h +++ b/modules/tbl/config/default_cfe_tbl_msgids.h @@ -29,13 +29,13 @@ /* ** cFE Command Message Id's */ -#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_CMD_MSG /* 0x1804 */ -#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_SEND_HK_MSG /* 0x180C */ +#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TBL_CMD_TOPICID) /* 0x1804 */ +#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TBL_SEND_HK_TOPICID) /* 0x180C */ /* ** CFE Telemetry Message Id's */ -#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_HK_TLM_MSG /* 0x0804 */ -#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */ +#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TBL_HK_TLM_TOPICID) /* 0x0804 */ +#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TBL_REG_TLM_TOPICID) /* 0x080C */ #endif diff --git a/modules/tbl/config/default_cfe_tbl_topicids.h b/modules/tbl/config/default_cfe_tbl_topicids.h index 207cff719..03b285fa5 100644 --- a/modules/tbl/config/default_cfe_tbl_topicids.h +++ b/modules/tbl/config/default_cfe_tbl_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TBL_CMD_MSG 4 -#define CFE_MISSION_TBL_SEND_HK_MSG 12 +#define CFE_MISSION_TBL_CMD_TOPICID 4 +#define CFE_MISSION_TBL_SEND_HK_TOPICID 12 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,7 +44,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TBL_HK_TLM_MSG 4 -#define CFE_MISSION_TBL_REG_TLM_MSG 12 +#define CFE_MISSION_TBL_HK_TLM_TOPICID 4 +#define CFE_MISSION_TBL_REG_TLM_TOPICID 12 #endif diff --git a/modules/time/arch_build.cmake b/modules/time/arch_build.cmake index 534ca265f..14cf68ead 100644 --- a/modules/time/arch_build.cmake +++ b/modules/time/arch_build.cmake @@ -21,12 +21,12 @@ set(TIME_PLATFORM_CONFIG_FILE_LIST foreach(TIME_CFGFILE ${TIME_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${TIME_CFGFILE}" NAME_WE) if (DEFINED TIME_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${TIME_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${TIME_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${TIME_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/time/config/default_cfe_time_msgids.h b/modules/time/config/default_cfe_time_msgids.h index b2ef0aa32..09fce848c 100644 --- a/modules/time/config/default_cfe_time_msgids.h +++ b/modules/time/config/default_cfe_time_msgids.h @@ -29,21 +29,21 @@ /* ** cFE Command Message Id's */ -#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_CMD_MSG /* 0x1805 */ -#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_SEND_HK_MSG /* 0x180D */ -#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_TONE_CMD_MSG /* 0x1810 */ -#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_1HZ_CMD_MSG /* 0x1811 */ +#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_CMD_TOPICID) /* 0x1805 */ +#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_SEND_HK_TOPICID) /* 0x180D */ +#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_TONE_CMD_TOPICID) /* 0x1810 */ +#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_1HZ_CMD_TOPICID) /* 0x1811 */ /* ** cFE Global Command Message Id's */ -#define CFE_TIME_DATA_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_DATA_CMD_MSG /* 0x1860 */ -#define CFE_TIME_SEND_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_SEND_CMD_MSG /* 0x1862 */ +#define CFE_TIME_DATA_CMD_MID CFE_GLOBAL_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_DATA_CMD_TOPICID) /* 0x1860 */ +#define CFE_TIME_SEND_CMD_MID CFE_GLOBAL_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_SEND_CMD_TOPICID) /* 0x1862 */ /* ** CFE Telemetry Message Id's */ -#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_HK_TLM_MSG /* 0x0805 */ -#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_DIAG_TLM_MSG /* 0x0806 */ +#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_HK_TLM_TOPICID) /* 0x0805 */ +#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_DIAG_TLM_TOPICID) /* 0x0806 */ #endif diff --git a/modules/time/config/default_cfe_time_topicids.h b/modules/time/config/default_cfe_time_topicids.h index a3c2ec1ef..ac7871a12 100644 --- a/modules/time/config/default_cfe_time_topicids.h +++ b/modules/time/config/default_cfe_time_topicids.h @@ -32,10 +32,10 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_CMD_MSG 5 -#define CFE_MISSION_TIME_SEND_HK_MSG 13 -#define CFE_MISSION_TIME_TONE_CMD_MSG 16 -#define CFE_MISSION_TIME_1HZ_CMD_MSG 17 +#define CFE_MISSION_TIME_CMD_TOPICID 5 +#define CFE_MISSION_TIME_SEND_HK_TOPICID 13 +#define CFE_MISSION_TIME_TONE_CMD_TOPICID 16 +#define CFE_MISSION_TIME_1HZ_CMD_TOPICID 17 /** ** \cfemissioncfg cFE Portable Message Numbers for Global Messages @@ -46,8 +46,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_DATA_CMD_MSG 0 -#define CFE_MISSION_TIME_SEND_CMD_MSG 2 +#define CFE_MISSION_TIME_DATA_CMD_TOPICID 0 +#define CFE_MISSION_TIME_SEND_CMD_TOPICID 2 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -58,7 +58,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_HK_TLM_MSG 5 -#define CFE_MISSION_TIME_DIAG_TLM_MSG 6 +#define CFE_MISSION_TIME_HK_TLM_TOPICID 5 +#define CFE_MISSION_TIME_DIAG_TLM_TOPICID 6 #endif