diff --git a/fsw/src/sc_app.c b/fsw/src/sc_app.c index c92d9db..8b53d3f 100644 --- a/fsw/src/sc_app.c +++ b/fsw/src/sc_app.c @@ -41,6 +41,7 @@ #include "sc_perfids.h" #include "sc_version.h" #include "sc_verify.h" +#include "sc_tbldefs.h" #include /************************************************************************** diff --git a/fsw/src/sc_app.h b/fsw/src/sc_app.h index 6dd8fea..d13c6e7 100644 --- a/fsw/src/sc_app.h +++ b/fsw/src/sc_app.h @@ -184,9 +184,6 @@ void SC_RegisterManageCmds(void); #define SC_BYTES_IN_WORD 4 /**< \brief Number of bytes in "word" used to define table lengths */ -#define SC_ATS_HEADER_SIZE (sizeof(SC_AtsEntryHeader_t)) /**< \brief ATS header size in bytes */ -#define SC_RTS_HEADER_SIZE (sizeof(SC_RtsEntryHeader_t)) /**< \brief RTS header size in bytes */ - #define SC_ATS_BUFF_SIZE32 (SC_ATS_BUFF_SIZE / 2) /**< \brief ATS buffer number of 32-bit elements */ #define SC_RTS_BUFF_SIZE32 (SC_RTS_BUFF_SIZE / 2) /**< \brief RTS buffer number of 32-bit elements */ #define SC_APPEND_BUFF_SIZE32 (SC_APPEND_BUFF_SIZE / 2) /**< \brief Append buffer number of 32-bit elements */ @@ -225,57 +222,6 @@ void SC_RegisterManageCmds(void); #define SC_RTS_ID_TO_INDEX(id) ((id)-1) /**< \brief Convert RTS ID to index */ #define SC_RTS_INDEX_TO_ID(index) ((index) + 1) /**< \brief Convert RTS table index to ID */ -/** - * \brief ATS Table Entry Header Type - */ -typedef struct -{ - uint16 Pad; /**< \brief Structure padding */ - - uint16 CmdNumber; /**< \brief command number, range = 1 to SC_MAX_ATS_CMDS */ - - uint16 TimeTag_MS; /**< \brief Time tag most significant 16 bits */ - uint16 TimeTag_LS; /**< \brief Time tag least significant 16 bits */ - - /* - * Note: the command packet data is variable length, - * the command packet header (not shown here), - * comes directly after the time tag - */ -} SC_AtsEntryHeader_t; - -/** - * \brief ATS header and message header - */ -typedef struct -{ - SC_AtsEntryHeader_t Header; /**< \brief ATS header */ - CFE_MSG_Message_t Msg; /**< \brief MSG header */ -} SC_AtsEntry_t; - -/** - * \brief RTS Command Header Type - */ -typedef struct -{ - SC_RelTimeTag_t TimeTag; /**< \brief Relative time tag */ - - /* - * Note: the command packet data is variable length, - * the command packet header (not shown here), - * comes directly after Time tag. - */ -} SC_RtsEntryHeader_t; - -/** - * \brief RTS header and message header - */ -typedef struct -{ - SC_RtsEntryHeader_t Header; /**< \brief RTS header */ - CFE_MSG_Message_t Msg; /**< \brief MSG header */ -} SC_RtsEntry_t; - /** * \brief SC Operational Data Structure * diff --git a/fsw/src/sc_atsrq.c b/fsw/src/sc_atsrq.c index efbbf2a..a464f85 100644 --- a/fsw/src/sc_atsrq.c +++ b/fsw/src/sc_atsrq.c @@ -35,6 +35,7 @@ #include "sc_loads.h" #include "sc_utils.h" #include "sc_events.h" +#include "sc_tbldefs.h" /************************************************************************** ** diff --git a/fsw/src/sc_loads.c b/fsw/src/sc_loads.c index 5e5e69b..06a5d46 100644 --- a/fsw/src/sc_loads.c +++ b/fsw/src/sc_loads.c @@ -36,6 +36,7 @@ #include "sc_atsrq.h" #include "sc_utils.h" #include "sc_events.h" +#include "sc_tbldefs.h" #include /************************************************************************** diff --git a/fsw/src/sc_tbldefs.h b/fsw/src/sc_tbldefs.h index 93083c7..741d299 100644 --- a/fsw/src/sc_tbldefs.h +++ b/fsw/src/sc_tbldefs.h @@ -30,6 +30,12 @@ #include "cfe.h" #include "sc_platform_cfg.h" +/************************************************************************* + * Macro Definitions + *************************************************************************/ +#define SC_ATS_HEADER_SIZE (sizeof(SC_AtsEntryHeader_t)) /**< \brief ATS header size in bytes */ +#define SC_RTS_HEADER_SIZE (sizeof(SC_RtsEntryHeader_t)) /**< \brief RTS header size in bytes */ + /** * \defgroup cfscstblids ID definitions for cFE Table Services manage table request command * \{ @@ -107,4 +113,55 @@ typedef struct uint16 UseCtr; /**< \brief how many times RTS is run */ } SC_RtsInfoEntry_t; +/** + * \brief ATS Table Entry Header Type + */ +typedef struct +{ + uint16 Pad; /**< \brief Structure padding */ + + uint16 CmdNumber; /**< \brief command number, range = 1 to SC_MAX_ATS_CMDS */ + + uint16 TimeTag_MS; /**< \brief Time tag most significant 16 bits */ + uint16 TimeTag_LS; /**< \brief Time tag least significant 16 bits */ + + /* + * Note: the command packet data is variable length, + * the command packet header (not shown here), + * comes directly after the time tag + */ +} SC_AtsEntryHeader_t; + +/** + * \brief ATS header and message header + */ +typedef struct +{ + SC_AtsEntryHeader_t Header; /**< \brief ATS header */ + CFE_MSG_Message_t Msg; /**< \brief MSG header */ +} SC_AtsEntry_t; + +/** + * \brief RTS Command Header Type + */ +typedef struct +{ + SC_RelTimeTag_t TimeTag; /**< \brief Relative time tag */ + + /* + * Note: the command packet data is variable length, + * the command packet header (not shown here), + * comes directly after Time tag. + */ +} SC_RtsEntryHeader_t; + +/** + * \brief RTS header and message header + */ +typedef struct +{ + SC_RtsEntryHeader_t Header; /**< \brief RTS header */ + CFE_MSG_Message_t Msg; /**< \brief MSG header */ +} SC_RtsEntry_t; + #endif diff --git a/fsw/src/sc_utils.h b/fsw/src/sc_utils.h index fa7572c..e6ec3da 100644 --- a/fsw/src/sc_utils.h +++ b/fsw/src/sc_utils.h @@ -26,6 +26,7 @@ #include "cfe.h" #include "sc_app.h" +#include "sc_tbldefs.h" /** * \brief Gets the current time from CFE diff --git a/unit-test/sc_app_tests.c b/unit-test/sc_app_tests.c index 6eae9ea..ea05ecb 100644 --- a/unit-test/sc_app_tests.c +++ b/unit-test/sc_app_tests.c @@ -31,6 +31,7 @@ #include "sc_loads.h" #include "sc_msgids.h" #include "sc_events.h" +#include "sc_tbldefs.h" #include "sc_test_utils.h" #include #include diff --git a/unit-test/sc_atsrq_tests.c b/unit-test/sc_atsrq_tests.c index bf4a3c9..4674a15 100644 --- a/unit-test/sc_atsrq_tests.c +++ b/unit-test/sc_atsrq_tests.c @@ -31,6 +31,7 @@ #include "sc_loads.h" #include "sc_msgids.h" #include "sc_events.h" +#include "sc_tbldefs.h" #include "sc_test_utils.h" #include #include diff --git a/unit-test/sc_cmds_tests.c b/unit-test/sc_cmds_tests.c index ef39ebf..c51b5a6 100644 --- a/unit-test/sc_cmds_tests.c +++ b/unit-test/sc_cmds_tests.c @@ -30,6 +30,7 @@ #include "sc_test_utils.h" #include "sc_utils.h" #include "sc_version.h" +#include "sc_tbldefs.h" #include "cfe_tbl_msg.h" #include diff --git a/unit-test/sc_loads_tests.c b/unit-test/sc_loads_tests.c index fe33d8a..1de958c 100644 --- a/unit-test/sc_loads_tests.c +++ b/unit-test/sc_loads_tests.c @@ -31,6 +31,7 @@ #include "sc_loads.h" #include "sc_msgids.h" #include "sc_events.h" +#include "sc_tbldefs.h" #include "sc_test_utils.h" #include #include diff --git a/unit-test/sc_state_tests.c b/unit-test/sc_state_tests.c index 0f4e63a..f7299d5 100644 --- a/unit-test/sc_state_tests.c +++ b/unit-test/sc_state_tests.c @@ -31,6 +31,7 @@ #include "sc_loads.h" #include "sc_msgids.h" #include "sc_events.h" +#include "sc_tbldefs.h" #include "sc_test_utils.h" #include #include diff --git a/unit-test/sc_utils_tests.c b/unit-test/sc_utils_tests.c index d5aa700..bbba715 100644 --- a/unit-test/sc_utils_tests.c +++ b/unit-test/sc_utils_tests.c @@ -21,6 +21,7 @@ #include "sc_utils.h" #include "sc_events.h" #include "sc_msgids.h" +#include "sc_tbldefs.h" #include "sc_test_utils.h" /* UT includes */ diff --git a/unit-test/stubs/sc_utils_stubs.c b/unit-test/stubs/sc_utils_stubs.c index 49c8def..abbbd02 100644 --- a/unit-test/stubs/sc_utils_stubs.c +++ b/unit-test/stubs/sc_utils_stubs.c @@ -22,6 +22,7 @@ */ #include "sc_utils.h" +#include "sc_tbldefs.h" /* UT includes */ #include "uttest.h" diff --git a/unit-test/utilities/sc_test_utils.c b/unit-test/utilities/sc_test_utils.c index 279338a..0bb2af9 100644 --- a/unit-test/utilities/sc_test_utils.c +++ b/unit-test/utilities/sc_test_utils.c @@ -27,6 +27,7 @@ */ #include "sc_app.h" +#include "sc_tbldefs.h" #include "sc_test_utils.h" /* UT includes */ diff --git a/unit-test/utilities/sc_test_utils.h b/unit-test/utilities/sc_test_utils.h index abef4c6..7ff690e 100644 --- a/unit-test/utilities/sc_test_utils.h +++ b/unit-test/utilities/sc_test_utils.h @@ -29,6 +29,7 @@ */ #include "sc_app.h" +#include "sc_tbldefs.h" #include "utstubs.h" #include "cfe_msgids.h" #include "cfe_tbl_msg.h"