GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSD / V0-4-2

Constituent: qsdccsds     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

CCSDS_apidDsc.h File Reference

CCSDS APID input stream descriptor (interface). More...

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


Data Structures

struct  _CCSDS_apidDscNode
 APID Descriptor node. More...
struct  _CCSDS_apidHandlers
 The list handlers for the APID. More...
struct  _CCSDS_apidDsc
 Description of a packet for a specified APID. More...

Typedefs

typedef _CCSDS_istreamHdr CCSDS_istreamHdr
typedef _CCSDS_apidDscTbl CCSDS_apidDscTbl
 Typedef for struct _CCSDS_apidDscTbl.
typedef _CCSDS_apidDscNode CCSDS_apidDscNode
 Typedef for _CCSDS_apidDscNode.
typedef _CCSDS_apidHandlers CCSDS_apidHandlers
 Typedef for struct _CCSDS_apidHandlers.
typedef _CCSDS_apidDsc CCSDS_apidDsc
 Typedef for struct _CCSDS_apidDsc.
typedef _CCSDS_telemetry CCSDS_telemetry
typedef enum _CCSDS_APIDDSC_BRIDGE_K CCSDS_APIDDSC_BRIDGE_K
 Typedef for enum _CCSDS_APIDDSC_BRIDGE_K.
typedef enum _CCSDS_APIDDSC_K CCSDS_APIDDSC_K
 Typedef for enum _CCSDS_APIDDSC_K.
typedef int(* CCSDS_packetChecker )(void *ctx, void *stream, const CCSDS_telemetry *pkt, CCSDS_apidDsc *dsc)
 This routine is callback immediately after a CCSDS packet has been read.
typedef int(* CCSDS_payloadProcessor )(void *ctx, const void *payload, int nbytes)
typedef enum _CCSDS_APIDDSC_POPTS_V CCSDS_APIDDSC_POPTS_V
 Typedef for enum _CCSDS_APIDDSC_POPTS_V.
typedef enum _CCSDS_APIDDSC_POPTS_M CCSDS_APIDDSC_POPTS_M
 Typedef for enum _CCSDS_APIDDSC_POPTS_M.

Enumerations

enum  _CCSDS_APIDDSC_BRIDGE_K {
  CCSDS_APIDDSC_BRIDGE_K_PAYLOAD = 0,
  CCSDS_APIDDSC_BRIDGE_K_HEADER = 1,
  CCSDS_APIDDSC_BRIDGE_K_RSVD_2 = 2,
  CCSDS_APIDDSC_BRIDGE_K_PAD = 3
}
 Enumerates how the odd 16-bit word, hereafter called the bridge word, that follows the normal 7 x 16-bit CCSDS header is to be treated. More...
enum  _CCSDS_APIDDSC_K { CCSDS_APIDDSC_K_SEQ_RESET = 0xffff }
 Encapsulates known constants of the Apid Descriptor. More...
enum  _CCSDS_APIDDSC_POPTS_V {
  CCSDS_APIDDSC_POPTS_V_CHECKER = 0,
  CCSDS_APIDDSC_POPTS_V_PROCESSOR = 1,
  CCSDS_APIDDSC_POPTS_V_SWAP = 2
}
 Processing options, right shifts. More...
enum  _CCSDS_APIDDSC_POPTS_M {
  CCSDS_APIDDSC_POPTS_M_CHECKER = (1 << CCSDS_APIDDSC_POPTS_V_CHECKER),
  CCSDS_APIDDSC_POPTS_M_PROCESSOR = (1 << CCSDS_APIDDSC_POPTS_V_PROCESSOR),
  CCSDS_APIDDSC_POPTS_M_SWAP = (1 << CCSDS_APIDDSC_POPTS_V_SWAP)
}
 Processing options, inplace masks. More...

Functions

int CCSDS_apidDscRegister (CCSDS_apidDscTbl *tbl, CCSDS_apidDsc *dsc, void *ctx, unsigned short int apid, CCSDS_APIDDSC_BRIDGE_K bridge, unsigned char *buf, unsigned int buf_size)
 Registers an APID descriptor.
void CCSDS_apidDscConstruct (CCSDS_apidDsc *dsc, void *ctx, unsigned short int apid, CCSDS_APIDDSC_BRIDGE_K bridge, unsigned char *buf, unsigned int buf_size)
 Constructs (initializes) an CCSDS_apidDsc, an APID descriptor.
void CCSDS_apidDscReset (CCSDS_apidDsc *dsc)
 Resets the specified APID descriptor to its initial state. This routine is used mainly for error recovery.
CCSDS_apidDscCCSDS_apidDscFind (CCSDS_apidDscTbl *tbl, const CCSDS_istreamHdr *hdr)
 Built-in method to locate the descriptor associated with the specified APID as read from the header.
int CCSDS_apidDscSwap32 (CCSDS_apidDsc *dsc)
 Convenience routine to 32-bit swap all the words in the current buffer, presumed to be in a big-endian, to the local representation.
int CCSDS_apidDscSwap16 (CCSDS_apidDsc *dsc)
 Convenience routine to 16-bit swap all the words in the current buffer, presumed to be in a big-endian, to the local representation.
static __inline const void * CCSDS_apidDscPktBeg (const CCSDS_apidDsc *dsc)
 Returns a pointer to the beginning of the current LDF datagram.
static __inline const void * CCSDS_apidDscPktEnd (const CCSDS_apidDsc *dsc)
 Returns a pointer to the end (actually one bytes past the end) of the current LDF datagram.
static __inline int CCSDS_apidDscPktLen (const CCSDS_apidDsc *dsc)
 Returns the length, in bytes, of the current LDF record.
static __inline void CCSDS_apidDscSeqReset (CCSDS_apidDsc *dsc)
 Resets the sequence number to indicate that the next packet encountered is the first. Since the sequence number of the first packet to be processed is unknown, this effectively disables the sequence checking.
static __inline void CCSDS_apidDscSeqSet (CCSDS_apidDsc *dsc, unsigned short int seq)
 Sets the sequence number to the indicated value. This routine is only of interested when trying to resynch to a stream.
static __inline void CCSDS_apidDscPacketCheckerSet (CCSDS_apidDsc *dsc, int enb, CCSDS_packetChecker rtn, void *ctx)
static __inline void CCSDS_apidDscPayloadProcessorSet (CCSDS_apidDsc *dsc, int enb, CCSDS_payloadProcessor rtn, void *ctx)
static __inline void CCSDS_apidDscPoptsEnable (CCSDS_apidDsc *dsc, unsigned int popt)
static __inline void CCSDS_apidDscPoptsDisable (CCSDS_apidDsc *dsc, unsigned int popt)
static __inline void CCSDS_apidDscPoptsSet (CCSDS_apidDsc *dsc, unsigned int popts)
static __inline unsigned int CCSDS_apidDscPopts (CCSDS_apidDsc *dsc)
static __inline void CCSDS_apidDscPoptsSwapEnable (CCSDS_apidDsc *dsc)
static __inline void CCSDS_apidDscPoptsSwapDisable (CCSDS_apidDsc *dsc)

Detailed Description

CCSDS APID input stream descriptor (interface).

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: CCSDS_apidDsc.h,v 1.4 2008/10/28 00:11:40 russell Exp $

Typedef Documentation

CCSDS_APIDDSC_BRIDGE_K
 

Typedef for enum _CCSDS_APIDDSC_BRIDGE_K.

The three basic styles are
  • Treat it as part of the payload
  • Treat it as part of a (secondary) header
  • Treat it as part of a (secondary) header and interpret it as the number of pad bytes

The first option is treating the packet like a plain vanilla CCSDS packet.
The second option is common, using this word like a bridge word. If this type is selected, then it is read and unpacked as part of the header, but no special meaning is ascribed to it.
The third option is to treat this word as the number of pad bytes. This is would be used, for example, to describe CCSDS packets from the SSR.

typedef int(* CCSDS_packetChecker)(void *ctx, void *stream, const CCSDS_telemetry *pkt, CCSDS_apidDsc *dsc)
 

This routine is callback immediately after a CCSDS packet has been read.

Returns:
Anything but 0 will stop the processing
Parameters:
ctx The checker's context parameter
stream The CCSDS stream handle, for example, if this was being called from CCSDS_istreamProcess, it would be CCSDS_istream
pkt The packet header
dsc The APID descriptor. This contains all the information about the current state of the packet plus the last read operation.
This routine can be used for two purposes. If provided, one responsibility is mandatory, it must check the integrity of the packet. This would usually include a call to CCSDS_istreamSivIsError to check the integrity of the IO operation and the basic packet integrity (mainly the sequencing). It could also include other APID specific tests.

int(* CCSDS_payloadProcessor)(void *ctx, const void *payload, int nbytes)
 

Return values:
== 0 Continue
!= 0 Stop
Parameters:
ctx Context parameter
payload The payload to process
nbytes The length, in bytes, of the payload


Enumeration Type Documentation

enum _CCSDS_APIDDSC_BRIDGE_K
 

Enumerates how the odd 16-bit word, hereafter called the bridge word, that follows the normal 7 x 16-bit CCSDS header is to be treated.

Enumerator:
CCSDS_APIDDSC_BRIDGE_K_PAYLOAD  Plan old CCSDS packet
CCSDS_APIDDSC_BRIDGE_K_HEADER  Consider the orphaned 16-bit word as part of the secondary header, that is process it as part of the header reading
CCSDS_APIDDSC_BRIDGE_K_RSVD_2  Reserved for future use, illegal to specify
CCSDS_APIDDSC_BRIDGE_K_PAD  Consider the orphaned 16-bit word as part of the secondary header and interpret it as the number of pad bytes

enum _CCSDS_APIDDSC_K
 

Encapsulates known constants of the Apid Descriptor.

Enumerator:
CCSDS_APIDDSC_K_SEQ_RESET  The initial and reset value of the sequence number. This serves as a flag that there is no store context and so the sequence number of the next packet cannot be checked against the previous, because there is no previous one

enum _CCSDS_APIDDSC_POPTS_M
 

Processing options, inplace masks.

Enumerator:
CCSDS_APIDDSC_POPTS_M_CHECKER  Enable packet checking routine
CCSDS_APIDDSC_POPTS_M_PROCESSOR  Enable payload processing
CCSDS_APIDDSC_POPTS_M_SWAP  Swap payload before processing

enum _CCSDS_APIDDSC_POPTS_V
 

Processing options, right shifts.

Enumerator:
CCSDS_APIDDSC_POPTS_V_CHECKER  Enable packet checking
CCSDS_APIDDSC_POPTS_V_PROCESSOR  Enable payload processing
CCSDS_APIDDSC_POPTS_V_SWAP  Swap payload before processing


Function Documentation

void CCSDS_apidDscConstruct CCSDS_apidDsc dsc,
void *  ctx,
unsigned short int  apid,
CCSDS_APIDDSC_BRIDGE_K  bridge,
unsigned char *  buf,
unsigned int  buf_size
 

Constructs (initializes) an CCSDS_apidDsc, an APID descriptor.

Parameters:
dsc The descriptor to construct/initialize
ctx User provided context parameter
apid The apid used as a key to identify this descriptor
bridge Dictates how the odd 16-bit word following the normal 7 x 16-bit word CCSDS header is to be treated.
buf A buffer to receive the data for this apid
buf_size The size, in bytes, of buf. This needs to be as large as the biggest CCSDS packet (including data that spans multiple packets).

CCSDS_apidDsc* CCSDS_apidDscFind CCSDS_apidDscTbl tbl,
const CCSDS_istreamHdr *  hdr
 

Built-in method to locate the descriptor associated with the specified APID as read from the header.

Return values:
Non-NULL,the descriptor
NULL,error,either the descriptor with the specified APID does not exist or the APID cannot be gotten from the header because the header is unreadable (rare)
Parameters:
tbl The table to search
hdr The CCSDS header containing the APID to locate

static __inline const void * CCSDS_apidDscPktBeg const CCSDS_apidDsc dsc  )  [static]
 

Returns a pointer to the beginning of the current LDF datagram.

Returns:
A pointer to the beginning of the current LDF datagram
Parameters:
dsc The APID descriptor

static __inline const void * CCSDS_apidDscPktEnd const CCSDS_apidDsc dsc  )  [static]
 

Returns a pointer to the end (actually one bytes past the end) of the current LDF datagram.

Returns:
A pointer to the end of the current LDF datagram
Parameters:
dsc The APID descriptor

static __inline int CCSDS_apidDscPktLen const CCSDS_apidDsc dsc  )  [static]
 

Returns the length, in bytes, of the current LDF record.

Returns:
The length, in bytes, of the current LDF record
Parameters:
dsc The APID descriptor

int CCSDS_apidDscRegister CCSDS_apidDscTbl tbl,
CCSDS_apidDsc dsc,
void *  ctx,
unsigned short int  apid,
CCSDS_APIDDSC_BRIDGE_K  bridge,
unsigned char *  buf,
unsigned int  buf_size
 

Registers an APID descriptor.

Return values:
0,Successful 
-1,APID has been previously registered
Parameters:
tbl The apid table
dsc The descriptor to construct/initialize
ctx User provided context parameter
apid The apid used as a key to identify this descriptor
bridge Dictates how the odd 16-bit word following the normal 7 x 16-bit word CCSDS header is to be treated.
buf A buffer to receive the data for this apid
buf_size The size, in bytes, of buf. This needs to be as large as the biggest CCSDS packet (including data that spans multiple packets).

void CCSDS_apidDscReset CCSDS_apidDsc dsc  ) 
 

Resets the specified APID descriptor to its initial state. This routine is used mainly for error recovery.

Parameters:
dsc The descriptor to reset

static __inline void CCSDS_apidDscSeqReset CCSDS_apidDsc dsc  )  [static]
 

Resets the sequence number to indicate that the next packet encountered is the first. Since the sequence number of the first packet to be processed is unknown, this effectively disables the sequence checking.

Parameters:
dsc The APID descriptor

static __inline void CCSDS_apidDscSeqSet CCSDS_apidDsc dsc,
unsigned short int  seq
[static]
 

Sets the sequence number to the indicated value. This routine is only of interested when trying to resynch to a stream.

Parameters:
dsc The APID descriptor
seq The new sequence number. This should be only a maximum of 14 bits.

int CCSDS_apidDscSwap16 CCSDS_apidDsc dsc  ) 
 

Convenience routine to 16-bit swap all the words in the current buffer, presumed to be in a big-endian, to the local representation.

Returns:
The number of 16-bit words that where swapped
Parameters:
dsc The descriptor for the data to be swapped
Note:
On big-endian machine, except for the return value, this is a NOOP.

int CCSDS_apidDscSwap32 CCSDS_apidDsc dsc  ) 
 

Convenience routine to 32-bit swap all the words in the current buffer, presumed to be in a big-endian, to the local representation.

Returns:
The number of 32-bit words that where swapped
Parameters:
dsc The descriptor for the data to be swapped
Note:
On big-endian machine, except for the return value, this is a NOOP.


Generated on Mon Dec 8 01:10:48 2008 by  doxygen 1.4.4