Skip to content

Commit

Permalink
Merge pull request #423 from jphickey/fix-297-topicid
Browse files Browse the repository at this point in the history
Fix #297, use TopicID for MsgID assignment
  • Loading branch information
dmknutsen authored Dec 15, 2023
2 parents 27f7532 + 4378398 commit ecbf0c6
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 15 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(CF_PLATFORM_CONFIG_FILE_LIST
cf_platform_cfg.h
)

if (CFE_EDS_ENABLED_BUILD)

# In an EDS-based build, msgids come generated from the EDS tool
set(CF_CFGFILE_SRC_cf_msgids "${CMAKE_CURRENT_LIST_DIR}/config/cf_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(CF_CFGFILE ${CF_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${CF_CFGFILE}" NAME_WE)
if (DEFINED CF_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE "${CF_CFGFILE_SRC_${CFGKEY}}")
set(DEFAULT_SOURCE GENERATED_FILE "${CF_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CF_CFGFILE}")
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CF_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${CF_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
${DEFAULT_SOURCE}
)
endforeach()
33 changes: 28 additions & 5 deletions config/default_cf_msgids.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,22 @@
#ifndef CF_MSGIDS_H
#define CF_MSGIDS_H

#include "cfe_core_api_base_msgids.h"
#include "cf_topicids.h"

/**
* \defgroup cfscfcmdmid CFS CFDP Command Message IDs
* \{
*/

#define CF_CMD_MID (0x18B3) /**< \brief Message ID for commands */
#define CF_SEND_HK_MID (0x18B4) /**< \brief Message ID to request housekeeping telemetry */
#define CF_WAKE_UP_MID (0x18B5) /**< \brief Message ID for waking up the processing cycle */
/** \brief Message ID for commands */
#define CF_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CF_CMD_TOPICID)

/** \brief Message ID to request housekeeping telemetry */
#define CF_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CF_SEND_HK_TOPICID)

/** \brief Message ID for waking up the processing cycle */
#define CF_WAKE_UP_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CF_WAKE_UP_TOPICID)

/**\}*/

Expand All @@ -40,8 +48,23 @@
* \{
*/

#define CF_HK_TLM_MID (0x08B0) /**< \brief Message ID for housekeeping telemetry */
#define CF_EOT_TLM_MID (0x08B3) /**< \brief Message ID for end of transaction telemetry */
/** \brief Message ID for housekeeping telemetry */
#define CF_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_CF_HK_TLM_TOPICID)

/** \brief Message ID for end of transaction telemetry */
#define CF_EOT_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_CF_EOT_TLM_TOPICID)

/**\}*/

/**
* \defgroup cfscfdatamid CFS CFDP Data Interface Message IDs
* \{
*/

#define CF_CH0_TX_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_CF_CH0_TX_TOPICID)
#define CF_CH1_TX_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_CF_CH1_TX_TOPICID)
#define CF_CH0_RX_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CF_CH0_RX_TOPICID)
#define CF_CH1_RX_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CF_CH1_RX_TOPICID)

/**\}*/

Expand Down
53 changes: 53 additions & 0 deletions config/default_cf_topicids.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/************************************************************************
* NASA Docket No. GSC-18,447-1, and identified as “CFS CFDP (CF)
* Application version 3.0.0”
*
* Copyright (c) 2019 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
* CFDP (CF) Application Topic IDs
*/
#ifndef CF_TOPICIDS_H
#define CF_TOPICIDS_H


/*
* The following topic IDs are for the software bus control interface
* These are for the normal CF app commands and telemtry
*/

#define CFE_MISSION_CF_CMD_TOPICID 0xB3 /**< \brief Message ID for commands */
#define CFE_MISSION_CF_SEND_HK_TOPICID 0xB4 /**< \brief Message ID to request housekeeping telemetry */
#define CFE_MISSION_CF_WAKE_UP_TOPICID 0xB5 /**< \brief Message ID for waking up the processing cycle */
#define CFE_MISSION_CF_HK_TLM_TOPICID 0xB0 /**< \brief Message ID for housekeeping telemetry */
#define CFE_MISSION_CF_EOT_TLM_TOPICID 0xB3 /**< \brief Message ID for end of transaction telemetry */

/*
* The following topic IDs are for the data interface (PDUs)
* These are for the actual CF file transfer activity
*
* Note that the TX-direction (CF output) side is a "telemetry" topic and
* the RX-direction (CF input) is a "command" topic. In reality they are
* just plain data in both directions, but they are encapsulated into a
* CMD or TLM message to be sent across the software bus.
*/
#define CFE_MISSION_CF_CH0_TX_TOPICID 0xB4
#define CFE_MISSION_CF_CH1_TX_TOPICID 0xB5
#define CFE_MISSION_CF_CH0_RX_TOPICID 0xB6
#define CFE_MISSION_CF_CH1_RX_TOPICID 0xB7

#endif
1 change: 1 addition & 0 deletions mission_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set(CF_MISSION_CONFIG_FILE_LIST
cf_tbldefs.h
cf_tbl.h
cf_tblstruct.h
cf_topicids.h
)

if (CFE_EDS_ENABLED_BUILD)
Expand Down

0 comments on commit ecbf0c6

Please sign in to comment.