From b66ac5ece76ad6258c301a5a6a362c6a5f8498c0 Mon Sep 17 00:00:00 2001 From: Justin Figueroa Date: Mon, 5 Dec 2022 14:36:44 -0500 Subject: [PATCH] Fix #348, Moves interface definition files to inc --- CMakeLists.txt | 6 +- fsw/{src => inc}/cf_events.h | 0 fsw/inc/cf_extern_typedefs.h | 73 +++++++++++++++++++++ fsw/{src => inc}/cf_msg.h | 2 +- fsw/{platform_inc => inc}/cf_msgids.h | 0 fsw/{mission_inc => inc}/cf_perfids.h | 0 fsw/{platform_inc => inc}/cf_platform_cfg.h | 0 fsw/{src => inc}/cf_tbldefs.h | 2 +- fsw/src/cf_cfdp_pdu.h | 16 ----- fsw/src/cf_cfdp_types.h | 28 +------- unit-test/CMakeLists.txt | 2 + 11 files changed, 81 insertions(+), 48 deletions(-) rename fsw/{src => inc}/cf_events.h (100%) create mode 100644 fsw/inc/cf_extern_typedefs.h rename fsw/{src => inc}/cf_msg.h (99%) rename fsw/{platform_inc => inc}/cf_msgids.h (100%) rename fsw/{mission_inc => inc}/cf_perfids.h (100%) rename fsw/{platform_inc => inc}/cf_platform_cfg.h (100%) rename fsw/{src => inc}/cf_tbldefs.h (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a334603..f0d128ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,5 @@ project(CFS_CF C) -include_directories(fsw/src) -include_directories(fsw/mission_inc) -include_directories(fsw/platform_inc) include_directories(${CFS_IO_LIB_MISSION_DIR}/fsw/public_inc) set(APP_SRC_FILES @@ -24,6 +21,9 @@ set(APP_SRC_FILES # Create the app module add_cfe_app(cf ${APP_SRC_FILES}) +# This permits direct access to public headers in the fsw/inc directory +target_include_directories(cf PUBLIC fsw/inc) + # configuration table add_cfe_tables(cf fsw/tables/cf_def_config.c) diff --git a/fsw/src/cf_events.h b/fsw/inc/cf_events.h similarity index 100% rename from fsw/src/cf_events.h rename to fsw/inc/cf_events.h diff --git a/fsw/inc/cf_extern_typedefs.h b/fsw/inc/cf_extern_typedefs.h new file mode 100644 index 00000000..413b6942 --- /dev/null +++ b/fsw/inc/cf_extern_typedefs.h @@ -0,0 +1,73 @@ +/************************************************************************ + * NASA Docket No. GSC-18,447-1, and identified as “CFS CFDP (CF) + * Application version 3.0.0” + * + * Copyright (c) 2019 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Declarations and prototypes for cf_extern_typedefs module + */ + +#ifndef CF_EXTERN_TYPEDEFS_H +#define CF_EXTERN_TYPEDEFS_H + +#include "cf_platform_cfg.h" + +/** + * @brief Values for CFDP file transfer class + * + * The CFDP specification prescribes two classes/modes of file + * transfer protocol operation - unacknowledged/simple or + * acknowledged/reliable. + * + * Defined per section 7.1 of CCSDS 727.0-B-5 + */ +typedef enum +{ + CF_CFDP_CLASS_1 = 0, /**< \brief CFDP class 1 - Unreliable transfer */ + CF_CFDP_CLASS_2 = 1, /**< \brief CFDP class 2 - Reliable transfer */ +} CF_CFDP_Class_t; + +/** + * @brief CF queue identifiers + */ +typedef enum +{ + CF_QueueIdx_PEND = 0, /**< \brief first one on this list is active */ + CF_QueueIdx_TXA = 1, + CF_QueueIdx_TXW = 2, + CF_QueueIdx_RX = 3, + CF_QueueIdx_HIST = 4, + CF_QueueIdx_HIST_FREE = 5, + CF_QueueIdx_FREE = 6, + CF_QueueIdx_NUM = 7, +} CF_QueueIdx_t; + +/** + * @brief Cache of source and destination filename + * + * This pairs a source and destination file name together + * to be retained for future reference in the transaction/history + */ +typedef struct CF_TxnFilenames +{ + char src_filename[CF_FILENAME_MAX_LEN]; + char dst_filename[CF_FILENAME_MAX_LEN]; +} CF_TxnFilenames_t; + +#endif /* CF_EXTERN_TYPEDEFS_H */ \ No newline at end of file diff --git a/fsw/src/cf_msg.h b/fsw/inc/cf_msg.h similarity index 99% rename from fsw/src/cf_msg.h rename to fsw/inc/cf_msg.h index 5c79965e..4d36989b 100644 --- a/fsw/src/cf_msg.h +++ b/fsw/inc/cf_msg.h @@ -28,7 +28,7 @@ #include "cfe.h" #include "cf_platform_cfg.h" -#include "cf_cfdp.h" +#include "cf_extern_typedefs.h" #include "cf_tbldefs.h" #define CF_ALL_CHANNELS (255) diff --git a/fsw/platform_inc/cf_msgids.h b/fsw/inc/cf_msgids.h similarity index 100% rename from fsw/platform_inc/cf_msgids.h rename to fsw/inc/cf_msgids.h diff --git a/fsw/mission_inc/cf_perfids.h b/fsw/inc/cf_perfids.h similarity index 100% rename from fsw/mission_inc/cf_perfids.h rename to fsw/inc/cf_perfids.h diff --git a/fsw/platform_inc/cf_platform_cfg.h b/fsw/inc/cf_platform_cfg.h similarity index 100% rename from fsw/platform_inc/cf_platform_cfg.h rename to fsw/inc/cf_platform_cfg.h diff --git a/fsw/src/cf_tbldefs.h b/fsw/inc/cf_tbldefs.h similarity index 99% rename from fsw/src/cf_tbldefs.h rename to fsw/inc/cf_tbldefs.h index 122c6807..ca55204e 100644 --- a/fsw/src/cf_tbldefs.h +++ b/fsw/inc/cf_tbldefs.h @@ -26,7 +26,7 @@ #define CF_TBLDEFS_H #include "cf_platform_cfg.h" -#include "cf_cfdp_pdu.h" +#include "cf_extern_typedefs.h" /** * \brief Configuration entry for directory polling diff --git a/fsw/src/cf_cfdp_pdu.h b/fsw/src/cf_cfdp_pdu.h index 2caf75e9..d60f19d6 100644 --- a/fsw/src/cf_cfdp_pdu.h +++ b/fsw/src/cf_cfdp_pdu.h @@ -41,7 +41,6 @@ #include "common_types.h" #include "cf_platform_cfg.h" -#include "cf_platform_cfg.h" #include @@ -215,21 +214,6 @@ typedef enum CF_CFDP_FileDirective_INVALID_MAX = 13, /**< \brief Maximum used to limit range */ } CF_CFDP_FileDirective_t; -/** - * @brief Values for CFDP file transfer class - * - * The CFDP specification prescribes two classes/modes of file - * transfer protocol operation - unacknowledged/simple or - * acknowledged/reliable. - * - * Defined per section 7.1 of CCSDS 727.0-B-5 - */ -typedef enum -{ - CF_CFDP_CLASS_1 = 0, /**< \brief CFDP class 1 - Unreliable transfer */ - CF_CFDP_CLASS_2 = 1, /**< \brief CFDP class 2 - Reliable transfer */ -} CF_CFDP_Class_t; - /** * @brief Values for "acknowledgment transfer status" * diff --git a/fsw/src/cf_cfdp_types.h b/fsw/src/cf_cfdp_types.h index e469f2f2..812b9ba1 100644 --- a/fsw/src/cf_cfdp_types.h +++ b/fsw/src/cf_cfdp_types.h @@ -34,6 +34,7 @@ #include "common_types.h" #include "cf_cfdp_pdu.h" #include "cf_platform_cfg.h" +#include "cf_msg.h" #include "cf_clist.h" #include "cf_chunk.h" #include "cf_timer.h" @@ -113,18 +114,6 @@ typedef enum CF_RxEofRet_INVALID = 3, } CF_RxEofRet_t; -/** - * @brief Cache of source and destination filename - * - * This pairs a source and destination file name together - * to be retained for future reference in the transaction/history - */ -typedef struct CF_TxnFilenames -{ - char src_filename[CF_FILENAME_MAX_LEN]; - char dst_filename[CF_FILENAME_MAX_LEN]; -} CF_TxnFilenames_t; - /** * @brief Direction identifier * @@ -391,21 +380,6 @@ typedef struct CF_Transaction CF_StateFlags_t flags; } CF_Transaction_t; -/** - * @brief CF queue identifiers - */ -typedef enum -{ - CF_QueueIdx_PEND = 0, /**< \brief first one on this list is active */ - CF_QueueIdx_TXA = 1, - CF_QueueIdx_TXW = 2, - CF_QueueIdx_RX = 3, - CF_QueueIdx_HIST = 4, - CF_QueueIdx_HIST_FREE = 5, - CF_QueueIdx_FREE = 6, - CF_QueueIdx_NUM = 7, -} CF_QueueIdx_t; - /** * @brief Identifies the type of timer tick being processed */ diff --git a/unit-test/CMakeLists.txt b/unit-test/CMakeLists.txt index 916e8249..ba60e92a 100644 --- a/unit-test/CMakeLists.txt +++ b/unit-test/CMakeLists.txt @@ -63,6 +63,8 @@ add_cfe_coverage_stubs(cf_internal target_link_libraries(coverage-cf_internal-stubs ut_core_api_stubs ut_assert) target_include_directories(coverage-cf_internal-stubs PUBLIC utilities) +target_include_directories(coverage-cf_internal-stubs PUBLIC ../fsw/inc) +target_include_directories(coverage-cf_internal-stubs PUBLIC ../fsw/src) # Generate a dedicated "testrunner" executable for each test file # Accomplish this by cycling through all the app's source files,