diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 38ca02e..6d192ea 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -2,7 +2,15 @@ name: Build and Deploy Documentation on: push: + branches: + - dev + - main pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: jobs: build-documentation: diff --git a/.github/workflows/build-run-app.yml b/.github/workflows/build-run-app.yml index 52bbb8c..b780d37 100644 --- a/.github/workflows/build-run-app.yml +++ b/.github/workflows/build-run-app.yml @@ -2,7 +2,15 @@ name: Build and Run on: push: + branches: + - dev + - main pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: jobs: build-run: diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index d5daf7e..f1a9f72 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -2,8 +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 b9d1f11..441199a 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 fa6bb81..800c300 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -3,7 +3,15 @@ name: Static Analysis # Run on all push and pull requests on: push: + branches: + - dev + - main pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: jobs: static-analysis: diff --git a/.github/workflows/unit-test-coverage.yml b/.github/workflows/unit-test-coverage.yml index d67e62b..5056711 100644 --- a/.github/workflows/unit-test-coverage.yml +++ b/.github/workflows/unit-test-coverage.yml @@ -2,7 +2,15 @@ name: Unit Test and Coverage on: push: + branches: + - dev + - main pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: jobs: unit-test-coverage: diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d5697f..95b68ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,12 +4,21 @@ set(APP_SRC_FILES fsw/src/lc_custom.c fsw/src/lc_app.c fsw/src/lc_cmds.c - fsw/src/lc_dispatch.c fsw/src/lc_watch.c fsw/src/lc_action.c fsw/src/lc_utils.c ) +if (CFE_EDS_ENABLED) + list(APPEND APP_SRC_FILES + fsw/src/lc_eds_dispatch.c + ) +else() + list(APPEND APP_SRC_FILES + fsw/src/lc_dispatch.c + ) +endif() + # Create the app module add_cfe_app(lc ${APP_SRC_FILES}) diff --git a/arch_build.cmake b/arch_build.cmake index b829065..4827a07 100644 --- a/arch_build.cmake +++ b/arch_build.cmake @@ -10,24 +10,10 @@ # The list of header files that control the app configuration set(LC_PLATFORM_CONFIG_FILE_LIST - lc_internal_cfg.h - lc_msgids.h + lc_internal_cfg_values.h lc_platform_cfg.h + lc_msgid_values.h + lc_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(LC_CFGFILE ${LC_PLATFORM_CONFIG_FILE_LIST}) - get_filename_component(CFGKEY "${LC_CFGFILE}" NAME_WE) - if (DEFINED LC_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE GENERATED_FILE "${LC_CFGFILE_SRC_${CFGKEY}}") - else() - set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${LC_CFGFILE}") - endif() - - generate_config_includefile( - FILE_NAME "${LC_CFGFILE}" - ${DEFAULT_SOURCE} - ) -endforeach() +generate_configfile_set(${LC_PLATFORM_CONFIG_FILE_LIST}) \ No newline at end of file diff --git a/config/default_lc_fcncode_values.h b/config/default_lc_fcncode_values.h new file mode 100644 index 0000000..915b47c --- /dev/null +++ b/config/default_lc_fcncode_values.h @@ -0,0 +1,45 @@ +/************************************************************************ + * 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 CFS Limit Checker (LC) command and telemetry + * message function code definitions. + * + */ +#ifndef DEFAULT_LC_FCNCODE_VALUES_H +#define DEFAULT_LC_FCNCODE_VALUES_H + +/************************************************************************ + * Macro Definitions + ************************************************************************/ + + #define LC_CCVAL(x) LC_FunctionCode_##x + + enum LC_FunctionCode + { + LC_FunctionCode_NOOP = 0, + LC_FunctionCode_RESET_COUNTERS = 1, + LC_FunctionCode_SET_LC_STATE = 2, + LC_FunctionCode_SET_AP_STATE = 3, + LC_FunctionCode_SET_AP_PERM_OFF = 4, + LC_FunctionCode_RESET_AP_STATS = 5, + LC_FunctionCode_RESET_WP_STATS = 6, + }; + + #endif \ No newline at end of file diff --git a/config/default_lc_interface_cfg_values.h b/config/default_lc_interface_cfg_values.h new file mode 100644 index 0000000..4e65a2c --- /dev/null +++ b/config/default_lc_interface_cfg_values.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 + * CFS Limit Checker (LC) 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/or the public API, if applicable. + * + * @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_LC_INTERFACE_CFG_VALUES_H +#define DEFAULT_LC_INTERFACE_CFG_VALUES_H + +/* Use the default configuration value for all */ +#define LC_INTERFACE_CFGVAL(x) DEFAULT_LC_##x + +#endif \ No newline at end of file diff --git a/config/default_lc_internal_cfg_values.h b/config/default_lc_internal_cfg_values.h new file mode 100644 index 0000000..b9b0aab --- /dev/null +++ b/config/default_lc_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 + * CFS Limit Checker (LC) 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_LC_INTERNAL_CFG_VALUES_H +#define DEFAULT_LC_INTERNAL_CFG_VALUES_H + +/* Use the default configuration value for all */ +#define LC_INTERNAL_CFGVAL(x) DEFAULT_LC_##x + +#endif \ No newline at end of file diff --git a/config/default_lc_mission_cfg.h b/config/default_lc_mission_cfg.h index 26e9548..4e991e1 100644 --- a/config/default_lc_mission_cfg.h +++ b/config/default_lc_mission_cfg.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -29,8 +28,8 @@ * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ -#ifndef LC_MISSION_CFG_H -#define LC_MISSION_CFG_H +#ifndef DEFAULT_LC_MISSION_CFG_H +#define DEFAULT_LC_MISSION_CFG_H #include "lc_interface_cfg.h" diff --git a/config/default_lc_msg.h b/config/default_lc_msg.h index 3e5819a..185dffd 100644 --- a/config/default_lc_msg.h +++ b/config/default_lc_msg.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -29,8 +28,8 @@ * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ -#ifndef LC_MSG_H -#define LC_MSG_H +#ifndef DEFAULT_LC_MSG_H +#define DEFAULT_LC_MSG_H #include "lc_interface_cfg.h" #include "lc_msgdefs.h" diff --git a/config/default_lc_msgdefs.h b/config/default_lc_msgdefs.h index 2ab9708..085516a 100644 --- a/config/default_lc_msgdefs.h +++ b/config/default_lc_msgdefs.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -30,8 +29,8 @@ * TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE! * ADD THEM TO lc_msg.h IF NEEDED! */ -#ifndef LC_MSGDEFS_H -#define LC_MSGDEFS_H +#ifndef DEFAULT_LC_MSGDEFS_H +#define DEFAULT_LC_MSGDEFS_H /************************************************************************ * Includes diff --git a/config/default_lc_msgid_values.h b/config/default_lc_msgid_values.h new file mode 100644 index 0000000..f6a9556 --- /dev/null +++ b/config/default_lc_msgid_values.h @@ -0,0 +1,33 @@ +/************************************************************************ + * 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 + * CFS Limit Checker (LC) Application Message IDs + */ +#ifndef LC_MSGID_VALUES_H +#define LC_MSGID_VALUES_H + +#include "lc_topicids.h" +#include "cfe_core_api_base_msgids.h" + +#define LC_CMD_PLATFORM_MIDVAL(x) CFE_PLATFORM_CMD_TOPICID_TO_MIDV(LC_MISSION_##x##_TOPICID) +#define LC_TLM_PLATFORM_MIDVAL(x) CFE_PLATFORM_TLM_TOPICID_TO_MIDV(LC_MISSION_##x##_TOPICID) + +#endif + diff --git a/config/default_lc_msgids.h b/config/default_lc_msgids.h index 897473a..fd180ec 100644 --- a/config/default_lc_msgids.h +++ b/config/default_lc_msgids.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -21,17 +20,24 @@ * @file * CFS Limit Checker (LC) Application Message IDs */ -#ifndef LC_MSGIDS_H -#define LC_MSGIDS_H +#ifndef DEFAULT_LC_MSGIDS_H +#define DEFAULT_LC_MSGIDS_H + +/* ======== */ +/* Includes */ +/* ======== */ + +#include "cfe_core_api_base_msgids.h" +#include "lc_msgid_values.h" /** * \defgroup cfslccmdmid CFS Limit Checker Command Message IDs * \{ */ -#define LC_CMD_MID 0x18A4 /**< \brief Msg ID for cmds to LC */ -#define LC_SEND_HK_MID 0x18A5 /**< \brief Msg ID to request LC housekeeping */ -#define LC_SAMPLE_AP_MID 0x18A6 /**< \brief Msg ID to request actionpoint sample */ +#define LC_CMD_MID LC_CMD_PLATFORM_MIDVAL(CMD) /**< \brief Msg ID for cmds to LC */ +#define LC_SEND_HK_MID LC_CMD_PLATFORM_MIDVAL(SEND_HK) /**< \brief Msg ID to request LC housekeeping */ +#define LC_SAMPLE_AP_MID LC_CMD_PLATFORM_MIDVAL(SAMPLE_AP) /**< \brief Msg ID to request actionpoint sample */ /**\}*/ @@ -40,7 +46,7 @@ * \{ */ -#define LC_HK_TLM_MID 0x08A7 /**< \brief LC Housekeeping Telemetry */ +#define LC_HK_TLM_MID LC_TLM_PLATFORM_MIDVAL(HK_TLM) /**< \brief LC Housekeeping Telemetry */ /**\}*/ diff --git a/config/default_lc_msgstruct.h b/config/default_lc_msgstruct.h index 3c611f8..2cdfed1 100644 --- a/config/default_lc_msgstruct.h +++ b/config/default_lc_msgstruct.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -35,8 +34,8 @@ * declarations (see the main comment block in lc_msgdefs.h for more * info). */ -#ifndef LC_MSGSTRUCT_H -#define LC_MSGSTRUCT_H +#ifndef DEFAULT_LC_MSGSTRUCT_H +#define DEFAULT_LC_MSGSTRUCT_H /************************************************************************ * Includes diff --git a/config/default_lc_platform_cfg.h b/config/default_lc_platform_cfg.h index 205c336..f830fcc 100644 --- a/config/default_lc_platform_cfg.h +++ b/config/default_lc_platform_cfg.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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,8 +31,8 @@ * either by overriding this header or by generating definitions from a command/data * dictionary tool. */ -#ifndef LC_PLATFORM_CFG_H -#define LC_PLATFORM_CFG_H +#ifndef DEFAULT_LC_PLATFORM_CFG_H +#define DEFAULT_LC_PLATFORM_CFG_H #include "lc_mission_cfg.h" #include "lc_internal_cfg.h" diff --git a/config/default_lc_tbl.h b/config/default_lc_tbl.h index e3e99b0..3b1c3cb 100644 --- a/config/default_lc_tbl.h +++ b/config/default_lc_tbl.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -23,8 +22,8 @@ * structures * */ -#ifndef LC_TBL_H -#define LC_TBL_H +#ifndef DEFAULT_LC_TBL_H +#define DEFAULT_LC_TBL_H /************************************************************************* * Includes diff --git a/config/default_lc_tbldefs.h b/config/default_lc_tbldefs.h index f38029d..fca9931 100644 --- a/config/default_lc_tbldefs.h +++ b/config/default_lc_tbldefs.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -30,8 +29,8 @@ * TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE! * ADD THEM TO lc_tbl.h IF NEEDED! */ -#ifndef LC_TBLDEFS_H -#define LC_TBLDEFS_H +#ifndef DEFAULT_LC_TBLDEFS_H +#define DEFAULT_LC_TBLDEFS_H /************************************************************************ * Macro Definitions diff --git a/config/default_lc_tblstruct.h b/config/default_lc_tblstruct.h index ffcd466..071d676 100644 --- a/config/default_lc_tblstruct.h +++ b/config/default_lc_tblstruct.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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,8 +27,8 @@ * dictionary tool. */ -#ifndef LC_TBLSTRUCT_H -#define LC_TBLSTRUCT_H +#ifndef DEFAULT_LC_TBLSTRUCT_H +#define DEFAULT_LC_TBLSTRUCT_H #include "common_types.h" #include "lc_interface_cfg.h" diff --git a/config/default_lc_topicid_values.h b/config/default_lc_topicid_values.h new file mode 100644 index 0000000..900a773 --- /dev/null +++ b/config/default_lc_topicid_values.h @@ -0,0 +1,28 @@ +/************************************************************************ + * 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 LC topic ID values + */ +#ifndef DEFAULT_LC_TOPICID_VALUES_H +#define DEFAULT_LC_TOPICID_VALUES_H + +#define LC_MISSION_TIDVAL(x) DEFAULT_LC_MISSION_##x##_TOPICID + +#endif \ No newline at end of file diff --git a/config/eds_lc_fcncode_values.h b/config/eds_lc_fcncode_values.h new file mode 100644 index 0000000..d74087d --- /dev/null +++ b/config/eds_lc_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 CFS Limit Checker (LC) 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_LC_FCNCODE_VALUES_H +#define EDS_LC_FCNCODE_VALUES_H + +#include "lc_eds_cc.h" + +/************************************************************************ + * Macro Definitions + ************************************************************************/ + +#define LC_CCVAL(x) EDS_CONTAINER_LC_##x##_CC + +#endif \ No newline at end of file diff --git a/config/eds_lc_interface_cfg_values.h b/config/eds_lc_interface_cfg_values.h new file mode 100644 index 0000000..e34a3de --- /dev/null +++ b/config/eds_lc_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 + * CFS Limit Checker (LC) 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/or the public API, if applicable. + * + * @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_LC_INTERFACE_CFG_VALUES_H +#define EDS_LC_INTERFACE_CFG_VALUES_H + +#include "lc_eds_designparameters.h" + +#define LC_INTERFACE_CFGVAL(x) EdsParam_LC_##x + +#endif \ No newline at end of file diff --git a/config/eds_lc_msgdefs.h b/config/eds_lc_msgdefs.h new file mode 100644 index 0000000..6f1082b --- /dev/null +++ b/config/eds_lc_msgdefs.h @@ -0,0 +1,42 @@ +/************************************************************************ + * 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 CFS Limit Checker (LC) command and telemetry + * message constant definitions. + * + * @note + * These Macro definitions have been put in this file (instead of + * lc_msg.h) so this file can be included directly into ASIST build + * test scripts. ASIST RDL files can accept C language \#defines but + * can't handle type definitions. As a result: DO NOT PUT ANY + * TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE! + * ADD THEM TO lc_msg.h IF NEEDED! + */ +#ifndef EDS_LC_MSGDEFS_H +#define EDS_LC_MSGDEFS_H + +#include "lc_eds_typedefs.h" +#include "lc_fcncodes.h" + +#ifndef LC_OMIT_DEPRECATED +#define LC_ACTION_NOT_USED LC_APSTATE_NOT_USED +#endif + +#endif \ No newline at end of file diff --git a/config/eds_lc_msgstruct.h b/config/eds_lc_msgstruct.h new file mode 100644 index 0000000..a84b82c --- /dev/null +++ b/config/eds_lc_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 LC command and telemetry + * message data types. + */ +#ifndef EDS_LC_MSGSTRUCT_H +#define EDS_LC_MSGSTRUCT_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "lc_eds_typedefs.h" + +#endif \ No newline at end of file diff --git a/config/eds_lc_tbldefs.h b/config/eds_lc_tbldefs.h new file mode 100644 index 0000000..1f685ac --- /dev/null +++ b/config/eds_lc_tbldefs.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 + * Specification for the CFS Limit Checker (LC) table related + * constant definitions. + * + * @note + * These Macro definitions have been put in this file (instead of + * lc_tbl.h) so this file can be included directly into ASIST build + * test scripts. ASIST RDL files can accept C language \#defines but + * can't handle type definitions. As a result: DO NOT PUT ANY + * TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE! + * ADD THEM TO lc_tbl.h IF NEEDED! + */ + + #ifndef EDS_LC_TBLDEFS_H + #define EDS_LC_TBLDEFS_H + + #include "lc_eds_typedefs.h" + + #endif \ No newline at end of file diff --git a/config/eds_lc_tblstruct.h b/config/eds_lc_tblstruct.h new file mode 100644 index 0000000..a5af093 --- /dev/null +++ b/config/eds_lc_tblstruct.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 + * CFS Limit Checker (LC) Application Table Structure Definition + * + */ + +#ifndef EDS_LC_TBLSTRUCT_H +#define EDS_LC_TBLSTRUCT_H + +#include "lc_eds_typedefs.h" + +#endif \ No newline at end of file diff --git a/docs/dox_src/CMakeLists.txt b/docs/dox_src/CMakeLists.txt index 8842434..d0d8bef 100644 --- a/docs/dox_src/CMakeLists.txt +++ b/docs/dox_src/CMakeLists.txt @@ -10,7 +10,6 @@ # case of a self-contained/standalone build) or by a separate script # (useful if integrating into a larger project with a separate doc build) -cmake_minimum_required(VERSION 3.5) project(LC_DOCS NONE) # generate the configuration files diff --git a/eds/LC.xml b/eds/LC.xml new file mode 100644 index 0000000..09aeb21 --- /dev/null +++ b/eds/LC.xml @@ -0,0 +1,588 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fsw/inc/lc_eventids.h b/fsw/inc/lc_eventids.h index 5bb4d79..02b62c5 100644 --- a/fsw/inc/lc_eventids.h +++ b/fsw/inc/lc_eventids.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -21,8 +20,8 @@ * @file * Specification for the CFS Limit Checker (LC) event identifiers. */ -#ifndef LC_EVENTS_H -#define LC_EVENTS_H +#ifndef LC_EVENTIDS_H +#define LC_EVENTIDS_H /** * \defgroup cfslcevents CFS Limit Checker Event IDs diff --git a/config/default_lc_fcncodes.h b/fsw/inc/lc_fcncodes.h similarity index 94% rename from config/default_lc_fcncodes.h rename to fsw/inc/lc_fcncodes.h index b49aaa7..e851f68 100644 --- a/config/default_lc_fcncodes.h +++ b/fsw/inc/lc_fcncodes.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -26,6 +25,8 @@ #ifndef LC_FCNCODES_H #define LC_FCNCODES_H +#include "lc_fcncode_values.h" + /************************************************************************ * Macro Definitions ************************************************************************/ @@ -64,7 +65,7 @@ * * \sa #LC_RESET_CC */ -#define LC_NOOP_CC 0 +#define LC_NOOP_CC LC_CCVAL(NOOP) /** * \brief Reset Counters @@ -95,7 +96,7 @@ * * \sa #LC_NOOP_CC */ -#define LC_RESET_CC 1 +#define LC_RESET_CC LC_CCVAL(RESET_COUNTERS) /** * \brief Set LC Application State @@ -128,7 +129,7 @@ * None * */ -#define LC_SET_LC_STATE_CC 2 +#define LC_SET_LC_STATE_CC LC_CCVAL(SET_LC_STATE) /** * \brief Set AP State @@ -166,7 +167,7 @@ * None * */ -#define LC_SET_AP_STATE_CC 3 +#define LC_SET_AP_STATE_CC LC_CCVAL(SET_AP_STATE) /** * \brief Set AP Permanently Off @@ -201,7 +202,7 @@ * None * */ -#define LC_SET_AP_PERM_OFF_CC 4 +#define LC_SET_AP_PERM_OFF_CC LC_CCVAL(SET_AP_PERM_OFF) /** * \brief Reset AP Statistics @@ -235,7 +236,7 @@ * * \sa #LC_RESET_WP_STATS_CC */ -#define LC_RESET_AP_STATS_CC 5 +#define LC_RESET_AP_STATS_CC LC_CCVAL(RESET_AP_STATS) /** * \brief Reset WP Statistics @@ -269,7 +270,7 @@ * * \sa #LC_RESET_AP_STATS_CC */ -#define LC_RESET_WP_STATS_CC 6 +#define LC_RESET_WP_STATS_CC LC_CCVAL(RESET_WP_STATS) /**\}*/ diff --git a/config/default_lc_interface_cfg.h b/fsw/inc/lc_interface_cfg.h similarity index 85% rename from config/default_lc_interface_cfg.h rename to fsw/inc/lc_interface_cfg.h index 823ec85..e2cdd35 100644 --- a/config/default_lc_interface_cfg.h +++ b/fsw/inc/lc_interface_cfg.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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,11 +18,7 @@ /** * @file - * CFS Limit Checker (LC) 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/or the public API, if applicable. + * CFS Limit Checker (LC) Application Mission Configuration Header File * * @note This file may be overridden/superceded by mission-provided definitions * either by overriding this header or by generating definitions from a command/data @@ -32,6 +27,8 @@ #ifndef LC_INTERFACE_CFG_H #define LC_INTERFACE_CFG_H +#include "lc_interface_cfg_values.h" + /** * \defgroup cfslcmissioncfg CFS Limit Checker Mission Configuration * \{ @@ -57,7 +54,8 @@ * This parameter shouldn't be larger than the value set for * #CFE_PLATFORM_SB_HIGHEST_VALID_MSGID. */ -#define LC_RTS_REQ_MID 0x18A9 +#define LC_RTS_REQ_MID LC_INTERFACE_CFGVAL(RTS_REQ_MID) +#define DEFAULT_LC_RTS_REQ_MID 0x18A9 /** * \brief RTS Request Command Code @@ -75,7 +73,8 @@ * This parameter can't be larger than 127 (the maximum value of * 7-bit number). */ -#define LC_RTS_REQ_CC 4 +#define LC_RTS_REQ_CC LC_INTERFACE_CFGVAL(RTS_REQ_CC) +#define DEFAULT_LC_RTS_REQ_CC 4 /** * \brief Maximum number of watchpoints @@ -100,7 +99,8 @@ * cFE size limit for a single buffered table set by the * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter */ -#define LC_MAX_WATCHPOINTS 176 +#define LC_MAX_WATCHPOINTS LC_INTERFACE_CFGVAL(MAX_WATCHPOINTS) +#define DEFAULT_LC_MAX_WATCHPOINTS 176 /** * \brief Maximum number of actionpoints @@ -124,7 +124,8 @@ * cFE size limit for a single buffered table set by the * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter */ -#define LC_MAX_ACTIONPOINTS 176 +#define LC_MAX_ACTIONPOINTS LC_INTERFACE_CFGVAL(MAX_ACTIONPOINTS) +#define DEFAULT_LC_MAX_ACTIONPOINTS 176 /** * \brief Maximum actionpoint event text string size @@ -145,7 +146,8 @@ * Raising this value will also increase the size of the * Actionpoint Definition Table (ADT) */ -#define LC_MAX_ACTION_TEXT 32 +#define LC_MAX_ACTION_TEXT LC_INTERFACE_CFGVAL(MAX_ACTION_TEXT) +#define DEFAULT_LC_MAX_ACTION_TEXT 32 /** * \brief Maximum reverse polish (RPN) equation size @@ -159,7 +161,8 @@ * Increasing this value will increase the size of the * Actionpoint Definition Table (ADT) */ -#define LC_MAX_RPN_EQU_SIZE 20 +#define LC_MAX_RPN_EQU_SIZE LC_INTERFACE_CFGVAL(MAX_RPN_EQU_SIZE) +#define DEFAULT_LC_MAX_RPN_EQU_SIZE 20 /**\}*/ diff --git a/config/default_lc_internal_cfg.h b/fsw/inc/lc_internal_cfg.h similarity index 75% rename from config/default_lc_internal_cfg.h rename to fsw/inc/lc_internal_cfg.h index b4562e9..dd6dc1a 100644 --- a/config/default_lc_internal_cfg.h +++ b/fsw/inc/lc_internal_cfg.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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,13 +18,8 @@ /** * @file - * CFS Limit Checker (LC) 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). - * + * CFS Limit Checker (LC) Application Platform Configuration Header File + * @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. @@ -33,6 +27,9 @@ #ifndef LC_INTERNAL_CFG_H #define LC_INTERNAL_CFG_H +#include "lc_mission_cfg.h" +#include "lc_internal_cfg_values.h" + /** * \defgroup cfslcplatformcfg CFS Limit Checker Platform Configuration * \{ @@ -53,7 +50,8 @@ * no limits on the definition. Refer to CFE Executive Services * for specific information on limits related to application names. */ -#define LC_APP_NAME "LC" +#define LC_APP_NAME LC_INTERNAL_CFGVAL(APP_NAME) +#define DEFAULT_LC_APP_NAME "LC" /** * \brief Command Pipe Depth @@ -67,7 +65,8 @@ * This parameter can't be larger than an unsigned 16 bit * integer (65535). */ -#define LC_PIPE_DEPTH 12 +#define LC_PIPE_DEPTH LC_INTERNAL_CFGVAL(PIPE_DEPTH) +#define DEFAULT_LC_PIPE_DEPTH 12 /** * \brief LC state after power-on reset @@ -82,7 +81,8 @@ * #LC_STATE_PASSIVE * #LC_STATE_DISABLED */ -#define LC_STATE_POWER_ON_RESET LC_STATE_DISABLED +#define LC_STATE_POWER_ON_RESET LC_INTERNAL_CFGVAL(STATE_POWER_ON_RESET) +#define DEFAULT_LC_STATE_POWER_ON_RESET LC_STATE_DISABLED /** * \brief Save data to CDS compiler switch @@ -98,7 +98,8 @@ * \par Limits: * n/a */ -/* #define LC_SAVE_TO_CDS */ +/* #define LC_SAVE_TO_CDS LC_INTERNAL_CFGVAL(SAVE_TO_CDS) + #define DEFAULT_LC_SAVE_TO_CDS */ /** * \brief LC state when CDS is restored @@ -122,7 +123,8 @@ * #LC_STATE_DISABLED * #LC_STATE_FROM_CDS */ -#define LC_STATE_WHEN_CDS_RESTORED LC_STATE_FROM_CDS +#define LC_STATE_WHEN_CDS_RESTORED LC_INTERNAL_CFGVAL(STATE_WHEN_CDS_RESTORED) +#define DEFAULT_LC_STATE_WHEN_CDS_RESTORED LC_STATE_FROM_CDS /** * \brief Watchpoint Definition Table (WDT) filename @@ -135,7 +137,8 @@ * This string shouldn't be longer than #OS_MAX_PATH_LEN for the * target platform in question */ -#define LC_WDT_FILENAME "/cf/lc_def_wdt.tbl" +#define LC_WDT_FILENAME LC_INTERNAL_CFGVAL(WDT_FILENAME) +#define DEFAULT_LC_WDT_FILENAME "/cf/lc_def_wdt.tbl" /** * \brief Actionpoint Definition Table (ADT) filename @@ -148,7 +151,8 @@ * This string shouldn't be longer than #OS_MAX_PATH_LEN for the * target platform in question */ -#define LC_ADT_FILENAME "/cf/lc_def_adt.tbl" +#define LC_ADT_FILENAME LC_INTERNAL_CFGVAL(ADT_FILENAME) +#define DEFAULT_LC_ADT_FILENAME "/cf/lc_def_adt.tbl" /** * \brief Maximum valid ADT RTS ID @@ -161,7 +165,8 @@ * This parameter can't be larger than an unsigned 16 bit * integer (65535). */ -#define LC_MAX_VALID_ADT_RTSID 0xFFF0 +#define LC_MAX_VALID_ADT_RTSID LC_INTERNAL_CFGVAL(MAX_VALID_ADT_RTSID) +#define DEFAULT_LC_MAX_VALID_ADT_RTSID 0xFFF0 /** * \brief Floating Point Compare Tolerance @@ -174,16 +179,24 @@ * \par Limits: * The LC app does not place a limit on this parameter. */ -#define LC_FLOAT_TOLERANCE (1.0e-25) +#define LC_FLOAT_TOLERANCE LC_INTERNAL_CFGVAL(FLOAT_TOLERANCE) +#define DEFAULT_LC_FLOAT_TOLERANCE (1.0e-25) /** * \name LC Table Name Strings * \{ */ -#define LC_WDT_TABLENAME "LC_WDT" -#define LC_ADT_TABLENAME "LC_ADT" -#define LC_WRT_TABLENAME "LC_WRT" -#define LC_ART_TABLENAME "LC_ART" +#define LC_WDT_TABLENAME LC_INTERNAL_CFGVAL(WDT_TABLENAME) +#define DEFAULT_LC_WDT_TABLENAME "LC_WDT" + +#define LC_ADT_TABLENAME LC_INTERNAL_CFGVAL(ADT_TABLENAME) +#define DEFAULT_LC_ADT_TABLENAME "LC_ADT" + +#define LC_WRT_TABLENAME LC_INTERNAL_CFGVAL(WRT_TABLENAME) +#define DEFAULT_LC_WRT_TABLENAME "LC_WRT" + +#define LC_ART_TABLENAME LC_INTERNAL_CFGVAL(ART_TABLENAME) +#define DEFAULT_LC_ART_TABLENAME "LC_ART" /**\}*/ /** @@ -200,7 +213,8 @@ * Must be defined as a numeric value that is greater than * or equal to zero. */ -#define LC_MISSION_REV 0 +#define LC_MISSION_REV LC_INTERNAL_CFGVAL(MISSION_REV) +#define DEFAULT_LC_MISSION_REV 0 /**\}*/ diff --git a/fsw/inc/lc_perfids.h b/fsw/inc/lc_perfids.h index 7676f19..a7314ab 100644 --- a/fsw/inc/lc_perfids.h +++ b/fsw/inc/lc_perfids.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/inc/lc_topicids.h b/fsw/inc/lc_topicids.h new file mode 100644 index 0000000..1dc139a --- /dev/null +++ b/fsw/inc/lc_topicids.h @@ -0,0 +1,42 @@ +/************************************************************************ + * 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 + * CFS Limit Checker (LC) Application Topic IDs + */ + + #ifndef LC_TOPICIDS_H + #define LC_TOPICIDS_H + +#include "lc_topicid_values.h" + + +#define LC_MISSION_CMD_TOPICID LC_MISSION_TIDVAL(CMD) +#define DEFAULT_LC_MISSION_CMD_TOPICID 0xA4 + +#define LC_MISSION_SEND_HK_TOPICID LC_MISSION_TIDVAL(SEND_HK) +#define DEFAULT_LC_MISSION_SEND_HK_TOPICID 0xA5 + +#define LC_MISSION_SAMPLE_AP_TOPICID LC_MISSION_TIDVAL(SAMPLE_AP) +#define DEFAULT_LC_MISSION_SAMPLE_AP_TOPICID 0xA6 + +#define LC_MISSION_HK_TLM_TOPICID LC_MISSION_TIDVAL(HK_TLM) +#define DEFAULT_LC_MISSION_HK_TLM_TOPICID 0xA7 + +#endif \ No newline at end of file diff --git a/fsw/src/lc_action.c b/fsw/src/lc_action.c index a64febc..17b92c0 100644 --- a/fsw/src/lc_action.c +++ b/fsw/src/lc_action.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_action.h b/fsw/src/lc_action.h index fd1a2eb..1ef5cc3 100644 --- a/fsw/src/lc_action.h +++ b/fsw/src/lc_action.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_app.c b/fsw/src/lc_app.c index a2af0b4..e9b4687 100644 --- a/fsw/src/lc_app.c +++ b/fsw/src/lc_app.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -116,9 +115,14 @@ void LC_AppMain(void) * expected, the routine actions are done here instead. */ Status = LC_PerformMaintenance(); } - else if (Status == CFE_SUCCESS) + else if (Status == CFE_SB_NO_MESSAGE) { - Status = LC_AppPipe(BufPtr); + /* no action, but also no error */ + Status = CFE_SUCCESS; + } + else if (Status == CFE_SUCCESS) + { + LC_AppPipe(BufPtr); } /* diff --git a/fsw/src/lc_app.h b/fsw/src/lc_app.h index d9a31c2..cef4a9d 100644 --- a/fsw/src/lc_app.h +++ b/fsw/src/lc_app.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_cmds.c b/fsw/src/lc_cmds.c index 1b2be6b..3d9717a 100644 --- a/fsw/src/lc_cmds.c +++ b/fsw/src/lc_cmds.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -110,7 +109,7 @@ void LC_SampleAPReq(const CFE_SB_Buffer_t *BufPtr) /* Housekeeping request */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -CFE_Status_t LC_SendHkCmd(const CFE_MSG_CommandHeader_t *MsgPtr) +CFE_Status_t LC_SendHkCmd(const LC_SendHkCmd_t *msg) { uint16 TableIndex; uint16 HKIndex; @@ -263,12 +262,14 @@ CFE_Status_t LC_SendHkCmd(const CFE_MSG_CommandHeader_t *MsgPtr) /* Noop command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void LC_NoopCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_NoopCmd(const LC_NoopCmd_t *msg) { LC_AppData.CmdCount++; CFE_EVS_SendEvent(LC_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op command: Version %d.%d.%d.%d", LC_MAJOR_VERSION, LC_MINOR_VERSION, LC_REVISION, LC_MISSION_REV); + + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -276,11 +277,13 @@ void LC_NoopCmd(const CFE_SB_Buffer_t *BufPtr) /* Reset counters command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void LC_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_ResetCountersCmd(const LC_ResetCountersCmd_t *msg) { LC_ResetCounters(); CFE_EVS_SendEvent(LC_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "Reset counters command"); + + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -304,11 +307,9 @@ void LC_ResetCounters(void) /* Set LC state command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void LC_SetLCStateCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_SetLCStateCmd(const LC_SetLCStateCmd_t *msg) { - const LC_SetLCState_Payload_t *CmdPtr; - - CmdPtr = LC_GET_CMD_PAYLOAD(BufPtr, LC_SetLCStateCmd_t); + const LC_SetLCState_Payload_t *CmdPtr = &msg->Payload; switch (CmdPtr->NewLCState) { @@ -329,6 +330,8 @@ void LC_SetLCStateCmd(const CFE_SB_Buffer_t *BufPtr) LC_AppData.CmdErrCount++; break; } + + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -336,16 +339,14 @@ void LC_SetLCStateCmd(const CFE_SB_Buffer_t *BufPtr) /* Set actionpoint state command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_SetAPStateCmd(const LC_SetAPStateCmd_t *msg) { - const LC_SetAPState_Payload_t *CmdPtr; + const LC_SetAPState_Payload_t *CmdPtr = &msg->Payload; uint32 TableIndex; uint8 CurrentAPState; bool ValidState = true; bool CmdSuccess = false; - CmdPtr = LC_GET_CMD_PAYLOAD(BufPtr, LC_SetAPStateCmd_t); - /* ** Do a sanity check on the new actionpoint state ** specified. @@ -448,6 +449,8 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr) } } /* end ValidState if */ + + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -455,14 +458,12 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr) /* Set actionpoint permanently off command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_SetAPPermOffCmd(const LC_SetAPPermOffCmd_t *msg) { - const LC_SetAPPermOff_Payload_t *CmdPtr; + const LC_SetAPPermOff_Payload_t *CmdPtr = &msg->Payload; uint32 TableIndex; uint8 CurrentAPState; - CmdPtr = LC_GET_CMD_PAYLOAD(BufPtr, LC_SetAPPermOffCmd_t); - if (((CmdPtr->APNumber) == LC_ALL_ACTIONPOINTS) || ((CmdPtr->APNumber) >= LC_MAX_ACTIONPOINTS)) { /* @@ -505,6 +506,8 @@ void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr) } } /* end CmdPtr -> APNumber else */ + + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -512,13 +515,11 @@ void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr) /* Reset actionpoint statistics command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void LC_ResetAPStatsCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_ResetAPStatsCmd(const LC_ResetAPStatsCmd_t *msg) { - const LC_ResetAPStats_Payload_t *CmdPtr; + const LC_ResetAPStats_Payload_t *CmdPtr = &msg->Payload; bool CmdSuccess = false; - CmdPtr = LC_GET_CMD_PAYLOAD(BufPtr, LC_ResetAPStatsCmd_t); - /* arg may be one or all AP's */ if (CmdPtr->APNumber == LC_ALL_ACTIONPOINTS) { @@ -546,6 +547,8 @@ void LC_ResetAPStatsCmd(const CFE_SB_Buffer_t *BufPtr) CFE_EVS_SendEvent(LC_APSTATS_INF_EID, CFE_EVS_EventType_INFORMATION, "Reset AP stats command: AP = %d", CmdPtr->APNumber); } + + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -583,13 +586,11 @@ void LC_ResetResultsAP(uint32 StartIndex, uint32 EndIndex, bool ResetStatsCmd) /* Reset watchpoint statistics command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void LC_ResetWPStatsCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_ResetWPStatsCmd(const LC_ResetWPStatsCmd_t *msg) { - const LC_ResetWPStats_Payload_t *CmdPtr; + const LC_ResetWPStats_Payload_t *CmdPtr = &msg->Payload; bool CmdSuccess = false; - CmdPtr = LC_GET_CMD_PAYLOAD(BufPtr, LC_ResetWPStatsCmd_t); - /* arg may be one or all WP's */ if (CmdPtr->WPNumber == LC_ALL_WATCHPOINTS) { @@ -617,6 +618,8 @@ void LC_ResetWPStatsCmd(const CFE_SB_Buffer_t *BufPtr) CFE_EVS_SendEvent(LC_WPSTATS_INF_EID, CFE_EVS_EventType_INFORMATION, "Reset WP stats command: WP = %d", CmdPtr->WPNumber); } + + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fsw/src/lc_cmds.h b/fsw/src/lc_cmds.h index 550ddf7..0d6bde6 100644 --- a/fsw/src/lc_cmds.h +++ b/fsw/src/lc_cmds.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -29,6 +28,7 @@ * Includes *************************************************************************/ #include "cfe.h" +#include "lc_msg.h" /************************************************************************* * Exported Functions @@ -103,10 +103,10 @@ void LC_SampleAPReq(const CFE_SB_Buffer_t *BufPtr); * \par Assumptions, External Events, and Notes: * This message does not affect the command execution counter * - * \param[in] MsgPtr Pointer to command header + * \param[in] msg Pointer to command header * */ -CFE_Status_t LC_SendHkCmd(const CFE_MSG_CommandHeader_t *MsgPtr); +CFE_Status_t LC_SendHkCmd(const LC_SendHkCmd_t *msg); /** * \brief Noop command @@ -117,11 +117,11 @@ CFE_Status_t LC_SendHkCmd(const CFE_MSG_CommandHeader_t *MsgPtr); * \par Assumptions, External Events, and Notes: * None * - * \param[in] BufPtr Pointer to Software Bus buffer + * \param[in] msg Pointer to command message * * \sa #LC_NOOP_CC */ -void LC_NoopCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t LC_NoopCmd(const LC_NoopCmd_t *msg); /** * \brief Reset counters command @@ -139,11 +139,11 @@ void LC_NoopCmd(const CFE_SB_Buffer_t *BufPtr); * \par Assumptions, External Events, and Notes: * None * - * \param[in] BufPtr Pointer to Software Bus buffer + * \param[in] msg Pointer to command message * * \sa #LC_RESET_CC */ -void LC_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t LC_ResetCountersCmd(const LC_ResetCountersCmd_t *msg); /** * \brief Set LC state command @@ -154,11 +154,11 @@ void LC_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr); * \par Assumptions, External Events, and Notes: * None * - * \param[in] BufPtr Pointer to Software Bus buffer + * \param[in] msg Pointer to command message * * \sa #LC_SET_LC_STATE_CC */ -void LC_SetLCStateCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t LC_SetLCStateCmd(const LC_SetLCStateCmd_t *msg); /** * \brief Set AP state command @@ -169,11 +169,11 @@ void LC_SetLCStateCmd(const CFE_SB_Buffer_t *BufPtr); * \par Assumptions, External Events, and Notes: * None * - * \param[in] BufPtr Pointer to Software Bus buffer + * \param[in] msg Pointer to command message * * \sa #LC_SET_AP_STATE_CC */ -void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t LC_SetAPStateCmd(const LC_SetAPStateCmd_t *msg); /** * \brief Set AP permanently off command @@ -184,11 +184,11 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr); * \par Assumptions, External Events, and Notes: * None * - * \param[in] BufPtr Pointer to Software Bus buffer + * \param[in] msg Pointer to command message * * \sa #LC_SET_AP_PERM_OFF_CC */ -void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t LC_SetAPPermOffCmd(const LC_SetAPPermOffCmd_t *msg); /** * \brief Reset AP statistics command @@ -199,11 +199,11 @@ void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr); * \par Assumptions, External Events, and Notes: * None * - * \param[in] BufPtr Pointer to Software Bus buffer + * \param[in] msg Pointer to command message * * \sa #LC_RESET_AP_STATS_CC */ -void LC_ResetAPStatsCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t LC_ResetAPStatsCmd(const LC_ResetAPStatsCmd_t *msg); /** * \brief Reset WP statistics command @@ -214,10 +214,10 @@ void LC_ResetAPStatsCmd(const CFE_SB_Buffer_t *BufPtr); * \par Assumptions, External Events, and Notes: * None * - * \param[in] BufPtr Pointer to Software Bus buffer + * \param[in] msg Pointer to command message * * \sa #LC_RESET_WP_STATS_CC */ -void LC_ResetWPStatsCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t LC_ResetWPStatsCmd(const LC_ResetWPStatsCmd_t *msg); #endif diff --git a/fsw/src/lc_custom.c b/fsw/src/lc_custom.c index 6735d11..4cd711c 100644 --- a/fsw/src/lc_custom.c +++ b/fsw/src/lc_custom.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_custom.h b/fsw/src/lc_custom.h index 619a90c..1b9dc52 100644 --- a/fsw/src/lc_custom.h +++ b/fsw/src/lc_custom.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_dispatch.c b/fsw/src/lc_dispatch.c index 5bfebe8..039831f 100644 --- a/fsw/src/lc_dispatch.c +++ b/fsw/src/lc_dispatch.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -38,56 +37,65 @@ /* Verify message packet length */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool LC_VerifyMsgLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) +bool LC_VerifyMsgLength(const CFE_MSG_Message_t *msgPtr, size_t ExpectedLength) { bool result = true; CFE_MSG_FcnCode_t CommandCode = 0; size_t ActualLength = 0; - CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + + /* Static MID values for efficient comparison */ + static CFE_SB_MsgId_t SEND_HK_MID = CFE_SB_MSGID_RESERVED; + static CFE_SB_MsgId_t SAMPLE_AP_MID = CFE_SB_MSGID_RESERVED; + + /* Cache the local MID Values here, this avoids repeat lookups */ + if (!CFE_SB_IsValidMsgId(SEND_HK_MID)) + { + SEND_HK_MID = CFE_SB_ValueToMsgId(LC_SEND_HK_MID); + SAMPLE_AP_MID = CFE_SB_ValueToMsgId(LC_SAMPLE_AP_MID); + } + + CFE_MSG_GetSize(msgPtr, &ActualLength); /* ** Verify the message packet length... */ - - CFE_MSG_GetSize(MsgPtr, &ActualLength); if (ExpectedLength != ActualLength) { - CFE_MSG_GetMsgId(MsgPtr, &MessageID); - CFE_MSG_GetFcnCode(MsgPtr, &CommandCode); + CFE_MSG_GetMsgId(msgPtr, &MsgId); + CFE_MSG_GetFcnCode(msgPtr, &CommandCode); - switch (CFE_SB_MsgIdToValue(MessageID)) + if (CFE_SB_MsgId_Equal(MsgId, SEND_HK_MID)) + { + /* + ** For a bad HK request, just send the event. We only increment + ** the error counter for ground commands and not internal messages. + */ + CFE_EVS_SendEvent(LC_HKREQ_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid HK request msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d", + (unsigned long)CFE_SB_MsgIdToValue(MsgId), CommandCode, (int)ActualLength, + (int)ExpectedLength); + } + else if (CFE_SB_MsgId_Equal(MsgId, SAMPLE_AP_MID)) { - case LC_SEND_HK_MID: - /* - ** For a bad HK request, just send the event. We only increment - ** the error counter for ground commands and not internal messages. - */ - CFE_EVS_SendEvent(LC_HKREQ_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid HK request msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d", - (unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode, (int)ActualLength, - (int)ExpectedLength); - break; - - case LC_SAMPLE_AP_MID: - /* - ** Same thing as previous for a bad actionpoint sample request - */ - CFE_EVS_SendEvent(LC_APSAMPLE_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid AP sample msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d", - (unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode, (int)ActualLength, - (int)ExpectedLength); - break; - - default: - /* - ** All other cases, increment error counter - */ - CFE_EVS_SendEvent(LC_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d", - (unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode, (int)ActualLength, - (int)ExpectedLength); - LC_AppData.CmdErrCount++; - break; + /* + ** Same thing as previous for a bad actionpoint sample request + */ + CFE_EVS_SendEvent(LC_APSAMPLE_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid AP sample msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d", + (unsigned long)CFE_SB_MsgIdToValue(MsgId), CommandCode, (int)ActualLength, + (int)ExpectedLength); + } + else + { + /* + ** All other cases, increment error counter + */ + CFE_EVS_SendEvent(LC_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d", + (unsigned long)CFE_SB_MsgIdToValue(MsgId), CommandCode, (int)ActualLength, + (int)ExpectedLength); + LC_AppData.CmdErrCount++; } result = false; @@ -128,7 +136,7 @@ void LC_SendHkVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) */ if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_SendHkCmd((CFE_MSG_CommandHeader_t *)BufPtr); + LC_SendHkCmd((LC_SendHkCmd_t *)BufPtr); } } @@ -143,7 +151,7 @@ void LC_NoopVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_NoopCmd(BufPtr); + LC_NoopCmd((LC_NoopCmd_t *)BufPtr); } } @@ -158,7 +166,7 @@ void LC_ResetCountersVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_ResetCountersCmd(BufPtr); + LC_ResetCountersCmd((LC_ResetCountersCmd_t *)BufPtr); } } @@ -173,7 +181,7 @@ void LC_SetLCStateVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_SetLCStateCmd(BufPtr); + LC_SetLCStateCmd((LC_SetLCStateCmd_t *)BufPtr); } } @@ -188,7 +196,7 @@ void LC_SetAPStateVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_SetAPStateCmd(BufPtr); + LC_SetAPStateCmd((LC_SetAPStateCmd_t *)BufPtr); } } @@ -203,7 +211,7 @@ void LC_SetAPPermOffVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_SetAPPermOffCmd(BufPtr); + LC_SetAPPermOffCmd((LC_SetAPPermOffCmd_t *)BufPtr); } } @@ -218,7 +226,7 @@ void LC_ResetAPStatsVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_ResetAPStatsCmd(BufPtr); + LC_ResetAPStatsCmd((LC_ResetAPStatsCmd_t *)BufPtr); } } @@ -233,95 +241,111 @@ void LC_ResetWPStatsVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) if (LC_VerifyMsgLength(&BufPtr->Msg, ExpectedLength)) { - LC_ResetWPStatsCmd(BufPtr); + LC_ResetWPStatsCmd((LC_ResetWPStatsCmd_t *)BufPtr); } } - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ -/* Process a command pipe message */ +/* Process LC ground commands */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -CFE_Status_t LC_AppPipe(const CFE_SB_Buffer_t *BufPtr) +void LC_AppProcessCmd(const CFE_SB_Buffer_t *BufPtr) { CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; CFE_MSG_FcnCode_t CommandCode = 0; - CFE_MSG_GetMsgId(&BufPtr->Msg, &MessageID); + CFE_MSG_GetFcnCode(&BufPtr->Msg, &CommandCode); - switch (CFE_SB_MsgIdToValue(MessageID)) + switch (CommandCode) { - /* - ** Sample actionpoints request - */ - case LC_SAMPLE_AP_MID: - LC_SampleAPVerifyDispatch(BufPtr); + case LC_NOOP_CC: + LC_NoopVerifyDispatch(BufPtr); break; - /* - ** Housekeeping telemetry request - ** (only routine that can return a critical error indicator) - */ - case LC_SEND_HK_MID: - LC_SendHkVerifyDispatch(BufPtr); + case LC_RESET_CC: + LC_ResetCountersVerifyDispatch(BufPtr); break; - /* - ** LC application commands... - */ - case LC_CMD_MID: - - CFE_MSG_GetFcnCode(&BufPtr->Msg, &CommandCode); - switch (CommandCode) - { - case LC_NOOP_CC: - LC_NoopVerifyDispatch(BufPtr); - break; - - case LC_RESET_CC: - LC_ResetCountersVerifyDispatch(BufPtr); - break; + case LC_SET_LC_STATE_CC: + LC_SetLCStateVerifyDispatch(BufPtr); + break; - case LC_SET_LC_STATE_CC: - LC_SetLCStateVerifyDispatch(BufPtr); - break; + case LC_SET_AP_STATE_CC: + LC_SetAPStateVerifyDispatch(BufPtr); + break; - case LC_SET_AP_STATE_CC: - LC_SetAPStateVerifyDispatch(BufPtr); - break; + case LC_SET_AP_PERM_OFF_CC: + LC_SetAPPermOffVerifyDispatch(BufPtr); + break; - case LC_SET_AP_PERM_OFF_CC: - LC_SetAPPermOffVerifyDispatch(BufPtr); - break; + case LC_RESET_AP_STATS_CC: + LC_ResetAPStatsVerifyDispatch(BufPtr); + break; - case LC_RESET_AP_STATS_CC: - LC_ResetAPStatsVerifyDispatch(BufPtr); - break; + case LC_RESET_WP_STATS_CC: + LC_ResetWPStatsVerifyDispatch(BufPtr); + break; - case LC_RESET_WP_STATS_CC: - LC_ResetWPStatsVerifyDispatch(BufPtr); - break; + default: + CFE_MSG_GetMsgId(&BufPtr->Msg, &MessageID); + CFE_EVS_SendEvent(LC_CC_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid command code: ID = 0x%08lX, CC = %d", + (unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode); + LC_AppData.CmdErrCount++; + break; + } +} +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* */ +/* Process a command pipe message */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +void LC_AppPipe(const CFE_SB_Buffer_t *BufPtr) +{ + 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 SAMPLE_AP_MID = CFE_SB_MSGID_RESERVED; - default: - CFE_EVS_SendEvent(LC_CC_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid command code: ID = 0x%08lX, CC = %d", - (unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode); + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - LC_AppData.CmdErrCount++; - break; + /* Cache the local MID values here, this avoids repeat lookups */ + if (!CFE_SB_IsValidMsgId(CMD_MID)) + { + CMD_MID = CFE_SB_ValueToMsgId(LC_CMD_MID); + SEND_HK_MID = CFE_SB_ValueToMsgId(LC_SEND_HK_MID); + SAMPLE_AP_MID = CFE_SB_ValueToMsgId(LC_SAMPLE_AP_MID); + } - } /* end CommandCode switch */ - break; + CFE_MSG_GetMsgId(&BufPtr->Msg, &MessageID); + if (CFE_SB_MsgId_Equal(MessageID, SAMPLE_AP_MID)) + { + /* + ** Sample actionpoints request + */ + LC_SampleAPVerifyDispatch(BufPtr); + } + else if (CFE_SB_MsgId_Equal(MessageID, SEND_HK_MID)) + { + /* + ** Housekeeping telemetry request + ** (only routine that can return a critical error indicator) + */ + LC_SendHkVerifyDispatch(BufPtr); + } + else if (CFE_SB_MsgId_Equal(MessageID, CMD_MID)) + { + /* + ** LC application commands... + */ + LC_AppProcessCmd(BufPtr); + } + else + { /* ** All other message ID's should be monitor ** packets */ - default: - LC_CheckMsgForWPs(MessageID, BufPtr); - break; - - } /* end MessageID switch */ - - return CFE_SUCCESS; -} + LC_CheckMsgForWPs(MessageID, BufPtr); + } +} \ No newline at end of file diff --git a/fsw/src/lc_dispatch.h b/fsw/src/lc_dispatch.h index c27d274..c403f61 100644 --- a/fsw/src/lc_dispatch.h +++ b/fsw/src/lc_dispatch.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -49,10 +48,7 @@ * None * * \param[in] BufPtr Pointer to Software Bus buffer - * - * \return Execution status, see \ref CFEReturnCodes - * \retval #CFE_SUCCESS \copybrief CFE_SUCCESS */ -CFE_Status_t LC_AppPipe(const CFE_SB_Buffer_t *BufPtr); +void LC_AppPipe(const CFE_SB_Buffer_t *BufPtr); #endif diff --git a/fsw/src/lc_eds_dispatch.c b/fsw/src/lc_eds_dispatch.c new file mode 100644 index 0000000..00a9881 --- /dev/null +++ b/fsw/src/lc_eds_dispatch.c @@ -0,0 +1,99 @@ +/************************************************************************ + * 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 + * This file contains the source code for the CFS Limit Checker (LC). + */ + +/************************************************************************ +** Includes +*************************************************************************/ + +#include "lc_app.h" +#include "lc_dispatch.h" +#include "lc_cmds.h" +#include "lc_eventids.h" +#include "lc_msgids.h" +#include "lc_msg.h" + +#include "lc_eds_dispatcher.h" +#include "lc_eds_dictionary.h" + +/* + * Define a lookup table for LC app command codes + */ +/* clang-format off */ +static const EdsDispatchTable_EdsComponent_LC_Application_CFE_SB_Telecommand_t LC_TC_DISPATCH_TABLE = +{ + .CMD = + { + .NoopCmd_indication = LC_NoopCmd, + .ResetCountersCmd_indication = LC_ResetCountersCmd, + .SetLCStateCmd_indication = LC_SetLCStateCmd, + .SetAPStateCmd_indication = LC_SetAPStateCmd, + .SetAPPermOffCmd_indication = LC_SetAPPermOffCmd, + .ResetAPStatsCmd_indication = LC_ResetAPStatsCmd, + .ResetWPStatsCmd_indication = LC_ResetWPStatsCmd, + }, + .SEND_HK = + { + .indication = LC_SendHkCmd + } +}; +/* clang-format on */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* */ +/* LC_AppPipe() -- Process command pipe message */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +void LC_AppPipe(const CFE_SB_Buffer_t *BufPtr) +{ + CFE_Status_t Status; + CFE_SB_MsgId_t MsgId; + CFE_MSG_Size_t MsgSize; + CFE_MSG_FcnCode_t MsgFc; + + Status = EdsDispatch_EdsComponent_LC_Application_Telecommand(BufPtr, &LC_TC_DISPATCH_TABLE); + + if (Status != CFE_SUCCESS) + { + CFE_MSG_GetMsgId(&BufPtr->Msg, &MsgId); + CFE_MSG_GetSize(&BufPtr->Msg, &MsgSize); + CFE_MSG_GetFcnCode(&BufPtr->Msg, &MsgFc); + ++LC_AppData.CmdErrCount; + + if (Status == CFE_STATUS_UNKNOWN_MSG_ID) + { + CFE_EVS_SendEvent(LC_CC_ERR_EID, CFE_EVS_EventType_ERROR, + "SAMPLE: invalid command packet,MID = 0x%x", (unsigned int)CFE_SB_MsgIdToValue(MsgId)); + } + else if (Status == CFE_STATUS_WRONG_MSG_LENGTH) + { + CFE_EVS_SendEvent(LC_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u", + (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)MsgFc, (unsigned int)MsgSize); + } + else + { + CFE_EVS_SendEvent(LC_CC_ERR_EID, CFE_EVS_EventType_ERROR, + "SAMPLE: Invalid ground command code: CC = %d", (int)MsgFc); + } + } +} \ No newline at end of file diff --git a/fsw/src/lc_utils.c b/fsw/src/lc_utils.c index 24c682f..4650b59 100644 --- a/fsw/src/lc_utils.c +++ b/fsw/src/lc_utils.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_utils.h b/fsw/src/lc_utils.h index 4ec844a..504cd26 100644 --- a/fsw/src/lc_utils.h +++ b/fsw/src/lc_utils.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_verify.h b/fsw/src/lc_verify.h index c7f0f0e..786d6ba 100644 --- a/fsw/src/lc_verify.h +++ b/fsw/src/lc_verify.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_version.h b/fsw/src/lc_version.h index 25c537a..47fa4d5 100644 --- a/fsw/src/lc_version.h +++ b/fsw/src/lc_version.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -31,9 +30,9 @@ * \{ */ -#define LC_MAJOR_VERSION 2 /**< \brief Major version number */ -#define LC_MINOR_VERSION 2 /**< \brief Minor version number */ -#define LC_REVISION 99 /**< \brief Revision number */ +#define LC_MAJOR_VERSION 7 /**< \brief Major version number */ +#define LC_MINOR_VERSION 0 /**< \brief Minor version number */ +#define LC_REVISION 0 /**< \brief Revision number */ /**\}*/ diff --git a/fsw/src/lc_watch.c b/fsw/src/lc_watch.c index fe2e349..30136d8 100644 --- a/fsw/src/lc_watch.c +++ b/fsw/src/lc_watch.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/lc_watch.h b/fsw/src/lc_watch.h index 53f945f..1db358d 100644 --- a/fsw/src/lc_watch.h +++ b/fsw/src/lc_watch.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/tables/lc_def_adt.c b/fsw/tables/lc_def_adt.c index cd94695..19f4df7 100644 --- a/fsw/tables/lc_def_adt.c +++ b/fsw/tables/lc_def_adt.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/tables/lc_def_wdt.c b/fsw/tables/lc_def_wdt.c index aea7118..cb64185 100644 --- a/fsw/tables/lc_def_wdt.c +++ b/fsw/tables/lc_def_wdt.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/mission_build.cmake b/mission_build.cmake index 62f1daf..e15b16c 100644 --- a/mission_build.cmake +++ b/mission_build.cmake @@ -13,8 +13,8 @@ add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/docs/dox_src ${MISSION_BINARY_DIR}/do # The list of header files that control the HK configuration set(LC_MISSION_CONFIG_FILE_LIST - lc_fcncodes.h - lc_interface_cfg.h + lc_fcncode_values.h + lc_interface_cfg_values.h lc_mission_cfg.h lc_msgstruct.h lc_msgdefs.h @@ -22,41 +22,7 @@ set(LC_MISSION_CONFIG_FILE_LIST lc_tblstruct.h lc_tbldefs.h lc_tbl.h + lc_topicid_values.h ) -if (CFE_EDS_ENABLED_BUILD) - - # In an EDS-based build, these files come generated from the EDS tool - set(LC_CFGFILE_SRC_lc_mission_cfg "lc_eds_designparameters.h") - set(LC_CFGFILE_SRC_lc_tbldefs "lc_eds_typedefs.h") - set(LC_CFGFILE_SRC_lc_msgdefs "lc_eds_cc.h") - set(LC_CFGFILE_SRC_lc_msg "lc_eds_typedefs.h") - set(LC_CFGFILE_SRC_lc_tbl "lc_eds_typedefs.h") - -else(CFE_EDS_ENABLED_BUILD) - - # In a non-EDS build, the user supplies these files, plus a couple more - # There are defaults for all in the "config" dir - list (APPEND LC_MISSION_CONFIG_FILE_LIST - lc_msgstruct.h - lc_tblstruct.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(LC_CFGFILE ${LC_MISSION_CONFIG_FILE_LIST}) - get_filename_component(CFGKEY "${LC_CFGFILE}" NAME_WE) - if (DEFINED LC_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE GENERATED_FILE "${LC_CFGFILE_SRC_${CFGKEY}}") - else() - set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${LC_CFGFILE}") - endif() - - generate_config_includefile( - FILE_NAME "${LC_CFGFILE}" - ${DEFAULT_SOURCE} - ) -endforeach() +generate_configfile_set(${LC_MISSION_CONFIG_FILE_LIST}) diff --git a/unit-test/lc_action_tests.c b/unit-test/lc_action_tests.c index f85e850..8a00cd8 100644 --- a/unit-test/lc_action_tests.c +++ b/unit-test/lc_action_tests.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/lc_app_tests.c b/unit-test/lc_app_tests.c index 8fbc8f5..273fb17 100644 --- a/unit-test/lc_app_tests.c +++ b/unit-test/lc_app_tests.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -265,6 +264,18 @@ void LC_AppMain_Test_SbTimeout(void) UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(LC_PerformMaintenance)), 1); } +void LC_AppMain_Test_SbNoMessage(void) +{ + UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true); + UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, false); + + UT_SetDeferredRetcode(UT_KEY(CFE_SB_ReceiveBuffer), 1, CFE_SB_NO_MESSAGE); + + UtAssert_VOIDCALL(LC_AppMain()); + + UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1); +} + void LC_AppInit_Test_Nominal(void) { CFE_Status_t Result; @@ -292,7 +303,7 @@ void LC_AppInit_Test_Nominal(void) /* Note: not testing LC_OperData.ARTPtr == 0, because it is modified by a subfunction */ /* Note: not testing LC_OperData.WDTHandle == 0, because it is modified by a subfunction */ /* Note: not testing LC_OperData.ADTHandle == 0, because it is modified by a subfunction */ - UtAssert_INT32_EQ(LC_OperData.WRTHandle, 0); + UtAssert_INT32_EQ(CFE_TBL_HANDLE_INT(LC_OperData.WRTHandle), 0); /* Note: not testing LC_OperData.ARTHandle == 0, because it is modified by a subfunction */ UtAssert_BOOL_FALSE(CFE_RESOURCEID_TEST_DEFINED(LC_OperData.WRTDataCDSHandle)); UtAssert_BOOL_FALSE(CFE_RESOURCEID_TEST_DEFINED(LC_OperData.ARTDataCDSHandle)); @@ -1457,6 +1468,7 @@ void UtTest_Setup(void) UtTest_Add(LC_AppMain_Test_SbError, LC_Test_Setup, LC_Test_TearDown, "LC_AppMain_Test_SbError"); UtTest_Add(LC_AppMain_Test_SbTimeout, LC_Test_Setup, LC_Test_TearDown, "LC_AppMain_Test_SbTimeout"); + UtTest_Add(LC_AppMain_Test_SbNoMessage, LC_Test_Setup, LC_Test_TearDown, "LC_AppMain_Test_SbNoMessage"); #ifndef LC_SAVE_TO_CDS /* default config unit test */ UtTest_Add(LC_AppInit_Test_Nominal, LC_Test_Setup, LC_Test_TearDown, "LC_AppInit_Test_Nominal"); diff --git a/unit-test/lc_cmds_tests.c b/unit-test/lc_cmds_tests.c index 2392e83..444a4bf 100644 --- a/unit-test/lc_cmds_tests.c +++ b/unit-test/lc_cmds_tests.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -266,7 +265,7 @@ void LC_SendHkCmd_Test_WatchStale(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -316,7 +315,7 @@ void LC_SendHkCmd_Test_WatchFalse(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -366,7 +365,7 @@ void LC_SendHkCmd_Test_WatchTrue(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -417,7 +416,7 @@ void LC_SendHkCmd_Test_WatchError(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -467,7 +466,7 @@ void LC_SendHkCmd_Test_DefaultWatchResult(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -518,7 +517,7 @@ void LC_SendHkCmd_Test_ActionNotUsedStale(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -569,7 +568,7 @@ void LC_SendHkCmd_Test_APStateActiveActionPass(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -622,7 +621,7 @@ void LC_SendHkCmd_Test_APStatePassiveActionFail(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -673,7 +672,7 @@ void LC_SendHkCmd_Test_APStateDisabledActionError(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -724,7 +723,7 @@ void LC_SendHkCmd_Test_APStatePermOffActionError(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -775,7 +774,7 @@ void LC_SendHkCmd_Test_DefaultCurrentStateAndActionResult(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == CFE_SUCCESS, "Result == CFE_SUCCESS"); @@ -818,7 +817,7 @@ void LC_SendHkCmd_Test_ManageTablesError(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), -1); /* Execute the function being tested */ - Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd.CommandHeader); + Result = LC_SendHkCmd(&UT_CmdBuf.SendHkCmd); /* Verify results */ UtAssert_True(Result == -1, "Result == -1"); @@ -831,7 +830,7 @@ void LC_NoopCmd_Test(void) { LC_AppData.CmdCount = 1; - LC_NoopCmd(&UT_CmdBuf.Buf); + LC_NoopCmd(&UT_CmdBuf.NoopCmd); UtAssert_UINT8_EQ(LC_AppData.CmdCount, 2); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -839,7 +838,7 @@ void LC_NoopCmd_Test(void) void LC_ResetCountersCmd_Test(void) { - LC_ResetCountersCmd(&UT_CmdBuf.Buf); + LC_ResetCountersCmd(&UT_CmdBuf.ResetCountersCmd); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); } @@ -884,7 +883,7 @@ void LC_SetLCStateCmd_Test_Active(void) PayloadPtr->NewLCState = LC_STATE_ACTIVE; /* Execute the function being tested */ - LC_SetLCStateCmd(&UT_CmdBuf.Buf); + LC_SetLCStateCmd(&UT_CmdBuf.SetLCStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CurrentLCState == LC_STATE_ACTIVE, "LC_AppData.CurrentLCState == LC_STATE_ACTIVE"); @@ -915,7 +914,7 @@ void LC_SetLCStateCmd_Test_Passive(void) PayloadPtr->NewLCState = LC_STATE_PASSIVE; /* Execute the function being tested */ - LC_SetLCStateCmd(&UT_CmdBuf.Buf); + LC_SetLCStateCmd(&UT_CmdBuf.SetLCStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CurrentLCState == LC_STATE_PASSIVE, "LC_AppData.CurrentLCState == LC_STATE_PASSIVE"); @@ -946,7 +945,7 @@ void LC_SetLCStateCmd_Test_Disabled(void) PayloadPtr->NewLCState = LC_STATE_DISABLED; /* Execute the function being tested */ - LC_SetLCStateCmd(&UT_CmdBuf.Buf); + LC_SetLCStateCmd(&UT_CmdBuf.SetLCStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CurrentLCState == LC_STATE_DISABLED, "LC_AppData.CurrentLCState == LC_STATE_DISABLED"); @@ -977,7 +976,7 @@ void LC_SetLCStateCmd_Test_Default(void) PayloadPtr->NewLCState = 99; /* Execute the function being tested */ - LC_SetLCStateCmd(&UT_CmdBuf.Buf); + LC_SetLCStateCmd(&UT_CmdBuf.SetLCStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1009,7 +1008,7 @@ void LC_SetAPStateCmd_Test_Default(void) PayloadPtr->NewAPState = 99; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1047,7 +1046,7 @@ void LC_SetAPStateCmd_Test_SetAllActionPointsActive(void) } /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ @@ -1100,7 +1099,7 @@ void LC_SetAPStateCmd_Test_SetAllActionPointsActiveOneNotUsed(void) LC_OperData.ARTPtr[0].CurrentState = LC_APSTATE_NOT_USED; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ @@ -1153,7 +1152,7 @@ void LC_SetAPStateCmd_Test_SetAllActionPointsActiveOnePermOff(void) LC_OperData.ARTPtr[0].CurrentState = LC_APSTATE_PERMOFF; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ @@ -1205,7 +1204,7 @@ void LC_SetAPStateCmd_Test_SetAllActionPointsPassive(void) } /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ @@ -1257,7 +1256,7 @@ void LC_SetAPStateCmd_Test_SetAllActionPointsDisabled(void) } /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ @@ -1305,7 +1304,7 @@ void LC_SetAPStateCmd_Test_UpdateSingleActionPointActive(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = 99; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState == LC_APSTATE_ACTIVE, @@ -1340,7 +1339,7 @@ void LC_SetAPStateCmd_Test_UpdateSingleActionPointNotUsed(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_NOT_USED; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState == LC_APSTATE_NOT_USED, @@ -1375,7 +1374,7 @@ void LC_SetAPStateCmd_Test_UpdateSingleActionPointPassive(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = 99; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState == LC_APSTATE_PASSIVE, @@ -1410,7 +1409,7 @@ void LC_SetAPStateCmd_Test_UpdateSingleActionPointDisabled(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = 99; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState == LC_APSTATE_DISABLED, @@ -1445,7 +1444,7 @@ void LC_SetAPStateCmd_Test_InvalidCurrentAPStateActive(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_PERMOFF; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1479,7 +1478,7 @@ void LC_SetAPStateCmd_Test_InvalidCurrentAPStatePassive(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_PERMOFF; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1513,7 +1512,7 @@ void LC_SetAPStateCmd_Test_InvalidCurrentAPStateDisabled(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_PERMOFF; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1547,7 +1546,7 @@ void LC_SetAPStateCmd_Test_InvalidAPNumberActive(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_PERMOFF; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1580,7 +1579,7 @@ void LC_SetAPStateCmd_Test_InvalidAPNumberPassive(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_PERMOFF; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1612,7 +1611,7 @@ void LC_SetAPStateCmd_Test_InvalidAPNumberDisabled(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_PERMOFF; /* Execute the function being tested */ - LC_SetAPStateCmd(&UT_CmdBuf.Buf); + LC_SetAPStateCmd(&UT_CmdBuf.SetAPStateCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1640,7 +1639,7 @@ void LC_SetAPPermOffCmd_Test_InvalidAPNumberMaxActionpoints(void) PayloadPtr->APNumber = LC_MAX_ACTIONPOINTS; /* Execute the function being tested */ - LC_SetAPPermOffCmd(&UT_CmdBuf.Buf); + LC_SetAPPermOffCmd(&UT_CmdBuf.SetAPPermOffCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1669,7 +1668,7 @@ void LC_SetAPPermOffCmd_Test_InvalidAPNumberAllActionpoints(void) PayloadPtr->APNumber = LC_ALL_ACTIONPOINTS; /* Execute the function being tested */ - LC_SetAPPermOffCmd(&UT_CmdBuf.Buf); + LC_SetAPPermOffCmd(&UT_CmdBuf.SetAPPermOffCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1701,7 +1700,7 @@ void LC_SetAPPermOffCmd_Test_APNotDisabled(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = 99; /* Execute the function being tested */ - LC_SetAPPermOffCmd(&UT_CmdBuf.Buf); + LC_SetAPPermOffCmd(&UT_CmdBuf.SetAPPermOffCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1732,7 +1731,7 @@ void LC_SetAPPermOffCmd_Test_Nominal(void) LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState = LC_APSTATE_DISABLED; /* Execute the function being tested */ - LC_SetAPPermOffCmd(&UT_CmdBuf.Buf); + LC_SetAPPermOffCmd(&UT_CmdBuf.SetAPPermOffCmd); /* Verify results */ UtAssert_True(LC_OperData.ARTPtr[PayloadPtr->APNumber].CurrentState == 4, @@ -1763,7 +1762,7 @@ void LC_ResetAPStatsCmd_Test_AllActionPoints(void) PayloadPtr->APNumber = LC_ALL_ACTIONPOINTS; /* Execute the function being tested */ - LC_ResetAPStatsCmd(&UT_CmdBuf.Buf); + LC_ResetAPStatsCmd(&UT_CmdBuf.ResetAPStatsCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdCount == 1, "LC_AppData.CmdCount == 1"); @@ -1792,7 +1791,7 @@ void LC_ResetAPStatsCmd_Test_SingleActionPoint(void) PayloadPtr->APNumber = LC_MAX_ACTIONPOINTS - 1; /* Execute the function being tested */ - LC_ResetAPStatsCmd(&UT_CmdBuf.Buf); + LC_ResetAPStatsCmd(&UT_CmdBuf.ResetAPStatsCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdCount == 1, "LC_AppData.CmdCount == 1"); @@ -1821,7 +1820,7 @@ void LC_ResetAPStatsCmd_Test_InvalidAPNumber(void) PayloadPtr->APNumber = LC_MAX_ACTIONPOINTS; /* Execute the function being tested */ - LC_ResetAPStatsCmd(&UT_CmdBuf.Buf); + LC_ResetAPStatsCmd(&UT_CmdBuf.ResetAPStatsCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); @@ -1951,7 +1950,7 @@ void LC_ResetWPStatsCmd_Test_AllWatchPoints(void) PayloadPtr->WPNumber = LC_ALL_WATCHPOINTS; /* Execute the function being tested */ - LC_ResetWPStatsCmd(&UT_CmdBuf.Buf); + LC_ResetWPStatsCmd(&UT_CmdBuf.ResetWPStatsCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdCount == 1, "LC_AppData.CmdCount == 1"); @@ -1980,7 +1979,7 @@ void LC_ResetWPStatsCmd_Test_SingleWatchPoint(void) PayloadPtr->WPNumber = LC_MAX_WATCHPOINTS - 1; /* Execute the function being tested */ - LC_ResetWPStatsCmd(&UT_CmdBuf.Buf); + LC_ResetWPStatsCmd(&UT_CmdBuf.ResetWPStatsCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdCount == 1, "LC_AppData.CmdCount == 1"); @@ -2008,7 +2007,7 @@ void LC_ResetWPStatsCmd_Test_InvalidWPNumber(void) PayloadPtr->WPNumber = LC_MAX_WATCHPOINTS; /* Execute the function being tested */ - LC_ResetWPStatsCmd(&UT_CmdBuf.Buf); + LC_ResetWPStatsCmd(&UT_CmdBuf.ResetWPStatsCmd); /* Verify results */ UtAssert_True(LC_AppData.CmdErrCount == 1, "LC_AppData.CmdErrCount == 1"); diff --git a/unit-test/lc_custom_tests.c b/unit-test/lc_custom_tests.c index 336bcdf..0d87618 100644 --- a/unit-test/lc_custom_tests.c +++ b/unit-test/lc_custom_tests.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/lc_dispatch_tests.c b/unit-test/lc_dispatch_tests.c index 1cc64a2..97473b7 100644 --- a/unit-test/lc_dispatch_tests.c +++ b/unit-test/lc_dispatch_tests.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -74,13 +73,13 @@ void LC_AppPipe_Test_SampleAPRequest(void) LC_Dispatch_Test_SetupMsg(TestMsgId, 0, sizeof(LC_SampleAPCmd_t)); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_SampleAPReq, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, 0, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_SampleAPReq, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -99,13 +98,13 @@ void LC_AppPipe_Test_SendHkCmd(void) UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_SUCCESS); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_SendHkCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, 0, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_SendHkCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -123,13 +122,13 @@ void LC_AppPipe_Test_Noop(void) LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, sizeof(LC_NoopCmd_t)); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_NoopCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_NoopCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -147,13 +146,13 @@ void LC_AppPipe_Test_Reset(void) LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, sizeof(LC_ResetCountersCmd_t)); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_ResetCountersCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_ResetCountersCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -171,13 +170,13 @@ void LC_AppPipe_Test_SetLCState(void) LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, sizeof(LC_SetLCStateCmd_t)); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_SetLCStateCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_SetLCStateCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -197,13 +196,13 @@ void LC_AppPipe_Test_SetAPState(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_SetAPStateCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_SetAPStateCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -221,13 +220,13 @@ void LC_AppPipe_Test_SetAPPermOff(void) LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, sizeof(LC_SetAPPermOffCmd_t)); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_SetAPPermOffCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_SetAPPermOffCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -245,13 +244,13 @@ void LC_AppPipe_Test_ResetAPStats(void) LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, sizeof(LC_ResetAPStatsCmd_t)); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_ResetAPStatsCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_ResetAPStatsCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -269,13 +268,13 @@ void LC_AppPipe_Test_ResetWPStats(void) LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, sizeof(LC_ResetWPStatsCmd_t)); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_ResetWPStatsCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); /* Bad Length */ LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 1); - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); /* Verify handler NOT called again */ UtAssert_STUB_COUNT(LC_ResetWPStatsCmd, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -293,7 +292,7 @@ void LC_AppPipe_Test_InvalidCommandCode(void) LC_Dispatch_Test_SetupMsg(TestMsgId, FcnCode, 0); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, LC_CC_ERR_EID); @@ -309,7 +308,7 @@ void LC_AppPipe_Test_MonitorPacket(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); /* Execute the function being tested */ - UtAssert_INT32_EQ(LC_AppPipe(&UT_CmdBuf.Buf), CFE_SUCCESS); + UtAssert_VOIDCALL(LC_AppPipe(&UT_CmdBuf.Buf)); UtAssert_STUB_COUNT(LC_CheckMsgForWPs, 1); } diff --git a/unit-test/lc_eds_dispatch_tests.c b/unit-test/lc_eds_dispatch_tests.c new file mode 100644 index 0000000..88314bb --- /dev/null +++ b/unit-test/lc_eds_dispatch_tests.c @@ -0,0 +1,69 @@ +/************************************************************************ + * 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. + ************************************************************************/ + +/* lc testing includes */ +#include "lc_test_utils.h" +#include "lc_dispatch.h" +#include "lc_eds_dispatcher.h" +#include "lc_cmds.h" +#include "lc_msgids.h" +#include "lc_eventids.h" + + +/* UT includes */ +#include "uttest.h" +#include "utassert.h" +#include "utstubs.h" + +void lc_dispatch_tests_Setup(void) +{ + LC_Test_Setup(); +} + +void lc_dispatch_tests_Teardown(void) +{ + LC_Test_TearDown(); +} + +/* +********************************************************************************** +** TEST CASE FUNCTIONS +********************************************************************************** +*/ + +void Test_LC_AppPipe(void) +{ + /* + * Test Case For: + * void LC_AppPipe + */ + CFE_SB_Buffer_t UtBuf; + + UT_SetDeferredRetcode(UT_KEY(CFE_EDSMSG_Dispatch), 1, CFE_SUCCESS); + + memset(&UtBuf, 0, sizeof(UtBuf)); + UtAssert_VOIDCALL(LC_AppPipe(&UtBuf)); +} + +/* + * Register the test cases to execute with the unit test tool + */ +void UtTest_Setup(void) +{ + UtTest_Add(Test_LC_AppPipe, lc_dispatch_tests_Setup, lc_dispatch_tests_Teardown, "Test_LC_AppPipe"); +} \ No newline at end of file diff --git a/unit-test/lc_utils_tests.c b/unit-test/lc_utils_tests.c index 0239874..23027a2 100644 --- a/unit-test/lc_utils_tests.c +++ b/unit-test/lc_utils_tests.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/lc_watch_tests.c b/unit-test/lc_watch_tests.c index 4f68c21..6863516 100644 --- a/unit-test/lc_watch_tests.c +++ b/unit-test/lc_watch_tests.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/stubs/lc_action_stubs.c b/unit-test/stubs/lc_action_stubs.c index 73c4fee..bf24117 100644 --- a/unit-test/stubs/lc_action_stubs.c +++ b/unit-test/stubs/lc_action_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/stubs/lc_app_stubs.c b/unit-test/stubs/lc_app_stubs.c index 58a8fe4..19664cc 100644 --- a/unit-test/stubs/lc_app_stubs.c +++ b/unit-test/stubs/lc_app_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/stubs/lc_cmds_stubs.c b/unit-test/stubs/lc_cmds_stubs.c index c068e29..591cbd7 100644 --- a/unit-test/stubs/lc_cmds_stubs.c +++ b/unit-test/stubs/lc_cmds_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -31,11 +30,15 @@ * Generated stub function for LC_NoopCmd() * ---------------------------------------------------- */ -void LC_NoopCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_NoopCmd(const LC_NoopCmd_t *msg) { - UT_GenStub_AddParam(LC_NoopCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_SetupReturnBuffer(LC_NoopCmd, CFE_Status_t); + + UT_GenStub_AddParam(LC_NoopCmd, const LC_NoopCmd_t *, msg); UT_GenStub_Execute(LC_NoopCmd, Basic, NULL); + + return UT_GenStub_GetReturnValue(LC_NoopCmd, CFE_Status_t); } /* @@ -43,11 +46,15 @@ void LC_NoopCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for LC_ResetAPStatsCmd() * ---------------------------------------------------- */ -void LC_ResetAPStatsCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_ResetAPStatsCmd(const LC_ResetAPStatsCmd_t *msg) { - UT_GenStub_AddParam(LC_ResetAPStatsCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_SetupReturnBuffer(LC_ResetAPStatsCmd, CFE_Status_t); + + UT_GenStub_AddParam(LC_ResetAPStatsCmd, const LC_ResetAPStatsCmd_t *, msg); UT_GenStub_Execute(LC_ResetAPStatsCmd, Basic, NULL); + + return UT_GenStub_GetReturnValue(LC_ResetAPStatsCmd, CFE_Status_t); } /* @@ -66,11 +73,15 @@ void LC_ResetCounters(void) * Generated stub function for LC_ResetCountersCmd() * ---------------------------------------------------- */ -void LC_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_ResetCountersCmd(const LC_ResetCountersCmd_t *msg) { - UT_GenStub_AddParam(LC_ResetCountersCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_SetupReturnBuffer(LC_ResetCountersCmd, CFE_Status_t); + + UT_GenStub_AddParam(LC_ResetCountersCmd, const LC_ResetCountersCmd_t *, msg); UT_GenStub_Execute(LC_ResetCountersCmd, Basic, NULL); + + return UT_GenStub_GetReturnValue(LC_ResetCountersCmd, CFE_Status_t); } /* @@ -106,11 +117,15 @@ void LC_ResetResultsWP(uint32 StartIndex, uint32 EndIndex, bool ResetStatsCmd) * Generated stub function for LC_ResetWPStatsCmd() * ---------------------------------------------------- */ -void LC_ResetWPStatsCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_ResetWPStatsCmd(const LC_ResetWPStatsCmd_t *msg) { - UT_GenStub_AddParam(LC_ResetWPStatsCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_SetupReturnBuffer(LC_ResetWPStatsCmd, CFE_Status_t); + + UT_GenStub_AddParam(LC_ResetWPStatsCmd, const LC_ResetWPStatsCmd_t *, msg); UT_GenStub_Execute(LC_ResetWPStatsCmd, Basic, NULL); + + return UT_GenStub_GetReturnValue(LC_ResetWPStatsCmd, CFE_Status_t); } /* @@ -130,11 +145,11 @@ void LC_SampleAPReq(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for LC_SendHkCmd() * ---------------------------------------------------- */ -CFE_Status_t LC_SendHkCmd(const CFE_MSG_CommandHeader_t *MsgPtr) +CFE_Status_t LC_SendHkCmd(const LC_SendHkCmd_t *msg) { UT_GenStub_SetupReturnBuffer(LC_SendHkCmd, CFE_Status_t); - UT_GenStub_AddParam(LC_SendHkCmd, const CFE_MSG_CommandHeader_t *, MsgPtr); + UT_GenStub_AddParam(LC_SendHkCmd, const LC_SendHkCmd_t *, msg); UT_GenStub_Execute(LC_SendHkCmd, Basic, NULL); @@ -146,11 +161,15 @@ CFE_Status_t LC_SendHkCmd(const CFE_MSG_CommandHeader_t *MsgPtr) * Generated stub function for LC_SetAPPermOffCmd() * ---------------------------------------------------- */ -void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_SetAPPermOffCmd(const LC_SetAPPermOffCmd_t *msg) { - UT_GenStub_AddParam(LC_SetAPPermOffCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_SetupReturnBuffer(LC_SetAPPermOffCmd, CFE_Status_t); + + UT_GenStub_AddParam(LC_SetAPPermOffCmd, const LC_SetAPPermOffCmd_t *, msg); UT_GenStub_Execute(LC_SetAPPermOffCmd, Basic, NULL); + + return UT_GenStub_GetReturnValue(LC_SetAPPermOffCmd, CFE_Status_t); } /* @@ -158,11 +177,15 @@ void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for LC_SetAPStateCmd() * ---------------------------------------------------- */ -void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_SetAPStateCmd(const LC_SetAPStateCmd_t *msg) { - UT_GenStub_AddParam(LC_SetAPStateCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_SetupReturnBuffer(LC_SetAPStateCmd, CFE_Status_t); + + UT_GenStub_AddParam(LC_SetAPStateCmd, const LC_SetAPStateCmd_t *, msg); UT_GenStub_Execute(LC_SetAPStateCmd, Basic, NULL); + + return UT_GenStub_GetReturnValue(LC_SetAPStateCmd, CFE_Status_t); } /* @@ -170,9 +193,13 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for LC_SetLCStateCmd() * ---------------------------------------------------- */ -void LC_SetLCStateCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t LC_SetLCStateCmd(const LC_SetLCStateCmd_t *msg) { - UT_GenStub_AddParam(LC_SetLCStateCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_SetupReturnBuffer(LC_SetLCStateCmd, CFE_Status_t); + + UT_GenStub_AddParam(LC_SetLCStateCmd, const LC_SetLCStateCmd_t *, msg); UT_GenStub_Execute(LC_SetLCStateCmd, Basic, NULL); + + return UT_GenStub_GetReturnValue(LC_SetLCStateCmd, CFE_Status_t); } diff --git a/unit-test/stubs/lc_custom_stubs.c b/unit-test/stubs/lc_custom_stubs.c index 81d3afb..99d084b 100644 --- a/unit-test/stubs/lc_custom_stubs.c +++ b/unit-test/stubs/lc_custom_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/stubs/lc_dispatch_stubs.c b/unit-test/stubs/lc_dispatch_stubs.c index 2bcff4e..ff116e5 100644 --- a/unit-test/stubs/lc_dispatch_stubs.c +++ b/unit-test/stubs/lc_dispatch_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. * @@ -31,13 +30,9 @@ * Generated stub function for LC_AppPipe() * ---------------------------------------------------- */ -CFE_Status_t LC_AppPipe(const CFE_SB_Buffer_t *BufPtr) +void LC_AppPipe(const CFE_SB_Buffer_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(LC_AppPipe, CFE_Status_t); - UT_GenStub_AddParam(LC_AppPipe, const CFE_SB_Buffer_t *, BufPtr); UT_GenStub_Execute(LC_AppPipe, Basic, NULL); - - return UT_GenStub_GetReturnValue(LC_AppPipe, CFE_Status_t); } diff --git a/unit-test/stubs/lc_global_stubs.c b/unit-test/stubs/lc_global_stubs.c index 6f87719..e767103 100644 --- a/unit-test/stubs/lc_global_stubs.c +++ b/unit-test/stubs/lc_global_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/stubs/lc_utils_stubs.c b/unit-test/stubs/lc_utils_stubs.c index 8bb7bc2..b633691 100644 --- a/unit-test/stubs/lc_utils_stubs.c +++ b/unit-test/stubs/lc_utils_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/stubs/lc_watch_stubs.c b/unit-test/stubs/lc_watch_stubs.c index efa64dd..3ef7555 100644 --- a/unit-test/stubs/lc_watch_stubs.c +++ b/unit-test/stubs/lc_watch_stubs.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/utilities/lc_test_utils.c b/unit-test/utilities/lc_test_utils.c index b448660..1e88954 100644 --- a/unit-test/utilities/lc_test_utils.c +++ b/unit-test/utilities/lc_test_utils.c @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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/unit-test/utilities/lc_test_utils.h b/unit-test/utilities/lc_test_utils.h index ee6d879..93e5a32 100644 --- a/unit-test/utilities/lc_test_utils.h +++ b/unit-test/utilities/lc_test_utils.h @@ -1,8 +1,7 @@ /************************************************************************ - * NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker - * Application version 2.2.1” + * NASA Docket No. GSC-19,200-1, and identified as "cFS Draco" * - * Copyright (c) 2021 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. *