GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QMEM / V0-2-0

Constituent: qmem_dump_packets     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QMEM.h File Reference

Public interface to the MEM package SSR telemetry interpreter. More...

#include "LSF/LSF.h"
#include "LSF/LSF_ids.h"

Include dependency graph for QMEM.h:

This graph shows which files directly or indirectly include this file:


Typedefs

typedef enum _QMEM_Status QMEM_Status
 Typedef for _QMEM_Status.
typedef enum _QMEM_Lat_Unit QMEM_Lat_Unit
 Typedef for _QMEM_Lat_Unit.
typedef enum _QMEM_Datagram_Id QMEM_Datagram_Id
 Typedef for _QMEM_Datagram_Id.
typedef _QMEM_Context QMEM_Context
 Typedef for opaque parsing context.

Enumerations

enum  _QMEM_Status {
  QMEM_STATUS_OK = 0,
  QMEM_STATUS_BAD_CTX = -1,
  QMEM_STATUS_SHORT = -2,
  QMEM_STATUS_TRUNCATED = -3,
  QMEM_STATUS_BAD_DIR = -4,
  QMEM_STATUS_BAD_TYPE = -5,
  QMEM_STATUS_BAD_VER = -6,
  QMEM_STATUS_BAD_HDR = -7,
  QMEM_STATUS_INCOMPLETE = -8,
  QMEM_STATUS_NULL_PTR = -9,
  QMEM_STATUS_BAD_CTB_LEN = -10,
  QMEM_STATUS_NOT_NEXT = -11
}
 QMEM function status codes. More...
enum  _QMEM_Lat_Unit {
  QMEM_LAT_UNIT_UNKNOWN = -1,
  QMEM_LAT_UNIT_SIU = 0,
  QMEM_LAT_UNIT_EPU_0 = 1,
  QMEM_LAT_UNIT_EPU_1 = 2,
  QMEM_LAT_UNIT_EPU_2 = 3
}
 Identifiers of the LAT units that can produce MEM datagrams. More...
enum  _QMEM_Datagram_Id { QMEM_DGM_ID_DUMP = LSF_ID_K_MEM }
 Identifiers of the MEM datagrams. More...

Functions

unsigned int QMEM_sizeof_context (void)
 Return the size of a parsing context.
unsigned int QMEM_sizeof_max_dump_data (void)
 Return the maximum amount of dump data within a datagram.
unsigned int QMEM_sizeof_max_datagram (void)
 Return the maximum size of a memory dump datagram.
QMEM_Status QMEM_init_context (QMEM_Context *context_p, unsigned char *data_buf_p, unsigned int data_buf_bytes)
 Initialize a parsing context.
QMEM_Status QMEM_start_parsing (QMEM_Context *context_p, const LSF_datagram *dgm_p, unsigned int dgm_bytes, int dgm_swapped)
 Start parsing a datagram.
QMEM_Status QMEM_parse_contribution (QMEM_Context *context_p, const LSF_contribution *ctb_p, unsigned int dgm_bytes, int dgm_swapped)
 Parse a contribution within a datagram.
QMEM_Status QMEM_parse_datagram (QMEM_Context *context_p, const LSF_datagram *dgm_p, unsigned int dgm_bytes, int dgm_swapped)
 Parse an entire memory dump datagram.
QMEM_Status QMEM_status (const QMEM_Context *context_p)
 Return the status of the parsing of the current datagram.
QMEM_Lat_Unit QMEM_lat_unit (const QMEM_Context *context_p)
 Return the LAT unit that sent a memory dump.
unsigned int QMEM_tran_id (const QMEM_Context *context_p)
 Return the transaction ID value from the telecommand that requested a memory dump.
unsigned int QMEM_cmd_fcode (const QMEM_Context *context_p)
 Return the function code of the telecommand that requested a memory dump.
unsigned int QMEM_start_addr (const QMEM_Context *context_p)
 Return the starting address of a memory dump.
unsigned int QMEM_num_datagrams (const QMEM_Context *context_p)
 Return the number of datagrams parsed for the memory dump.
unsigned int QMEM_bytes_dumped (const QMEM_Context *context_p)
 Return the number of bytes dumped.
unsigned int QMEM_bytes_available (const QMEM_Context *context_p)
 Return the number of dumped bytes that were saved.
unsigned char * QMEM_data_buf (const QMEM_Context *context_p)
 Return a pointer to a buffer containing saved dump data.

Detailed Description

Public interface to the MEM package SSR telemetry interpreter.

**  CVS $Id: QMEM.h,v 1.2 2005/12/27 14:34:58 dmay Exp $
**  

Defines the public interface to the functions that interpret the memory dump telemetry sent to the SSR.


Enumeration Type Documentation

enum _QMEM_Datagram_Id
 

Identifiers of the MEM datagrams.

Enumerator:
QMEM_DGM_ID_DUMP  Memory dump datagram.

enum _QMEM_Lat_Unit
 

Identifiers of the LAT units that can produce MEM datagrams.

Enumerator:
QMEM_LAT_UNIT_UNKNOWN  Unknown
QMEM_LAT_UNIT_SIU  SIU
QMEM_LAT_UNIT_EPU_0  EPU 0
QMEM_LAT_UNIT_EPU_1  EPU 1
QMEM_LAT_UNIT_EPU_2  EPU 2

enum _QMEM_Status
 

QMEM function status codes.

Enumerator:
QMEM_STATUS_OK  Function completed successfully.
QMEM_STATUS_BAD_CTX  The parsing context is invalid.
QMEM_STATUS_SHORT  The datagram is too short to contain an expected header or contribution body.
QMEM_STATUS_TRUNCATED  The datagram is truncated such that it is shorter than the size indicated by one of its headers.
QMEM_STATUS_BAD_DIR  One of the headers within the datagram contains an invalid 'dir' value.
QMEM_STATUS_BAD_TYPE  One of the headers within the datagram contains an invalid 'type_id' value.
QMEM_STATUS_BAD_VER  One of the headers within the datagram contains an invalid 'version' value.
QMEM_STATUS_BAD_HDR  One of the headers within the datagram contains an invalid value.
QMEM_STATUS_INCOMPLETE  The datagram is missing one or more contributions.
QMEM_STATUS_NULL_PTR  A pointer parameter was NULL.
QMEM_STATUS_BAD_CTB_LEN  One of the contribution headers within the datagram contains an invalid length value.
QMEM_STATUS_NOT_NEXT  The dump data from the datagram does not immediately follow the data that has already been dumped within the current context.


Function Documentation

unsigned int QMEM_bytes_available const QMEM_Context context_p  ) 
 

Return the number of dumped bytes that were saved.

Parameters:
context_p Pointer to a parsing context.
Returns:
Number of bytes saved.

unsigned int QMEM_bytes_dumped const QMEM_Context context_p  ) 
 

Return the number of bytes dumped.

Parameters:
context_p Pointer to a parsing context.
Returns:
Number of bytes dumped.

unsigned int QMEM_cmd_fcode const QMEM_Context context_p  ) 
 

Return the function code of the telecommand that requested a memory dump.

Parameters:
context_p Pointer to a parsing context.
Returns:
Function code value.

unsigned char * QMEM_data_buf const QMEM_Context context_p  ) 
 

Return a pointer to a buffer containing saved dump data.

Parameters:
context_p Pointer to a parsing context.
Returns:
Pointer to dump data buffer.

QMEM_Status QMEM_init_context QMEM_Context context_p,
unsigned char *  data_buf_p,
unsigned int  data_buf_bytes
 

Initialize a parsing context.

Parameters:
context_p Pointer to the parsing context to initialize.
data_buf_p Pointer to a buffer to save dumped data.
data_buf_bytes Size of the data_buf_p buffer.
Returns:
QMEM_Status value.

QMEM_Lat_Unit QMEM_lat_unit const QMEM_Context context_p  ) 
 

Return the LAT unit that sent a memory dump.

Parameters:
context_p Pointer to a parsing context.
Returns:
LAT unit value.

unsigned int QMEM_num_datagrams const QMEM_Context context_p  ) 
 

Return the number of datagrams parsed for the memory dump.

Parameters:
context_p Pointer to a parsing context.
Returns:
Number of datagrams parsed.

QMEM_Status QMEM_parse_contribution QMEM_Context context_p,
const LSF_contribution *  ctb_p,
unsigned int  dgm_bytes,
int  dgm_swapped
 

Parse a contribution within a datagram.

Parameters:
context_p Pointer to the parsing context for the datagram.
ctb_p Pointer to the contribution.
dgm_bytes Remaining size, in bytes, of the datagram.
dgm_swapped Flag that datagram data is already byte-swapped.
Returns:
QMEM_Status value.
This function can be used as a callback by an external datagram parser when it reaches each contribution header of a memory dump datagram. The opaque context will be updated with the information found in the contribution. When the external parser reaches the end of the datagram, it can use the QMEM_status(), QMEM_lat_unit(), etc. functions to extract information about the datagram.

QMEM_Status QMEM_parse_datagram QMEM_Context context_p,
const LSF_datagram *  dgm_p,
unsigned int  dgm_bytes,
int  dgm_swapped
 

Parse an entire memory dump datagram.

Parameters:
context_p Pointer to a parsing context for the datagram.
dgm_p Pointer to the datagram.
dgm_bytes Size, in bytes, of the datagram.
dgm_swapped Flag that datagram data is already byte-swapped.
Returns:
QMEM_Status value.
This function uses the QMEM_start_parsing() and QMEM_parse_contribution() functions to walk through and parse an entire memory dump datagram. The QMEM_status(), QMEM_lat_unit(), etc. functions can then be used to extract information about the datagram.

unsigned int QMEM_sizeof_context void   ) 
 

Return the size of a parsing context.

Returns:
Size, in bytes, of a parsing context.

unsigned int QMEM_sizeof_max_datagram void   ) 
 

Return the maximum size of a memory dump datagram.

Returns:
Maximum size, in bytes, of a memory dump datagram.

unsigned int QMEM_sizeof_max_dump_data void   ) 
 

Return the maximum amount of dump data within a datagram.

Returns:
Maximum amount, in bytes, of dump data within a datagram.

unsigned int QMEM_start_addr const QMEM_Context context_p  ) 
 

Return the starting address of a memory dump.

Parameters:
context_p Pointer to a parsing context.
Returns:
Starting address value.

QMEM_Status QMEM_start_parsing QMEM_Context context_p,
const LSF_datagram *  dgm_p,
unsigned int  dgm_bytes,
int  dgm_swapped
 

Start parsing a datagram.

Parameters:
context_p Pointer to a parsing context for the datagram.
dgm_p Pointer to the datagram.
dgm_bytes Size, in bytes, of the datagram.
dgm_swapped Flag that datagram data is already byte-swapped.
Returns:
QMEM_Status value.

QMEM_Status QMEM_status const QMEM_Context context_p  ) 
 

Return the status of the parsing of the current datagram.

Parameters:
context_p Pointer to a parsing context.
Returns:
Current parsing status.

unsigned int QMEM_tran_id const QMEM_Context context_p  ) 
 

Return the transaction ID value from the telecommand that requested a memory dump.

Parameters:
context_p Pointer to a parsing context.
Returns:
Transaction ID value.


Generated on Sun Jun 14 02:18:29 2009 by  doxygen 1.4.4