Skip to content

Commit

Permalink
Fix #80, cmd and tlm messages use payload sub-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
havencarlson committed Aug 2, 2023
1 parent 9535a04 commit e67ee74
Show file tree
Hide file tree
Showing 16 changed files with 1,610 additions and 1,526 deletions.
190 changes: 137 additions & 53 deletions fsw/inc/mm_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,114 @@ typedef struct
char SymName[OS_MAX_SYM_LEN]; /**< \brief Symbol name string */
} MM_SymAddr_t;

/**
* \brief Memory Peek Command Payload
*/
typedef struct
{
size_t DataSize; /**< \brief Size of the data to be read */
MM_MemType_t MemType; /**< \brief Memory type to peek data from */
MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source peek address */
} MM_PeekCmd_Payload_t;

/**
* \brief Memory Poke Command Payload
*/
typedef struct
{
size_t DataSize; /**< \brief Size of the data to be written */
MM_MemType_t MemType; /**< \brief Memory type to poke data to */
uint32 Data; /**< \brief Data to be written */
uint8 Padding2[4]; /**< \brief Structure padding */
MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination poke address */
} MM_PokeCmd_Payload_t;

/**
* \brief Memory Load With Interrupts Disabled Command Payload
*/
typedef struct
{
uint8 NumOfBytes; /**< \brief Number of bytes to be loaded */
uint8 Padding[3]; /**< \brief Structure padding */
uint32 Crc; /**< \brief Data check value */
MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination load address */
uint8 DataArray[MM_MAX_UNINTERRUPTIBLE_DATA]; /**< \brief Data to be loaded */
} MM_LoadMemWIDCmd_Payload_t;

/**
* \brief Dump Memory In Event Message Command Payload
*/
typedef struct
{
MM_MemType_t MemType; /**< \brief Memory dump type */
uint8 NumOfBytes; /**< \brief Number of bytes to be dumped */
uint8 Padding[3]; /**< \brief Structure padding */
MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source address */
} MM_DumpInEventCmd_Payload_t;

/**
* \brief Memory Load From File Command Payload
*/
typedef struct
{
char FileName[OS_MAX_PATH_LEN]; /**< \brief Name of memory load file */
} MM_LoadMemFromFileCmd_Payload_t;

/**
* \brief Memory Dump To File Command Payload
*/
typedef struct
{
MM_MemType_t MemType; /**< \brief Memory dump type */
uint32 NumOfBytes; /**< \brief Number of bytes to be dumped */
MM_SymAddr_t SrcSymAddress; /**< \brief Symbol plus optional offset */
char FileName[OS_MAX_PATH_LEN]; /**< \brief Name of memory dump file */
} MM_DumpMemToFileCmd_Payload_t;

/**
* \brief Memory Fill Command Payload
*/
typedef struct
{
MM_MemType_t MemType; /**< \brief Memory type */
uint32 NumOfBytes; /**< \brief Number of bytes to fill */
uint32 FillPattern; /**< \brief Fill pattern to use */
uint8 Padding[4]; /**< \brief Structure padding */
MM_SymAddr_t DestSymAddress; /**< \brief Symbol plus optional offset */
} MM_FillMemCmd_Payload_t;

/**
* \brief Symbol Table Lookup Command Payload
*/
typedef struct
{
char SymName[OS_MAX_SYM_LEN]; /**< \brief Symbol name string */
} MM_LookupSymCmd_Payload_t;

/**
* \brief Save Symbol Table To File Command Payload
*/
typedef struct
{
char FileName[OS_MAX_PATH_LEN]; /**< \brief Name of symbol dump file */
} MM_SymTblToFileCmd_Payload_t;

/**
* \brief EEPROM Write Enable Command Payload
*/
typedef struct
{
uint32 Bank; /**< \brief EEPROM bank number to write-enable */
} MM_EepromWriteEnaCmd_Payload_t;

/**
* \brief EEPROM Write Disable Command Payload
*/
typedef struct
{
uint32 Bank; /**< \brief EEPROM bank number to write-disable */
} MM_EepromWriteDisCmd_Payload_t;

/**
* \brief No Arguments Command
*
Expand All @@ -86,10 +194,7 @@ typedef struct
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

size_t DataSize; /**< \brief Size of the data to be read */
MM_MemType_t MemType; /**< \brief Memory type to peek data from */
MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source peek address */
MM_PeekCmd_Payload_t Payload;
} MM_PeekCmd_t;

/**
Expand All @@ -100,12 +205,7 @@ typedef struct
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

size_t DataSize; /**< \brief Size of the data to be written */
MM_MemType_t MemType; /**< \brief Memory type to poke data to */
uint32 Data; /**< \brief Data to be written */
uint8 Padding2[4]; /**< \brief Structure padding */
MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination poke address */
MM_PokeCmd_Payload_t Payload;
} MM_PokeCmd_t;

/**
Expand All @@ -115,13 +215,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

uint8 NumOfBytes; /**< \brief Number of bytes to be loaded */
uint8 Padding[3]; /**< \brief Structure padding */
uint32 Crc; /**< \brief Data check value */
MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination load address */
uint8 DataArray[MM_MAX_UNINTERRUPTIBLE_DATA]; /**< \brief Data to be loaded */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_LoadMemWIDCmd_Payload_t Payload;
} MM_LoadMemWIDCmd_t;

/**
Expand All @@ -131,12 +226,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

MM_MemType_t MemType; /**< \brief Memory dump type */
uint8 NumOfBytes; /**< \brief Number of bytes to be dumped */
uint8 Padding[3]; /**< \brief Structure padding */
MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source address */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_DumpInEventCmd_Payload_t Payload;
} MM_DumpInEventCmd_t;

/**
Expand All @@ -146,9 +237,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

char FileName[OS_MAX_PATH_LEN]; /**< \brief Name of memory load file */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_LoadMemFromFileCmd_Payload_t Payload;
} MM_LoadMemFromFileCmd_t;

/**
Expand All @@ -158,12 +248,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

MM_MemType_t MemType; /**< \brief Memory dump type */
uint32 NumOfBytes; /**< \brief Number of bytes to be dumped */
MM_SymAddr_t SrcSymAddress; /**< \brief Symbol plus optional offset */
char FileName[OS_MAX_PATH_LEN]; /**< \brief Name of memory dump file */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_DumpMemToFileCmd_Payload_t Payload;
} MM_DumpMemToFileCmd_t;

/**
Expand All @@ -174,12 +260,7 @@ typedef struct
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

MM_MemType_t MemType; /**< \brief Memory type */
uint32 NumOfBytes; /**< \brief Number of bytes to fill */
uint32 FillPattern; /**< \brief Fill pattern to use */
uint8 Padding[4]; /**< \brief Structure padding */
MM_SymAddr_t DestSymAddress; /**< \brief Symbol plus optional offset */
MM_FillMemCmd_Payload_t Payload;
} MM_FillMemCmd_t;

/**
Expand All @@ -189,9 +270,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

char SymName[OS_MAX_SYM_LEN]; /**< \brief Symbol name string */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_LookupSymCmd_Payload_t Payload;
} MM_LookupSymCmd_t;

/**
Expand All @@ -201,9 +281,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

char FileName[OS_MAX_PATH_LEN]; /**< \brief Name of symbol dump file */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_SymTblToFileCmd_Payload_t Payload;
} MM_SymTblToFileCmd_t;

/**
Expand All @@ -213,9 +292,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

uint32 Bank; /**< \brief EEPROM bank number to write-enable */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_EepromWriteEnaCmd_Payload_t Payload;
} MM_EepromWriteEnaCmd_t;

/**
Expand All @@ -225,9 +303,8 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */

uint32 Bank; /**< \brief EEPROM bank number to write-disable */
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
MM_EepromWriteDisCmd_Payload_t Payload;
} MM_EepromWriteDisCmd_t;

/**\}*/
Expand All @@ -238,12 +315,10 @@ typedef struct
*/

/**
* \brief Housekeeping Packet Structure
* \brief Housekeeping Packet Payload Structure
*/
typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */

uint8 CmdCounter; /**< \brief MM Application Command Counter */
uint8 ErrCounter; /**< \brief MM Application Command Error Counter */
uint8 LastAction; /**< \brief Last command action executed */
Expand All @@ -253,6 +328,15 @@ typedef struct
uint32 DataValue; /**< \brief Last command data (fill pattern or peek/poke value) */
size_t BytesProcessed; /**< \brief Bytes processed for last command */
char FileName[OS_MAX_PATH_LEN]; /**< \brief Name of the data file used for last command, where applicable */
} MM_HkPacket_Payload_t;

/**
* \brief Housekeeping Packet Structure
*/
typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */
MM_HkPacket_Payload_t Payload;
} MM_HkPacket_t;

/**\}*/
Expand Down
Loading

0 comments on commit e67ee74

Please sign in to comment.