diff --git a/CMakeLists.txt b/CMakeLists.txt index f65ef6e..7c6d094 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,5 @@ project(CFS_MD C) -include_directories(fsw/src) -include_directories(fsw/mission_inc) -include_directories(fsw/platform_inc) - set(APP_SRC_FILES fsw/src/md_dwell_tbl.c fsw/src/md_utils.c @@ -15,6 +11,9 @@ set(APP_SRC_FILES # Create the app module add_cfe_app(md ${APP_SRC_FILES}) +# This permits direct access to public headers in the fsw/inc directory +target_include_directories(md PUBLIC fsw/inc) + set(APP_TABLE_FILES fsw/tables/md_dw02.c fsw/tables/md_dw03.c diff --git a/fsw/src/md_events.h b/fsw/inc/md_events.h similarity index 100% rename from fsw/src/md_events.h rename to fsw/inc/md_events.h diff --git a/fsw/inc/md_extern_typedefs.h b/fsw/inc/md_extern_typedefs.h new file mode 100644 index 0000000..93fc456 --- /dev/null +++ b/fsw/inc/md_extern_typedefs.h @@ -0,0 +1,42 @@ +/************************************************************************ + * 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 md_extern_typedefs module + */ + +#ifndef MD_EXTERN_TYPEDEFS_H +#define MD_EXTERN_TYPEDEFS_H + +/************************************************************************ + * Type Definitions + ************************************************************************/ + +/** + * \brief MD enum used for representing values for enable state + */ +enum MD_Dwell_States +{ + MD_DWELL_STREAM_DISABLED, /**< \brief MD Dwell Stream Disabled */ + MD_DWELL_STREAM_ENABLED /**< \brief MD Dwell Stream Enabled */ +}; + +#endif /* MD_EXTERN_TYPEDEFS_H */ \ No newline at end of file diff --git a/fsw/src/md_msg.h b/fsw/inc/md_msg.h similarity index 99% rename from fsw/src/md_msg.h rename to fsw/inc/md_msg.h index d465145..5b9a05b 100644 --- a/fsw/src/md_msg.h +++ b/fsw/inc/md_msg.h @@ -61,6 +61,7 @@ typedef struct typedef struct { CFE_MSG_CommandHeader_t CmdHeader; /**< Command Header */ + } MD_NoArgsCmd_t; /** diff --git a/fsw/src/md_msgdefs.h b/fsw/inc/md_msgdefs.h similarity index 99% rename from fsw/src/md_msgdefs.h rename to fsw/inc/md_msgdefs.h index b877f12..de24ebc 100644 --- a/fsw/src/md_msgdefs.h +++ b/fsw/inc/md_msgdefs.h @@ -28,6 +28,8 @@ #ifndef MD_MSGDEFS_H #define MD_MSGDEFS_H +#include "md_platform_cfg.h" + /** * \defgroup cfsmdcmdcodes CFS Memory Dwell Command Codes * \{ @@ -285,7 +287,6 @@ * \par Error Conditions * This command may fail for the following reason(s): * - Unexpected command length. (Event message #MD_CMD_LEN_ERR_EID is issued) - * - Signature string argument is not terminated. (Event message #MD_SIGNATURE_TOO_LONG_ERR_EID is issued) * - Dwell Table ID is invalid. (Event message #MD_INVALID_SIGNATURE_TABLE_ERR_EID is issued) * * Any time the command fails, #MD_HkTlm_t.InvalidCmdCntr increments. diff --git a/fsw/platform_inc/md_msgids.h b/fsw/inc/md_msgids.h similarity index 100% rename from fsw/platform_inc/md_msgids.h rename to fsw/inc/md_msgids.h diff --git a/fsw/mission_inc/md_perfids.h b/fsw/inc/md_perfids.h similarity index 100% rename from fsw/mission_inc/md_perfids.h rename to fsw/inc/md_perfids.h diff --git a/fsw/platform_inc/md_platform_cfg.h b/fsw/inc/md_platform_cfg.h similarity index 100% rename from fsw/platform_inc/md_platform_cfg.h rename to fsw/inc/md_platform_cfg.h diff --git a/fsw/src/md_tbldefs.h b/fsw/inc/md_tbldefs.h similarity index 100% rename from fsw/src/md_tbldefs.h rename to fsw/inc/md_tbldefs.h diff --git a/fsw/src/md_app.c b/fsw/src/md_app.c index 4d943a5..afd764f 100644 --- a/fsw/src/md_app.c +++ b/fsw/src/md_app.c @@ -34,6 +34,7 @@ #include "md_utils.h" #include "md_perfids.h" #include "md_version.h" +#include "md_extern_typedefs.h" /* Constant Data */ const MD_CmdHandlerTblRec_t MD_CmdHandlerTbl[] = { diff --git a/fsw/src/md_app.h b/fsw/src/md_app.h index 341f3e5..c76cd77 100644 --- a/fsw/src/md_app.h +++ b/fsw/src/md_app.h @@ -67,15 +67,6 @@ * Type Definitions ************************************************************************/ -/** - * \brief MD enum used for representing values for enable state - */ -enum MD_Dwell_States -{ - MD_DWELL_STREAM_DISABLED, /**< \brief MD Dwell Stream Disabled */ - MD_DWELL_STREAM_ENABLED /**< \brief MD Dwell Stream Enabled */ -}; - /** * \brief MD structure for specifying individual memory dwell */ diff --git a/fsw/src/md_cmds.c b/fsw/src/md_cmds.c index 0e9af9b..ba5ebcd 100644 --- a/fsw/src/md_cmds.c +++ b/fsw/src/md_cmds.c @@ -34,6 +34,7 @@ #include "md_app.h" #include "md_events.h" #include "md_dwell_tbl.h" +#include "md_extern_typedefs.h" /* Global Data */ extern MD_AppData_t MD_AppData; diff --git a/fsw/src/md_dwell_pkt.c b/fsw/src/md_dwell_pkt.c index 904d66a..9ba588b 100644 --- a/fsw/src/md_dwell_pkt.c +++ b/fsw/src/md_dwell_pkt.c @@ -30,6 +30,7 @@ #include "md_app.h" #include "md_events.h" #include +#include "md_extern_typedefs.h" extern MD_AppData_t MD_AppData; diff --git a/fsw/src/md_dwell_tbl.c b/fsw/src/md_dwell_tbl.c index a3e6bf6..c27e897 100644 --- a/fsw/src/md_dwell_tbl.c +++ b/fsw/src/md_dwell_tbl.c @@ -32,6 +32,7 @@ #include "md_events.h" #include #include "md_tbldefs.h" +#include "md_extern_typedefs.h" extern MD_AppData_t MD_AppData; diff --git a/fsw/tables/md_dw01.c b/fsw/tables/md_dw01.c index 23729d6..593f333 100644 --- a/fsw/tables/md_dw01.c +++ b/fsw/tables/md_dw01.c @@ -27,7 +27,7 @@ *************************************************************************/ #include "cfe.h" #include "md_tbldefs.h" -#include "md_app.h" +#include "md_extern_typedefs.h" #include "cfe_tbl_filedef.h" #include "md_platform_cfg.h" diff --git a/fsw/tables/md_dw02.c b/fsw/tables/md_dw02.c index 1fe926d..28dd32b 100644 --- a/fsw/tables/md_dw02.c +++ b/fsw/tables/md_dw02.c @@ -27,7 +27,7 @@ *************************************************************************/ #include "cfe.h" #include "md_tbldefs.h" -#include "md_app.h" +#include "md_extern_typedefs.h" #include "cfe_tbl_filedef.h" #include "md_platform_cfg.h" diff --git a/fsw/tables/md_dw03.c b/fsw/tables/md_dw03.c index d4c63f9..341d9b9 100644 --- a/fsw/tables/md_dw03.c +++ b/fsw/tables/md_dw03.c @@ -27,7 +27,7 @@ *************************************************************************/ #include "cfe.h" #include "md_tbldefs.h" -#include "md_app.h" +#include "md_extern_typedefs.h" #include "cfe_tbl_filedef.h" #include "md_platform_cfg.h" diff --git a/fsw/tables/md_dw04.c b/fsw/tables/md_dw04.c index 31fcd8d..e57091d 100644 --- a/fsw/tables/md_dw04.c +++ b/fsw/tables/md_dw04.c @@ -27,7 +27,7 @@ *************************************************************************/ #include "cfe.h" #include "md_tbldefs.h" -#include "md_app.h" +#include "md_extern_typedefs.h" #include "cfe_tbl_filedef.h" #include "md_platform_cfg.h" diff --git a/unit-test/CMakeLists.txt b/unit-test/CMakeLists.txt index c782637..96b1f97 100644 --- a/unit-test/CMakeLists.txt +++ b/unit-test/CMakeLists.txt @@ -20,8 +20,10 @@ add_cfe_coverage_stubs(md_internal # Link with the cfe core stubs and unit test assert libs target_link_libraries(coverage-md_internal-stubs ut_core_api_stubs ut_assert) -# Include and expose unit test utilities includes +# Include and expose unit test utilities, fsw/inc, and fsw/src includes target_include_directories(coverage-md_internal-stubs PUBLIC utilities) +target_include_directories(coverage-md_internal-stubs PUBLIC ../fsw/inc) +target_include_directories(coverage-md_internal-stubs PUBLIC ../fsw/src) # Stub includes needed for all targets include_directories(stubs) diff --git a/unit-test/utilities/md_test_utils.h b/unit-test/utilities/md_test_utils.h index 8ef1920..71f05e7 100644 --- a/unit-test/utilities/md_test_utils.h +++ b/unit-test/utilities/md_test_utils.h @@ -29,6 +29,7 @@ #include "md_platform_cfg.h" #include "utstubs.h" #include "cfe_msgids.h" +#include "md_extern_typedefs.h" extern MD_AppData_t MD_AppData;