Skip to content

Commit

Permalink
Fix #48, define msgids via topicids
Browse files Browse the repository at this point in the history
The MsgID value is a conversion from TopicID
  • Loading branch information
jphickey committed Dec 13, 2023
1 parent 26ae5f3 commit 6b12b6e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 23 deletions.
13 changes: 3 additions & 10 deletions arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,18 @@ set(BP_PLATFORM_CONFIG_FILE_LIST
bp_msgids.h
)

if (CFE_EDS_ENABLED_BUILD)

# In an EDS-based build, msgids come generated from the EDS tool
set(BP_CFGFILE_SRC_bp_msgids "${CMAKE_CURRENT_LIST_DIR}/config/bp_eds_msg_topicids.h")

endif(CFE_EDS_ENABLED_BUILD)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(BP_CFGFILE ${BP_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${BP_CFGFILE}" NAME_WE)
if (DEFINED BP_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE "${BP_CFGFILE_SRC_${CFGKEY}}")
set(DEFAULT_SOURCE GENERATED_FILE "${BP_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${BP_CFGFILE}")
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${BP_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${BP_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
${DEFAULT_SOURCE}
)
endforeach()
14 changes: 7 additions & 7 deletions config/default_bp_msgids.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,33 @@
#ifndef BP_MSGIDS_H
#define BP_MSGIDS_H

/* should define CFE_PLATFORM_CMD_MID_BASE/CFE_PLATFORM_TLM_MID_BASE */
#include "cfe_msgids.h"
/* should define CFE_PLATFORM_CMD_TOPICID_TO_MIDV/CFE_PLATFORM_TLM_TOPICID_TO_MIDV */
#include "cfe_core_api_base_msgids.h"
#include "bp_topicids.h"

/*
* BP application command message id (ground)
*/
#define BP_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_BP_CMD_MSG
#define BP_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_BP_CMD_TOPICID)

/*
* BP send housekeeping message id (internal)
*/
#define BP_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_BP_SEND_HK_MSG
#define BP_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_BP_SEND_HK_TOPICID)

/*
* BP wakeup message id (internal)
*/
#define BP_WAKEUP_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_BP_WAKEUP_MSG
#define BP_WAKEUP_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_BP_WAKEUP_TOPICID)

/*
* BP application telemetry message id (ground)
*/
#define BP_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_BP_HK_TLM_MSG
#define BP_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_BP_HK_TLM_TOPICID)

/*
* BP per flow application telemetry message id (ground)
*/
#define BP_FLOW_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_BP_FLOW_HK_TLM_MSG
#define BP_FLOW_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_BP_FLOW_HK_TLM_TOPICID)

#endif /* !BP_MSGIDS_H */
10 changes: 5 additions & 5 deletions config/default_bp_topicids.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#define BP_TOPICIDS_H

/* telecommands */
#define CFE_MISSION_BP_CMD_MSG 18
#define CFE_MISSION_BP_SEND_HK_MSG 19
#define CFE_MISSION_BP_WAKEUP_MSG 20
#define CFE_MISSION_BP_CMD_TOPICID 18
#define CFE_MISSION_BP_SEND_HK_TOPICID 19
#define CFE_MISSION_BP_WAKEUP_TOPICID 20

/* telemetry */
#define CFE_MISSION_BP_HK_TLM_MSG 17
#define CFE_MISSION_BP_FLOW_HK_TLM_MSG 18
#define CFE_MISSION_BP_HK_TLM_TOPICID 17
#define CFE_MISSION_BP_FLOW_HK_TLM_TOPICID 18

#endif /* BP_TOPICIDS_H */
2 changes: 1 addition & 1 deletion mission_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(BP_MISSION_CONFIG_FILE_LIST
bp_topicids.h
bp_tbl.h
bp_tblstruct.h
bp_topicids.h
)

if (CFE_EDS_ENABLED_BUILD)
Expand All @@ -26,7 +27,6 @@ if (CFE_EDS_ENABLED_BUILD)
set(BP_CFGFILE_SRC_bp_fcncodes "bp_eds_cc.h")
set(BP_CFGFILE_SRC_bp_msgstruct "bp_eds_typedefs.h")
set(BP_CFGFILE_SRC_bp_tblstruct "bp_eds_typedefs.h")
set(BP_CFGFILE_SRC_bp_topicids "bp_eds_designparameters.h")

endif(CFE_EDS_ENABLED_BUILD)

Expand Down

0 comments on commit 6b12b6e

Please sign in to comment.