Skip to content

Commit

Permalink
Fix nasa#2320, reorganize CFE_TESTCASE header files
Browse files Browse the repository at this point in the history
Organize CFE_TESTCASE header file contents according to the convention
  • Loading branch information
dzbaker authored and jphickey committed May 4, 2023
1 parent fedb822 commit 591725e
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 0 deletions.
30 changes: 30 additions & 0 deletions modules/cfe_testcase/arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
###########################################################
#
# TEST Core Module platform build setup
#
# This file is evaluated as part of the "prepare" stage
# and can be used to set up prerequisites for the build,
# such as generating header files
#
###########################################################

# The list of header files that control the TEST configuration
set(TEST_PLATFORM_CONFIG_FILE_LIST
cfe_test_msgids.h
)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(TEST_CFGFILE ${TEST_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${TEST_CFGFILE}" NAME_WE)
if (DEFINED TEST_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE "${TEST_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TEST_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${TEST_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
)
endforeach()
39 changes: 39 additions & 0 deletions modules/cfe_testcase/config/default_cfe_test_msgids.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/************************************************************************
* 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
* CFE Test app (CFE_TEST) Application Message IDs
*/
#ifndef CFE_TEST_MSGIDS_H
#define CFE_TEST_MSGIDS_H

#include "cfe_core_api_base_msgids.h"
#include "cfe_test_topicids.h"

/*
** cFE Command Message Id's
*/
#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */

/*
** CFE Telemetry Message Id's
*/
#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */

#endif
File renamed without changes.
48 changes: 48 additions & 0 deletions modules/cfe_testcase/config/default_cfe_test_topicids.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/************************************************************************
* 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
* CFE Test app (CFE_TESTCASE) Application Topic IDs
*/
#ifndef CFE_TESTCASE_TOPICIDS_H
#define CFE_TESTCASE_TOPICIDS_H

/**
** \cfemissioncfg cFE Portable Message Numbers for Commands
**
** \par Description:
** Portable message numbers for the cFE TEST command messages
**
** \par Limits
** Not Applicable
*/
#define CFE_MISSION_TEST_CMD_MSG 2

/**
** \cfemissioncfg cFE Portable Message Numbers for Telemetry
**
** \par Description:
** Portable message numbers for the cFE TEST telemetry messages
**
** \par Limits
** Not Applicable
*/
#define CFE_MISSION_TEST_HK_TLM_MSG 2

#endif
39 changes: 39 additions & 0 deletions modules/cfe_testcase/config/default_cfe_testcase_msgids.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/************************************************************************
* 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
* CFE Test app (CFE_TEST) Application Message IDs
*/
#ifndef CFE_TEST_MSGIDS_H
#define CFE_TEST_MSGIDS_H

#include "cfe_core_api_base_msgids.h"
#include "cfe_test_topicids.h"

/*
** cFE Command Message Id's
*/
#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */

/*
** CFE Telemetry Message Id's
*/
#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */

#endif
31 changes: 31 additions & 0 deletions modules/cfe_testcase/mission_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
###########################################################
#
# TEST Core Module mission build setup
#
# This file is evaluated as part of the "prepare" stage
# and can be used to set up prerequisites for the build,
# such as generating header files
#
###########################################################

# The list of header files that control the TEST configuration
set(TEST_MISSION_CONFIG_FILE_LIST
cfe_test_tbl.h
cfe_test_topicids.h
)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(TEST_CFGFILE ${TEST_MISSION_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${TEST_CFGFILE}" NAME_WE)
if (DEFINED TEST_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${TEST_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TEST_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${TEST_CFGFILE}"
${DEFAULT_SOURCE}
)
endforeach()

0 comments on commit 591725e

Please sign in to comment.