diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 9e71f60..f246db9 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -2,7 +2,15 @@ name: "CodeQL Analysis" on: push: + branches: + - dev + - main pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: jobs: codeql: diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index bf12f09..9065a28 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -2,8 +2,11 @@ name: Format Check # Run on all push and pull requests on: - push: pull_request: + types: + - opened + - reopened + - synchronize jobs: format-check: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 44688b6..23c427a 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,7 +2,15 @@ name: Reuse Static Analysis on: push: + branches: + - dev + - main pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: jobs: static-analysis: diff --git a/CMakeLists.txt b/CMakeLists.txt index a384943..c88d503 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 3.5) project(CFS_CI_LAB C) set(APP_SRC_FILES @@ -6,7 +5,7 @@ set(APP_SRC_FILES fsw/src/ci_lab_cmds.c ) -if (CFE_EDS_ENABLED_BUILD) +if (CFE_EDS_ENABLED) list(APPEND APP_SRC_FILES fsw/src/ci_lab_eds_dispatch.c fsw/src/ci_lab_eds_decode.c diff --git a/arch_build.cmake b/arch_build.cmake index 200aee6..0d94ee3 100644 --- a/arch_build.cmake +++ b/arch_build.cmake @@ -10,24 +10,12 @@ # The list of header files that control the CI_LAB configuration set(CI_LAB_PLATFORM_CONFIG_FILE_LIST - ci_lab_internal_cfg.h + ci_lab_internal_cfg_values.h ci_lab_platform_cfg.h ci_lab_perfids.h ci_lab_msgids.h + ci_lab_msgid_values.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(CI_LAB_CFGFILE ${CI_LAB_PLATFORM_CONFIG_FILE_LIST}) - get_filename_component(CFGKEY "${CI_LAB_CFGFILE}" NAME_WE) - if (DEFINED CI_LAB_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE GENERATED_FILE "${CI_LAB_CFGFILE_SRC_${CFGKEY}}") - else() - set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CI_LAB_CFGFILE}") - endif() - generate_config_includefile( - FILE_NAME "${CI_LAB_CFGFILE}" - ${DEFAULT_SOURCE} - ) -endforeach() +generate_configfile_set(${CI_LAB_PLATFORM_CONFIG_FILE_LIST}) + diff --git a/config/default_ci_lab_fcncode_values.h b/config/default_ci_lab_fcncode_values.h new file mode 100644 index 0000000..9b495d8 --- /dev/null +++ b/config/default_ci_lab_fcncode_values.h @@ -0,0 +1,43 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * Specification for the CI_LAB command function codes + * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. + */ +#ifndef DEFAULT_CI_LAB_FCNCODE_VALUES_H +#define DEFAULT_CI_LAB_FCNCODE_VALUES_H + +/************************************************************************ + * Macro Definitions + ************************************************************************/ + +#define CI_LAB_CCVAL(x) CI_LAB_FunctionCode_##x + +enum CI_LAB_FunctionCode +{ + CI_LAB_FunctionCode_NOOP = 0, + CI_LAB_FunctionCode_RESET_COUNTERS = 1, +}; + +#endif diff --git a/config/default_ci_lab_interface_cfg_values.h b/config/default_ci_lab_interface_cfg_values.h new file mode 100644 index 0000000..c6cd649 --- /dev/null +++ b/config/default_ci_lab_interface_cfg_values.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * CI_LAB Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided definitions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef DEFAULT_CI_LAB_INTERFACE_CFG_VALUES_H +#define DEFAULT_CI_LAB_INTERFACE_CFG_VALUES_H + +/* Use the default configuration value for all */ +#define CI_LAB_MISSION_CFGVAL(x) DEFAULT_CI_LAB_MISSION_##x + +#endif diff --git a/config/default_ci_lab_internal_cfg_values.h b/config/default_ci_lab_internal_cfg_values.h new file mode 100644 index 0000000..1dec00e --- /dev/null +++ b/config/default_ci_lab_internal_cfg_values.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * CI_LAB Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided definitions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef DEFAULT_CI_LAB_INTERNAL_CFG_VALUES_H +#define DEFAULT_CI_LAB_INTERNAL_CFG_VALUES_H + +/* Use the default configuration value for all */ +#define CI_LAB_PLATFORM_CFGVAL(x) DEFAULT_CI_LAB_PLATFORM_##x + +#endif diff --git a/config/default_ci_lab_mission_cfg.h b/config/default_ci_lab_mission_cfg.h index 60c0a43..29d4a8a 100644 --- a/config/default_ci_lab_mission_cfg.h +++ b/config/default_ci_lab_mission_cfg.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -18,18 +18,19 @@ /** * @file + * CI_LAB Application Public Definitions * - * CI_LAB Application Mission Configuration Header File + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. * - * This is a compatibility header for the "mission_cfg.h" file that has - * traditionally provided public config definitions for each CFS app. - * - * @note This file may be overridden/superceded by mission-provided defintions + * @note This file may be overridden/superceded by mission-provided definitions * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ -#ifndef CI_LAB_MISSION_CFG_H -#define CI_LAB_MISSION_CFG_H +#ifndef DEFAULT_CI_LAB_MISSION_CFG_H +#define DEFAULT_CI_LAB_MISSION_CFG_H #include "ci_lab_interface_cfg.h" diff --git a/config/default_ci_lab_msg.h b/config/default_ci_lab_msg.h index 1f90517..54be46f 100644 --- a/config/default_ci_lab_msg.h +++ b/config/default_ci_lab_msg.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -24,14 +24,14 @@ * This is a compatibility header for the "ci_lab_msg.h" file that has * traditionally provided the message definitions for cFS apps. * - * @note This file may be overridden/superceded by mission-provided defintions + * @note This file may be overridden/superceded by mission-provided definitions * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ -#ifndef CI_LAB_MSG_H -#define CI_LAB_MSG_H +#ifndef DEFAULT_CI_LAB_MSG_H +#define DEFAULT_CI_LAB_MSG_H -#include "ci_lab_interface_cfg.h" +#include "ci_lab_mission_cfg.h" #include "ci_lab_msgdefs.h" #include "ci_lab_msgstruct.h" diff --git a/config/default_ci_lab_msgdefs.h b/config/default_ci_lab_msgdefs.h index 04e876a..01a3806 100644 --- a/config/default_ci_lab_msgdefs.h +++ b/config/default_ci_lab_msgdefs.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -19,12 +19,10 @@ /** * @file * Specification for the CI_LAB command and telemetry - * message constant definitions. - * - * For CI_LAB this is only the function/command code definitions + * message payload and constant definitions. */ -#ifndef CI_LAB_MSGDEFS_H -#define CI_LAB_MSGDEFS_H +#ifndef DEFAULT_CI_LAB_MSGDEFS_H +#define DEFAULT_CI_LAB_MSGDEFS_H #include "ci_lab_fcncodes.h" @@ -34,8 +32,8 @@ */ typedef struct { - uint8 CommandErrorCounter; uint8 CommandCounter; + uint8 CommandErrorCounter; uint8 EnableChecksums; uint8 SocketConnected; uint8 Spare1[8]; diff --git a/config/default_ci_lab_msgid_values.h b/config/default_ci_lab_msgid_values.h new file mode 100644 index 0000000..54181b5 --- /dev/null +++ b/config/default_ci_lab_msgid_values.h @@ -0,0 +1,32 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * CI_LAB Application Message IDs + */ +#ifndef DEFAULT_CI_LAB_MSGID_VALUES_H +#define DEFAULT_CI_LAB_MSGID_VALUES_H + +#include "cfe_core_api_base_msgids.h" +#include "ci_lab_topicids.h" + +#define CI_LAB_CMD_PLATFORM_MIDVAL(x) CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CI_LAB_MISSION_##x##_TOPICID) +#define CI_LAB_TLM_PLATFORM_MIDVAL(x) CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CI_LAB_MISSION_##x##_TOPICID) + +#endif diff --git a/config/default_ci_lab_msgids.h b/config/default_ci_lab_msgids.h index ca6c62f..8b518a0 100644 --- a/config/default_ci_lab_msgids.h +++ b/config/default_ci_lab_msgids.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -20,15 +20,15 @@ * @file * CI_LAB Application Message IDs */ -#ifndef CI_LAB_MSGIDS_H -#define CI_LAB_MSGIDS_H +#ifndef DEFAULT_CI_LAB_MSGIDS_H +#define DEFAULT_CI_LAB_MSGIDS_H #include "cfe_core_api_base_msgids.h" -#include "ci_lab_topicids.h" +#include "ci_lab_msgid_values.h" -#define CI_LAB_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CI_LAB_CMD_TOPICID) -#define CI_LAB_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CI_LAB_SEND_HK_TOPICID) -#define CI_LAB_READ_UPLINK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_CI_LAB_READ_UPLINK_TOPICID) -#define CI_LAB_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_CI_LAB_HK_TLM_TOPICID) +#define CI_LAB_CMD_MID CI_LAB_CMD_PLATFORM_MIDVAL(CMD) +#define CI_LAB_SEND_HK_MID CI_LAB_CMD_PLATFORM_MIDVAL(SEND_HK) +#define CI_LAB_READ_UPLINK_MID CI_LAB_CMD_PLATFORM_MIDVAL(READ_UPLINK) +#define CI_LAB_HK_TLM_MID CI_LAB_TLM_PLATFORM_MIDVAL(HK_TLM) #endif diff --git a/config/default_ci_lab_msgstruct.h b/config/default_ci_lab_msgstruct.h index 8c874a9..1310c5c 100644 --- a/config/default_ci_lab_msgstruct.h +++ b/config/default_ci_lab_msgstruct.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -25,8 +25,8 @@ * Constants and enumerated types related to these message structures * are defined in ci_lab_msgdefs.h. */ -#ifndef CI_LAB_MSGSTRUCT_H -#define CI_LAB_MSGSTRUCT_H +#ifndef DEFAULT_CI_LAB_MSGSTRUCT_H +#define DEFAULT_CI_LAB_MSGSTRUCT_H /************************************************************************ * Includes diff --git a/config/default_ci_lab_perfids.h b/config/default_ci_lab_perfids.h index ca40922..42295c6 100644 --- a/config/default_ci_lab_perfids.h +++ b/config/default_ci_lab_perfids.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -20,8 +20,8 @@ * @file * Define CI Lab Performance IDs */ -#ifndef CI_LAB_PERFIDS_H -#define CI_LAB_PERFIDS_H +#ifndef DEFAULT_CI_LAB_PERFIDS_H +#define DEFAULT_CI_LAB_PERFIDS_H #define CI_LAB_MAIN_TASK_PERF_ID 32 #define CI_LAB_SOCKET_RCV_PERF_ID 33 diff --git a/config/default_ci_lab_platform_cfg.h b/config/default_ci_lab_platform_cfg.h index f179cbe..8a97ca8 100644 --- a/config/default_ci_lab_platform_cfg.h +++ b/config/default_ci_lab_platform_cfg.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -18,22 +18,19 @@ /** * @file + * CI_LAB Application Private Config Definitions * - * CI_LAB Application Platform Configuration Header File + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). * - * This is a compatibility header for the "platform_cfg.h" file that has - * traditionally provided both public and private config definitions - * for each CFS app. - * - * These definitions are now provided in two separate files, one for - * the public/mission scope and one for internal scope. - * - * @note This file may be overridden/superceded by mission-provided defintions + * @note This file may be overridden/superceded by mission-provided definitions * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ -#ifndef CI_LAB_PLATFORM_CFG_H -#define CI_LAB_PLATFORM_CFG_H +#ifndef DEFAULT_CI_LAB_PLATFORM_CFG_H +#define DEFAULT_CI_LAB_PLATFORM_CFG_H #include "ci_lab_mission_cfg.h" #include "ci_lab_internal_cfg.h" diff --git a/config/default_ci_lab_topicids.h b/config/default_ci_lab_topicid_values.h similarity index 67% rename from config/default_ci_lab_topicids.h rename to config/default_ci_lab_topicid_values.h index dd5eaf3..99ebe10 100644 --- a/config/default_ci_lab_topicids.h +++ b/config/default_ci_lab_topicid_values.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -20,12 +20,9 @@ * @file * CI_LAB Application Topic IDs */ -#ifndef CI_LAB_TOPICIDS_H -#define CI_LAB_TOPICIDS_H +#ifndef DEFAULT_CI_LAB_TOPICID_VALUES_H +#define DEFAULT_CI_LAB_TOPICID_VALUES_H -#define CFE_MISSION_CI_LAB_CMD_TOPICID 0x84 -#define CFE_MISSION_CI_LAB_SEND_HK_TOPICID 0x85 -#define CFE_MISSION_CI_LAB_READ_UPLINK_TOPICID 0x86 -#define CFE_MISSION_CI_LAB_HK_TLM_TOPICID 0x84 +#define CI_LAB_MISSION_TIDVAL(x) DEFAULT_CI_LAB_MISSION_##x##_TOPICID #endif diff --git a/config/eds_ci_lab_fcncode_values.h b/config/eds_ci_lab_fcncode_values.h new file mode 100644 index 0000000..b43d420 --- /dev/null +++ b/config/eds_ci_lab_fcncode_values.h @@ -0,0 +1,39 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * Specification for the CFE Executive Services (CI_LAB) command function codes + * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. + */ +#ifndef EDS_CI_LAB_FCNCODES_H +#define EDS_CI_LAB_FCNCODES_H + +#include "ci_lab_eds_cc.h" + +/************************************************************************ + * Macro Definitions + ************************************************************************/ + +#define CI_LAB_CCVAL(x) EDS_CONTAINER_CI_LAB_##x##_CC + +#endif diff --git a/config/eds_ci_lab_interface_cfg_values.h b/config/eds_ci_lab_interface_cfg_values.h new file mode 100644 index 0000000..4b5fffd --- /dev/null +++ b/config/eds_ci_lab_interface_cfg_values.h @@ -0,0 +1,39 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * CI_LAB Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided definitions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef EDS_CI_LAB_INTERFACE_CFG_H +#define EDS_CI_LAB_INTERFACE_CFG_H + +#include "ci_lab_eds_designparameters.h" + +#define CI_LAB_MISSION_CFGVAL(x) EdsParam_CI_LAB_##x + +#endif diff --git a/config/eds_ci_lab_msgdefs.h b/config/eds_ci_lab_msgdefs.h new file mode 100644 index 0000000..6067bc7 --- /dev/null +++ b/config/eds_ci_lab_msgdefs.h @@ -0,0 +1,30 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * Specification for the CI_LAB command and telemetry + * message payload and constant definitions. + */ +#ifndef EDS_CI_LAB_MSGDEFS_H +#define EDS_CI_LAB_MSGDEFS_H + +#include "ci_lab_eds_typedefs.h" +#include "ci_lab_fcncodes.h" + +#endif diff --git a/config/eds_ci_lab_msgstruct.h b/config/eds_ci_lab_msgstruct.h new file mode 100644 index 0000000..3e7aea5 --- /dev/null +++ b/config/eds_ci_lab_msgstruct.h @@ -0,0 +1,32 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * Specification for the CI_LAB command and telemetry + * message data types. + */ +#ifndef EDS_CI_LAB_MSGSTRUCT_H +#define EDS_CI_LAB_MSGSTRUCT_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "ci_lab_eds_typedefs.h" + +#endif diff --git a/config/eds_ci_lab_topicid_values.h b/config/eds_ci_lab_topicid_values.h new file mode 100644 index 0000000..e5c023d --- /dev/null +++ b/config/eds_ci_lab_topicid_values.h @@ -0,0 +1,30 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * Specification for the CI_LAB topic ID values + */ +#ifndef EDS_CI_LAB_TOPICIDS_H +#define EDS_CI_LAB_TOPICIDS_H + +#include "cfe_mission_eds_designparameters.h" + +#define CI_LAB_MISSION_TIDVAL(x) EdsParam_CFE_MISSION_CI_LAB_##x##_TOPICID + +#endif diff --git a/fsw/inc/ci_lab_eventids.h b/fsw/inc/ci_lab_eventids.h index f547063..6becf3d 100644 --- a/fsw/inc/ci_lab_eventids.h +++ b/fsw/inc/ci_lab_eventids.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * diff --git a/config/default_ci_lab_fcncodes.h b/fsw/inc/ci_lab_fcncodes.h similarity index 83% rename from config/default_ci_lab_fcncodes.h rename to fsw/inc/ci_lab_fcncodes.h index 6a0baba..73d71e1 100644 --- a/config/default_ci_lab_fcncodes.h +++ b/fsw/inc/ci_lab_fcncodes.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -28,6 +28,8 @@ #ifndef CI_LAB_FCNCODES_H #define CI_LAB_FCNCODES_H +#include "ci_lab_fcncode_values.h" + /************************************************************************ * Macro Definitions ************************************************************************/ @@ -35,7 +37,7 @@ /* ** CI_LAB command codes */ -#define CI_LAB_NOOP_CC 0 -#define CI_LAB_RESET_COUNTERS_CC 1 +#define CI_LAB_NOOP_CC CI_LAB_CCVAL(NOOP) +#define CI_LAB_RESET_COUNTERS_CC CI_LAB_CCVAL(RESET_COUNTERS) #endif diff --git a/config/default_ci_lab_interface_cfg.h b/fsw/inc/ci_lab_interface_cfg.h similarity index 85% rename from config/default_ci_lab_interface_cfg.h rename to fsw/inc/ci_lab_interface_cfg.h index f2d9d48..400d0bc 100644 --- a/config/default_ci_lab_interface_cfg.h +++ b/fsw/inc/ci_lab_interface_cfg.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -25,13 +25,15 @@ * interface, tables definitions, and any other data products that * serve to exchange information with other entities. * - * @note This file may be overridden/superceded by mission-provided defintions + * @note This file may be overridden/superceded by mission-provided definitions * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ #ifndef CI_LAB_INTERFACE_CFG_H #define CI_LAB_INTERFACE_CFG_H +#include "ci_lab_interface_cfg_values.h" + /** * @brief The base UDP port where CI_LAB will listen for incoming messages * @@ -45,6 +47,7 @@ * * And so forth for however many processor numbers exist in the system */ -#define CI_LAB_BASE_UDP_PORT 1234 +#define CI_LAB_MISSION_BASE_UDP_PORT CI_LAB_MISSION_CFGVAL(BASE_UDP_PORT) +#define DEFAULT_CI_LAB_MISSION_BASE_UDP_PORT 1234 #endif diff --git a/config/default_ci_lab_internal_cfg.h b/fsw/inc/ci_lab_internal_cfg.h similarity index 66% rename from config/default_ci_lab_internal_cfg.h rename to fsw/inc/ci_lab_internal_cfg.h index aa6412d..ef51258 100644 --- a/config/default_ci_lab_internal_cfg.h +++ b/fsw/inc/ci_lab_internal_cfg.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -25,41 +25,49 @@ * to items in this file only affect the local module and will be transparent * to external entities that are using the public interface(s). * - * @note This file may be overridden/superceded by mission-provided defintions + * @note This file may be overridden/superceded by mission-provided definitions * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ #ifndef CI_LAB_INTERNAL_CFG_H #define CI_LAB_INTERNAL_CFG_H +#include "ci_lab_mission_cfg.h" +#include "ci_lab_internal_cfg_values.h" + /** * @brief The size of the input buffer * * This definition controls the maximum size message that can be ingested * from the UDP socket */ -#define CI_LAB_MAX_INGEST 768 +#define CI_LAB_PLATFORM_MAX_INGEST CI_LAB_PLATFORM_CFGVAL(MAX_INGEST) +#define DEFAULT_CI_LAB_PLATFORM_MAX_INGEST 768 /** * @brief Number of packets to process per ingest cycle */ -#define CI_LAB_MAX_INGEST_PKTS 10 +#define CI_LAB_PLATFORM_MAX_INGEST_PKTS CI_LAB_PLATFORM_CFGVAL(MAX_INGEST_PKTS) +#define DEFAULT_CI_LAB_PLATFORM_MAX_INGEST_PKTS 10 /** * @brief SB Receive timeout */ -#define CI_LAB_SB_RECEIVE_TIMEOUT 500 +#define CI_LAB_PLATFORM_SB_RECEIVE_TIMEOUT CI_LAB_PLATFORM_CFGVAL(SB_RECEIVE_TIMEOUT) +#define DEFAULT_CI_LAB_PLATFORM_SB_RECEIVE_TIMEOUT 500 /** * @brief Uplink Receive timeout */ -#define CI_LAB_UPLINK_RECEIVE_TIMEOUT OS_CHECK +#define CI_LAB_PLATFORM_UPLINK_RECEIVE_TIMEOUT CI_LAB_PLATFORM_CFGVAL(UPLINK_RECEIVE_TIMEOUT) +#define DEFAULT_CI_LAB_PLATFORM_UPLINK_RECEIVE_TIMEOUT OS_CHECK /** * @brief The depth of the command input pipe * * This controls the depth of the SB input pipe */ -#define CI_LAB_PIPE_DEPTH 32 +#define CI_LAB_PLATFORM_PIPE_DEPTH CI_LAB_PLATFORM_CFGVAL(PIPE_DEPTH) +#define DEFAULT_CI_LAB_PLATFORM_PIPE_DEPTH 32 #endif diff --git a/fsw/inc/ci_lab_topicids.h b/fsw/inc/ci_lab_topicids.h new file mode 100644 index 0000000..be25d8a --- /dev/null +++ b/fsw/inc/ci_lab_topicids.h @@ -0,0 +1,37 @@ +/************************************************************************ + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" + * + * Copyright (c) 2023 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 + * CI_LAB Application Topic IDs + */ +#ifndef CI_LAB_TOPICIDS_H +#define CI_LAB_TOPICIDS_H + +#include "ci_lab_topicid_values.h" + +#define CI_LAB_MISSION_CMD_TOPICID CI_LAB_MISSION_TIDVAL(CMD) +#define DEFAULT_CI_LAB_MISSION_CMD_TOPICID 0x84 +#define CI_LAB_MISSION_SEND_HK_TOPICID CI_LAB_MISSION_TIDVAL(SEND_HK) +#define DEFAULT_CI_LAB_MISSION_SEND_HK_TOPICID 0x85 +#define CI_LAB_MISSION_READ_UPLINK_TOPICID CI_LAB_MISSION_TIDVAL(READ_UPLINK) +#define DEFAULT_CI_LAB_MISSION_READ_UPLINK_TOPICID 0x86 +#define CI_LAB_MISSION_HK_TLM_TOPICID CI_LAB_MISSION_TIDVAL(HK_TLM) +#define DEFAULT_CI_LAB_MISSION_HK_TLM_TOPICID 0x84 + +#endif diff --git a/fsw/src/ci_lab_app.c b/fsw/src/ci_lab_app.c index 95fc5d2..a7ddc78 100644 --- a/fsw/src/ci_lab_app.c +++ b/fsw/src/ci_lab_app.c @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -65,7 +65,7 @@ void CI_LAB_AppMain(void) CFE_ES_PerfLogExit(CI_LAB_MAIN_TASK_PERF_ID); /* Receive SB buffer, configurable timeout */ - status = CFE_SB_ReceiveBuffer(&SBBufPtr, CI_LAB_Global.CommandPipe, CI_LAB_SB_RECEIVE_TIMEOUT); + status = CFE_SB_ReceiveBuffer(&SBBufPtr, CI_LAB_Global.CommandPipe, CI_LAB_PLATFORM_SB_RECEIVE_TIMEOUT); CFE_ES_PerfLogEntry(CI_LAB_MAIN_TASK_PERF_ID); @@ -104,17 +104,19 @@ void CI_LAB_TaskInit(void) { int32 status; uint16 DefaultListenPort; - char VersionString[CI_LAB_CFG_MAX_VERSION_STR_LEN]; + char VersionString[CI_LAB_CFG_MAX_VERSION_STR_LEN]; memset(&CI_LAB_Global, 0, sizeof(CI_LAB_Global)); + CI_LAB_Global.AllowPassthrough = true; + status = CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY); if (status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("CI_LAB: Error registering for Event Services, RC = 0x%08X\n", (unsigned int)status); } - status = CFE_SB_CreatePipe(&CI_LAB_Global.CommandPipe, CI_LAB_PIPE_DEPTH, "CI_LAB_CMD_PIPE"); + status = CFE_SB_CreatePipe(&CI_LAB_Global.CommandPipe, CI_LAB_PLATFORM_PIPE_DEPTH, "CI_LAB_CMD_PIPE"); if (status == CFE_SUCCESS) { status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CI_LAB_CMD_MID), CI_LAB_Global.CommandPipe); @@ -153,7 +155,7 @@ void CI_LAB_TaskInit(void) else { OS_SocketAddrInit(&CI_LAB_Global.SocketAddress, OS_SocketDomain_INET); - DefaultListenPort = CI_LAB_BASE_UDP_PORT + CFE_PSP_GetProcessorId() - 1; + DefaultListenPort = CI_LAB_MISSION_BASE_UDP_PORT + CFE_PSP_GetProcessorId() - 1; OS_SocketAddrSetPort(&CI_LAB_Global.SocketAddress, DefaultListenPort); status = OS_SocketBind(CI_LAB_Global.SocketID, &CI_LAB_Global.SocketAddress); @@ -180,11 +182,10 @@ void CI_LAB_TaskInit(void) CFE_MSG_Init(CFE_MSG_PTR(CI_LAB_Global.HkTlm.TelemetryHeader), CFE_SB_ValueToMsgId(CI_LAB_HK_TLM_MID), sizeof(CI_LAB_Global.HkTlm)); - CFE_Config_GetVersionString(VersionString, CI_LAB_CFG_MAX_VERSION_STR_LEN, "CI Lab App", - CI_LAB_VERSION, CI_LAB_BUILD_CODENAME, CI_LAB_LAST_OFFICIAL); + CFE_Config_GetVersionString(VersionString, CI_LAB_CFG_MAX_VERSION_STR_LEN, "CI Lab App", CI_LAB_VERSION, + CI_LAB_BUILD_CODENAME, CI_LAB_LAST_OFFICIAL); - CFE_EVS_SendEvent(CI_LAB_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "CI Lab Initialized.%s", - VersionString); + CFE_EVS_SendEvent(CI_LAB_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "CI Lab Initialized.%s", VersionString); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ @@ -218,7 +219,7 @@ void CI_LAB_ReadUpLink(void) CFE_Status_t CfeStatus; CFE_SB_Buffer_t *SBBufPtr; - for (i = 0; i <= CI_LAB_MAX_INGEST_PKTS; i++) + for (i = 0; i <= CI_LAB_PLATFORM_MAX_INGEST_PKTS; i++) { if (CI_LAB_Global.NetBufPtr == NULL) { @@ -231,7 +232,7 @@ void CI_LAB_ReadUpLink(void) } OsStatus = OS_SocketRecvFrom(CI_LAB_Global.SocketID, CI_LAB_Global.NetBufPtr, CI_LAB_Global.NetBufSize, - &CI_LAB_Global.SocketAddress, CI_LAB_UPLINK_RECEIVE_TIMEOUT); + &CI_LAB_Global.SocketAddress, CI_LAB_PLATFORM_UPLINK_RECEIVE_TIMEOUT); if (OsStatus > 0) { CFE_ES_PerfLogEntry(CI_LAB_SOCKET_RCV_PERF_ID); diff --git a/fsw/src/ci_lab_app.h b/fsw/src/ci_lab_app.h index 2180cb7..4ea3eb6 100644 --- a/fsw/src/ci_lab_app.h +++ b/fsw/src/ci_lab_app.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -55,6 +55,7 @@ typedef struct { bool SocketConnected; bool Scheduled; + bool AllowPassthrough; CFE_SB_PipeId_t CommandPipe; osal_id_t SocketID; OS_SockAddr_t SocketAddress; diff --git a/fsw/src/ci_lab_cmds.c b/fsw/src/ci_lab_cmds.c index e19d9fc..71dc74f 100644 --- a/fsw/src/ci_lab_cmds.c +++ b/fsw/src/ci_lab_cmds.c @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * diff --git a/fsw/src/ci_lab_cmds.h b/fsw/src/ci_lab_cmds.h index a26ff76..579277a 100644 --- a/fsw/src/ci_lab_cmds.h +++ b/fsw/src/ci_lab_cmds.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * diff --git a/fsw/src/ci_lab_decode.h b/fsw/src/ci_lab_decode.h index db4b2ff..780d01c 100644 --- a/fsw/src/ci_lab_decode.h +++ b/fsw/src/ci_lab_decode.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * diff --git a/fsw/src/ci_lab_dispatch.c b/fsw/src/ci_lab_dispatch.c index 6cd94a0..842c6ad 100644 --- a/fsw/src/ci_lab_dispatch.c +++ b/fsw/src/ci_lab_dispatch.c @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -108,28 +108,43 @@ void CI_LAB_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ void CI_LAB_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) { - CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + static CFE_SB_MsgId_t CMD_MID = CFE_SB_MSGID_RESERVED; + static CFE_SB_MsgId_t SEND_HK_MID = CFE_SB_MSGID_RESERVED; + static CFE_SB_MsgId_t READ_UPLINK_MID = CFE_SB_MSGID_RESERVED; - CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MsgId); + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; - switch (CFE_SB_MsgIdToValue(MsgId)) + /* cache the local MID Values here, this avoids repeat lookups */ + if (!CFE_SB_IsValidMsgId(CMD_MID)) { - case CI_LAB_CMD_MID: - CI_LAB_ProcessGroundCommand(SBBufPtr); - break; - - case CI_LAB_SEND_HK_MID: - CI_LAB_SendHkCmd((const CI_LAB_SendHkCmd_t *)SBBufPtr); - break; + CMD_MID = CFE_SB_ValueToMsgId(CI_LAB_CMD_MID); + SEND_HK_MID = CFE_SB_ValueToMsgId(CI_LAB_SEND_HK_MID); + READ_UPLINK_MID = CFE_SB_ValueToMsgId(CI_LAB_READ_UPLINK_MID); + } - case CI_LAB_READ_UPLINK_MID: - CI_LAB_ReadUplinkCmd((const CI_LAB_ReadUplinkCmd_t *)SBBufPtr); - break; + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MsgId); - default: - CI_LAB_Global.HkTlm.Payload.CommandErrorCounter++; - CFE_EVS_SendEvent(CI_LAB_MID_ERR_EID, CFE_EVS_EventType_ERROR, "CI: invalid command packet,MID = 0x%x", - (unsigned int)CFE_SB_MsgIdToValue(MsgId)); - break; + /* Process all SB messages */ + if (CFE_SB_MsgId_Equal(MsgId, SEND_HK_MID)) + { + /* Housekeeping request */ + CI_LAB_SendHkCmd((const CI_LAB_SendHkCmd_t *)SBBufPtr); + } + else if (CFE_SB_MsgId_Equal(MsgId, READ_UPLINK_MID)) + { + /* Scheduler command */ + CI_LAB_ReadUplinkCmd((const CI_LAB_ReadUplinkCmd_t *)SBBufPtr); + } + else if (CFE_SB_MsgId_Equal(MsgId, CMD_MID)) + { + /* Ground command */ + CI_LAB_ProcessGroundCommand(SBBufPtr); + } + else + { + /* Unknown command */ + CI_LAB_Global.HkTlm.Payload.CommandErrorCounter++; + CFE_EVS_SendEvent(CI_LAB_MID_ERR_EID, CFE_EVS_EventType_ERROR, "CI: invalid command packet,MID = 0x%x", + (unsigned int)CFE_SB_MsgIdToValue(MsgId)); } } diff --git a/fsw/src/ci_lab_dispatch.h b/fsw/src/ci_lab_dispatch.h index be18fb8..419accb 100644 --- a/fsw/src/ci_lab_dispatch.h +++ b/fsw/src/ci_lab_dispatch.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * diff --git a/fsw/src/ci_lab_eds_decode.c b/fsw/src/ci_lab_eds_decode.c index 72df283..5ca4026 100644 --- a/fsw/src/ci_lab_eds_decode.c +++ b/fsw/src/ci_lab_eds_decode.c @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -32,7 +32,9 @@ #include "cfe_config.h" +#include "edslib_global.h" #include "edslib_datatypedb.h" +#include "edslib_intfdb.h" #include "ci_lab_eds_typedefs.h" #include "cfe_missionlib_api.h" #include "cfe_missionlib_runtime.h" @@ -59,102 +61,228 @@ CFE_Status_t CI_LAB_GetInputBuffer(void **BufferOut, size_t *SizeOut) /* * --------------------------------------- - * In an EDS configuration - the data from the network is encoded - * and this function translates the intermediate buffer content - * to an instance of the CFE_SB_Buffer_t that can be sent to SB. + * Helper function: Decodes the header from the incoming message + * All incoming messages _MUST_ have the standard command header, even if + * the app the command is associated with is not in EDS. * --------------------------------------- */ -CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CFE_SB_Buffer_t **DestBufferOut) +CFE_Status_t CI_LAB_DecodeInputHeader(CFE_SB_Buffer_t *IngestBufPtr, const void *SourceBuffer, + const EdsLib_SizeInfo_t *MaxSize, EdsLib_SizeInfo_t *ProcessedSize) { - int32 EdsStatus; - uint32 BitSize; - CFE_SB_SoftwareBus_PubSub_Interface_t PubSubParams; - CFE_SB_Listener_Component_t ListenerParams; - EdsLib_DataTypeDB_TypeInfo_t CmdHdrInfo; - EdsLib_Id_t EdsId; - CFE_SB_Buffer_t * IngestBufPtr; - CFE_Status_t ResultStatus; + EdsLib_Id_t EdsId; + int32 EdsStatus; + EdsLib_DataTypeDB_TypeInfo_t CmdHdrInfo; + CFE_Status_t ResultStatus; const EdsLib_DatabaseObject_t *EDS_DB = CFE_Config_GetObjPointer(CFE_CONFIGID_MISSION_EDS_DB); - ResultStatus = CFE_STATUS_VALIDATION_FAILURE; - IngestBufPtr = NULL; + EdsId = EDSLIB_MAKE_ID(EDS_INDEX(CFE_HDR), EdsContainer_CFE_HDR_CommandHeader_DATADICTIONARY); + EdsStatus = EdsLib_DataTypeDB_GetTypeInfo(EDS_DB, EdsId, &CmdHdrInfo); + if (EdsStatus != EDSLIB_SUCCESS) + { + OS_printf("EdsLib_DataTypeDB_GetTypeInfo(): %d\n", (int)EdsStatus); + ResultStatus = CFE_STATUS_EXTERNAL_RESOURCE_FAIL; + } + else if (MaxSize->Bits < CmdHdrInfo.Size.Bits) + { + /* sanity check - validate the incoming packet is at least the size of a command header */ + OS_printf("CI_LAB: Size mismatch, BitSize=%lu (packet) / %lu (min)\n", (unsigned long)MaxSize->Bits, + (unsigned long)CmdHdrInfo.Size.Bits); - do + ResultStatus = CFE_STATUS_WRONG_MSG_LENGTH; + } + else { - EdsId = EDSLIB_MAKE_ID(EDS_INDEX(CFE_HDR), CFE_HDR_CommandHeader_DATADICTIONARY); - EdsStatus = EdsLib_DataTypeDB_GetTypeInfo(EDS_DB, EdsId, &CmdHdrInfo); + /* Packet is in external wire-format byte order - unpack it and copy */ + EdsStatus = EdsLib_DataTypeDB_UnpackPartialObjectVarSize(EDS_DB, &EdsId, IngestBufPtr, SourceBuffer, MaxSize, + ProcessedSize); if (EdsStatus != EDSLIB_SUCCESS) { - OS_printf("EdsLib_DataTypeDB_GetTypeInfo(): %d\n", (int)EdsStatus); - break; + OS_printf("EdsLib_DataTypeDB_UnpackPartialObject(Header): %d\n", (int)EdsStatus); + ResultStatus = CFE_STATUS_VALIDATION_FAILURE; } - - /* sanity check - validate the incoming packet is at least the size of a command header */ - BitSize = 8 * SourceSize; - if (BitSize < CmdHdrInfo.Size.Bits) + else { - OS_printf("CI_LAB: Size mismatch, BitSize=%lu (packet) / %lu (min)\n", (unsigned long)BitSize, - (unsigned long)CmdHdrInfo.Size.Bits); - - ResultStatus = CFE_STATUS_WRONG_MSG_LENGTH; - break; + ResultStatus = CFE_SUCCESS; } + } - /* Now get a SB Buffer, as a place to put the decoded data */ - IngestBufPtr = CFE_SB_AllocateMessageBuffer(sizeof(EdsNativeBuffer_CFE_HDR_CommandHeader_t)); - if (IngestBufPtr == NULL) - { - CFE_EVS_SendEvent(CI_LAB_INGEST_ALLOC_ERR_EID, CFE_EVS_EventType_ERROR, - "CI_LAB: buffer allocation failed\n"); + return ResultStatus; +} + +/* + * --------------------------------------- + * Helper function: Decodes the payload from the incoming message + * This is only possible if the app has an EDS. + * --------------------------------------- + */ +CFE_Status_t CI_LAB_DecodeInputPayload(CFE_SB_Buffer_t *IngestBufPtr, EdsLib_Id_t ParentIntfId, + const void *SourceBuffer, const EdsLib_SizeInfo_t *MaxSize, + EdsLib_SizeInfo_t *ProcessedSize) +{ + EdsLib_Id_t EdsId; + int32 EdsStatus; + CFE_Status_t ResultStatus; + + const EdsLib_DatabaseObject_t *EDS_DB = CFE_Config_GetObjPointer(CFE_CONFIGID_MISSION_EDS_DB); + + static const EdsLib_Id_t CFE_SB_TELECOMMAND_ID = + EDSLIB_INTF_ID(EDS_INDEX(CFE_SB), EdsCommand_CFE_SB_Telecommand_indication_DECLARATION); + + ResultStatus = CFE_SUCCESS; - ResultStatus = CFE_SB_BUF_ALOC_ERR; - break; + EdsStatus = EdsLib_IntfDB_FindAllArgumentTypes(EDS_DB, CFE_SB_TELECOMMAND_ID, ParentIntfId, &EdsId, 1); + if (EdsStatus != EDSLIB_SUCCESS) + { + OS_printf("EdsLib_IntfDB_FindAllArgumentTypes(): %d\n", (int)EdsStatus); + ResultStatus = CFE_STATUS_EXTERNAL_RESOURCE_FAIL; + } + else + { + /* Note, this is invoked even if the message is already fully decoded, as it also serves + * to identify the message and check against defined constraints. + * For example, on the CI_LAB_CMD interface, the previous lookup would have + * yielded the EdsId of CI_LAB/CommandBase, but this will update the EdsId + * to e.g. CI_LAB/NoopCmd (with NoopCmd being the same size as CommandBase) */ + EdsStatus = EdsLib_DataTypeDB_UnpackPartialObjectVarSize(EDS_DB, &EdsId, IngestBufPtr, SourceBuffer, MaxSize, + ProcessedSize); + if (EdsStatus != EDSLIB_SUCCESS) + { + OS_printf("EdsLib_DataTypeDB_UnpackPartialObject(Payload): %d\n", (int)EdsStatus); + ResultStatus = CFE_STATUS_EXTERNAL_RESOURCE_FAIL; } + } - /* Packet is in external wire-format byte order - unpack it and copy */ - EdsId = EDSLIB_MAKE_ID(EDS_INDEX(CFE_HDR), CFE_HDR_CommandHeader_DATADICTIONARY); - EdsStatus = EdsLib_DataTypeDB_UnpackPartialObject(EDS_DB, &EdsId, IngestBufPtr, SourceBuffer, - sizeof(EdsDataType_CFE_HDR_CommandHeader_t), BitSize, 0); + if (ResultStatus == CFE_SUCCESS) + { + /* Verify that the checksum and basic fields are correct, and recompute the length entry */ + EdsStatus = EdsLib_DataTypeDB_VerifyUnpackedObjectVarSize(EDS_DB, EdsId, IngestBufPtr, SourceBuffer, + EDSLIB_DATATYPEDB_RECOMPUTE_LENGTH, ProcessedSize); if (EdsStatus != EDSLIB_SUCCESS) { - OS_printf("EdsLib_DataTypeDB_UnpackPartialObject(1): %d\n", (int)EdsStatus); - break; + OS_printf("EdsLib_DataTypeDB_VerifyUnpackedObject(): %d\n", (int)EdsStatus); + ResultStatus = CFE_STATUS_VALIDATION_FAILURE; + } + } + + return ResultStatus; +} + +/* + * --------------------------------------- + * Helper function: Passes through the payload from the incoming message + * This is the historical behavior and may be used as a fallback option + * if the application does not have an EDS. The bits will be copied verbatim. + * --------------------------------------- + */ +CFE_Status_t CI_LAB_PassthruInputPayload(CFE_SB_Buffer_t *IngestBufPtr, const void *SourceBuffer, + const EdsLib_SizeInfo_t *MaxSize, EdsLib_SizeInfo_t *ProcessedSize) +{ + uint8 * Dest; + const uint8 *Src; + size_t HeaderSize; + size_t TotalSize; + CFE_Status_t ResultStatus; + + HeaderSize = EdsLib_BITS_TO_OCTETS(ProcessedSize->Bits); + TotalSize = EdsLib_BITS_TO_OCTETS(MaxSize->Bits); + + if ((TotalSize - HeaderSize) > (MaxSize->Bytes - ProcessedSize->Bytes)) + { + /* will not fit in dest buffer */ + ResultStatus = CFE_SB_MSG_TOO_BIG; + } + else + { + /* If necessary, copy the payload. Some commands (e.g. Noop) do not have a payload */ + if (TotalSize > HeaderSize) + { + Dest = (uint8 *)&IngestBufPtr->Msg; + Src = (const uint8 *)SourceBuffer; + + Dest += ProcessedSize->Bytes; + Src += HeaderSize; + + memcpy(Dest, Src, TotalSize - HeaderSize); } + /* Need to adjust the length, because the header was decoded based on EDS */ + TotalSize -= HeaderSize; + TotalSize += ProcessedSize->Bytes; + + ResultStatus = CFE_MSG_SetSize(&IngestBufPtr->Msg, TotalSize); + } + + return ResultStatus; +} + +/* + * --------------------------------------- + * In an EDS configuration - the data from the network is encoded + * and this function translates the intermediate buffer content + * to an instance of the CFE_SB_Buffer_t that can be sent to SB. + * --------------------------------------- + */ +CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CFE_SB_Buffer_t **DestBufferOut) +{ + int32 EdsStatus; + CFE_SB_SoftwareBus_PubSub_Interface_t PubSubParams; + CFE_SB_Listener_Component_t ListenerParams; + CFE_MissionLib_TopicInfo_t TopicInfo; + CFE_SB_Buffer_t * IngestBufPtr; + CFE_Status_t ResultStatus; + EdsLib_SizeInfo_t MaxSize; + EdsLib_SizeInfo_t ProcessedSize; + + memset(&MaxSize, 0, sizeof(MaxSize)); + memset(&ProcessedSize, 0, sizeof(ProcessedSize)); + + /* Get a SB Buffer, as a place to put the decoded data */ + IngestBufPtr = CFE_SB_AllocateMessageBuffer(sizeof(EdsNativeBuffer_CFE_HDR_CommandHeader_t)); + if (IngestBufPtr == NULL) + { + CFE_EVS_SendEvent(CI_LAB_INGEST_ALLOC_ERR_EID, CFE_EVS_EventType_ERROR, "CI_LAB: buffer allocation failed\n"); + + ResultStatus = CFE_SB_BUF_ALOC_ERR; + } + else + { + MaxSize.Bits = EdsLib_OCTETS_TO_BITS(SourceSize); + MaxSize.Bytes = sizeof(EdsNativeBuffer_CFE_HDR_CommandHeader_t); + ResultStatus = CI_LAB_DecodeInputHeader(IngestBufPtr, SourceBuffer, &MaxSize, &ProcessedSize); + } + + if (ResultStatus == CFE_SUCCESS) + { /* Header decoded successfully - Now need to determine the type for the rest of the payload */ CFE_MissionLib_Get_PubSub_Parameters(&PubSubParams, &IngestBufPtr->Msg.BaseMsg); CFE_MissionLib_UnmapListenerComponent(&ListenerParams, &PubSubParams); - EdsStatus = CFE_MissionLib_GetArgumentType(&CFE_SOFTWAREBUS_INTERFACE, EDS_INTERFACE_ID(CFE_SB_Telecommand), - ListenerParams.Telecommand.TopicId, 1, 1, &EdsId); + /* This determines if there is an EDS mapping for the messge topic */ + EdsStatus = + CFE_MissionLib_GetTopicInfo(&CFE_SOFTWAREBUS_INTERFACE, ListenerParams.Telecommand.TopicId, &TopicInfo); if (EdsStatus != CFE_MISSIONLIB_SUCCESS) { - OS_printf("CFE_MissionLib_GetArgumentType(): %d\n", (int)EdsStatus); - break; + OS_printf("CFE_MissionLib_GetTopicInfo(): %d\n", (int)EdsStatus); + ResultStatus = CFE_STATUS_EXTERNAL_RESOURCE_FAIL; } - - EdsStatus = EdsLib_DataTypeDB_UnpackPartialObject(EDS_DB, &EdsId, IngestBufPtr, SourceBuffer, - sizeof(EdsNativeBuffer_CFE_HDR_CommandHeader_t), BitSize, - sizeof(EdsDataType_CFE_HDR_CommandHeader_t)); - if (EdsStatus != EDSLIB_SUCCESS) + else if (EdsLib_Is_Valid(TopicInfo.ParentIntfId)) { - OS_printf("EdsLib_DataTypeDB_UnpackPartialObject(2): %d\n", (int)EdsStatus); - break; + /* Decode the payload based on EDS */ + ResultStatus = + CI_LAB_DecodeInputPayload(IngestBufPtr, TopicInfo.ParentIntfId, SourceBuffer, &MaxSize, &ProcessedSize); } - - /* Verify that the checksum and basic fields are correct, and recompute the length entry */ - EdsStatus = EdsLib_DataTypeDB_VerifyUnpackedObject(EDS_DB, EdsId, IngestBufPtr, SourceBuffer, - EDSLIB_DATATYPEDB_RECOMPUTE_LENGTH); - if (EdsStatus != EDSLIB_SUCCESS) + else if (CI_LAB_Global.AllowPassthrough) { - OS_printf("EdsLib_DataTypeDB_VerifyUnpackedObject(): %d\n", (int)EdsStatus); - break; + /* No EDS mapping, Just copy the bits */ + ResultStatus = CI_LAB_PassthruInputPayload(IngestBufPtr, SourceBuffer, &MaxSize, &ProcessedSize); } - - /* Finally - at this point, we should have a fully decoded buffer */ - ResultStatus = CFE_SUCCESS; - } while (false); + else + { + OS_printf("CI_LAB_DecodeInputMessage(): No EDS definition for TopicId=%u\n", (unsigned int)ListenerParams.Telecommand.TopicId); + ResultStatus = CFE_STATUS_VALIDATION_FAILURE; + } + } if (ResultStatus != CFE_SUCCESS && IngestBufPtr != NULL) { diff --git a/fsw/src/ci_lab_eds_dispatch.c b/fsw/src/ci_lab_eds_dispatch.c index 43e0282..c4a4610 100644 --- a/fsw/src/ci_lab_eds_dispatch.c +++ b/fsw/src/ci_lab_eds_dispatch.c @@ -41,7 +41,7 @@ * Define a lookup table for CI lab command codes */ /* clang-format off */ -static const EdsDispatchTable_CI_LAB_Application_CFE_SB_Telecommand_t CI_LAB_TC_DISPATCH_TABLE = +static const EdsDispatchTable_EdsComponent_CI_LAB_Application_CFE_SB_Telecommand_t CI_LAB_TC_DISPATCH_TABLE = { .CMD = { @@ -78,7 +78,7 @@ void CI_LAB_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MsgId); - Status = EdsDispatch_CI_LAB_Application_Telecommand(SBBufPtr, &CI_LAB_TC_DISPATCH_TABLE); + Status = EdsDispatch_EdsComponent_CI_LAB_Application_Telecommand(SBBufPtr, &CI_LAB_TC_DISPATCH_TABLE); if (Status != CFE_SUCCESS) { diff --git a/fsw/src/ci_lab_passthru_decode.c b/fsw/src/ci_lab_passthru_decode.c index 05d41e8..daf0703 100644 --- a/fsw/src/ci_lab_passthru_decode.c +++ b/fsw/src/ci_lab_passthru_decode.c @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -44,7 +44,7 @@ CFE_Status_t CI_LAB_GetInputBuffer(void **BufferOut, size_t *SizeOut) { CFE_SB_Buffer_t *IngestBuffer; - const size_t IngestSize = CI_LAB_MAX_INGEST; + const size_t IngestSize = CI_LAB_PLATFORM_MAX_INGEST; IngestBuffer = CFE_SB_AllocateMessageBuffer(IngestSize); if (IngestBuffer == NULL) diff --git a/fsw/src/ci_lab_version.h b/fsw/src/ci_lab_version.h index 1381e30..518be36 100644 --- a/fsw/src/ci_lab_version.h +++ b/fsw/src/ci_lab_version.h @@ -1,7 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2020 United States Government as represented by the + * Copyright (c) 2023 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * @@ -25,22 +25,22 @@ /* Development Build Macro Definitions */ -#define CI_LAB_BUILD_NUMBER 61 /*!< Development Build: Number of commits since baseline */ -#define CI_LAB_BUILD_BASELINE "equuleus-rc1" /*!< Development Build: git tag that is the base for the current development */ -#define CI_LAB_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */ -#define CI_LAB_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */ +#define CI_LAB_BUILD_NUMBER 0 /*!< Development Build: Number of commits since baseline */ +#define CI_LAB_BUILD_BASELINE "v7.0.0" /*!< Development Build: git tag that is the base for the current development */ +#define CI_LAB_BUILD_DEV_CYCLE "v7.0.0" /**< @brief Development: Release name for current development cycle */ +#define CI_LAB_BUILD_CODENAME "Draco" /**< @brief: Development: Code name for the current build */ /* * Version Macros, see \ref cfsversions for definitions. */ -#define CI_LAB_MAJOR_VERSION 2 /*!< @brief Major version number */ -#define CI_LAB_MINOR_VERSION 3 /*!< @brief Minor version number */ +#define CI_LAB_MAJOR_VERSION 7 /*!< @brief Major version number */ +#define CI_LAB_MINOR_VERSION 0 /*!< @brief Minor version number */ #define CI_LAB_REVISION 0 /*!< @brief Revision version number. Value of 0 indicates a development version.*/ /** * @brief Last official release. */ -#define CI_LAB_LAST_OFFICIAL "v2.3.0" +#define CI_LAB_LAST_OFFICIAL "v7.0.0" /*! * @brief Mission revision. @@ -49,7 +49,7 @@ * Values 1-254 are reserved for mission use to denote patches/customizations as needed. NOTE: Reserving 0 and 0xFF for * cFS open-source development use (pending resolution of nasa/cFS#440) */ -#define CI_LAB_MISSION_REV 0xFF +#define CI_LAB_MISSION_REV 0x0 #define CI_LAB_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */ #define CI_LAB_STR(x) CI_LAB_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer macros */ diff --git a/mission_build.cmake b/mission_build.cmake index 01c0934..7f091a4 100644 --- a/mission_build.cmake +++ b/mission_build.cmake @@ -10,38 +10,15 @@ # The list of header files that control the CI_LAB configuration set(CI_LAB_MISSION_CONFIG_FILE_LIST - ci_lab_fcncodes.h - ci_lab_interface_cfg.h + ci_lab_fcncode_values.h + ci_lab_interface_cfg_values.h ci_lab_mission_cfg.h ci_lab_perfids.h - ci_lab_msgdefs.h ci_lab_msg.h + ci_lab_msgdefs.h ci_lab_msgstruct.h - ci_lab_topicids.h + ci_lab_topicid_values.h ) -if (CFE_EDS_ENABLED_BUILD) - - # In an EDS-based build, these files come generated from the EDS tool - set(CI_LAB_CFGFILE_SRC_ci_lab_interface_cfg "ci_lab_eds_designparameters.h") - set(CI_LAB_CFGFILE_SRC_ci_lab_msgdefs "ci_lab_eds_typedefs.h") - set(CI_LAB_CFGFILE_SRC_ci_lab_msgstruct "ci_lab_eds_typedefs.h") - set(CI_LAB_CFGFILE_SRC_ci_lab_fcncodes "ci_lab_eds_cc.h") - -endif(CFE_EDS_ENABLED_BUILD) +generate_configfile_set(${CI_LAB_MISSION_CONFIG_FILE_LIST}) -# Create wrappers around the all the config header files -# This makes them individually overridable by the missions, without modifying -# the distribution default copies -foreach(CI_LAB_CFGFILE ${CI_LAB_MISSION_CONFIG_FILE_LIST}) - get_filename_component(CFGKEY "${CI_LAB_CFGFILE}" NAME_WE) - if (DEFINED CI_LAB_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE GENERATED_FILE "${CI_LAB_CFGFILE_SRC_${CFGKEY}}") - else() - set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CI_LAB_CFGFILE}") - endif() - generate_config_includefile( - FILE_NAME "${CI_LAB_CFGFILE}" - ${DEFAULT_SOURCE} - ) -endforeach()