Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #16, Move Table Header definitions from sc_app.h to sc_tbldefs.h #62

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions fsw/src/sc_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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
*
Expand Down
57 changes: 57 additions & 0 deletions fsw/src/sc_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
* \{
Expand Down Expand Up @@ -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