GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSD / V0-3-1

Constituent: qsdccsds     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

CCSDS_apidDsc.c File Reference

APID descriptor management. More...

#include "QSD/CCSDS_apidDsc.h"
#include "QSD/CCSDS_istream.h"
#include "QSD/CCSDS_header.h"

Include dependency graph for CCSDS_apidDsc.c:


Data Structures

struct  _CCSDS_apidDscTbl
 The table of APID descriptors. More...

Functions

static __inline CCSDS_apidDscNodeinsert (CCSDS_apidDscNode *head, CCSDS_apidDscNode *node)
 Inserts an APID descriptor on the que.
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.
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_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.
static __inline void swap32bN (unsigned int *a32, int n32)
 Swaps the specified number of 32-bit integers, presumed to be in a big endian representation to the local endianness.. This is a NOOP on big endian machines.
static __inline void swap16bN (unsigned short int *a16, int n16)
 Swaps the specified number of 16-bit integers, presumed to be in a big endian representation to the local endianness. This is a NOOP on big endian machines.
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.

Detailed Description

APID descriptor management.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: CCSDS_apidDsc.c,v 1.2 2008/04/04 21:22:35 russell Exp $

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

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

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.

static __inline CCSDS_apidDscNode insert CCSDS_apidDscNode head,
CCSDS_apidDscNode node
[static]
 

Inserts an APID descriptor on the que.

Returns:
The previous last descriptor on the que
Parameters:
head The que head
node The node to insert on the que

void swap16bN unsigned short int *  a16,
int  n16
[static]
 

Swaps the specified number of 16-bit integers, presumed to be in a big endian representation to the local endianness. This is a NOOP on big endian machines.

Parameters:
a16 The array of 16-bit words to swap
n16 The number of words to half_word swap

void swap32bN unsigned int *  a32,
int  n32
[static]
 

Swaps the specified number of 32-bit integers, presumed to be in a big endian representation to the local endianness.. This is a NOOP on big endian machines.

Parameters:
a32 The array of 32-bit words to swap
n32 The number of words to word swap


Generated on Thu Sep 25 01:14:07 2008 by  doxygen 1.4.4