GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSD / dev > qsdccsds / rhel5-64
#include <QSD/CCSDS_apidDsc.h>
#include <QSD/CCSDS_istream.h>
#include <QSD/CCSDS_header.h>
Classes | |
struct | _CCSDS_apidDscTbl |
The table of APID descriptors. More... | |
Functions | |
static __inline CCSDS_apidDscNode * | insert (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_apidDsc * | CCSDS_apidDscFind (CCSDS_apidDscTbl *tbl, const CCSDS_header *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. |
CVS $Id: CCSDS_apidDsc.c,v 1.4 2011/03/26 21:06:58 russell Exp $
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.
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). |
References _CCSDS_apidDsc::apid, _CCSDS_apidDsc::bridge, _CCSDS_apidDsc::buf, CCSDS_APIDDSC_K_SEQ_RESET, CCSDS_istreamSivConstruct(), _CCSDS_apidDsc::ctx, _CCSDS_apidDsc::cur, _CCSDS_apidDsc::max, _CCSDS_apidDsc::seq, and _CCSDS_apidDsc::siv.
Referenced by CCSDS_apidDscRegister().
CCSDS_apidDsc * CCSDS_apidDscFind | ( | CCSDS_apidDscTbl * | tbl, | |
const CCSDS_header * | hdr | |||
) |
Built-in method to locate the descriptor associated with the specified APID as read from the header.
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) |
tbl | The table to search | |
hdr | The CCSDS header containing the APID to locate |
References _CCSDS_apidDsc::apid, CCSDS__headerApid(), _CCSDS_apidDscNode::flnk, _CCSDS_apidDsc::node, and _CCSDS_apidDscTbl::que.
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.
0,Successful | ||
-1,APID | has been previously registered |
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). |
References CCSDS_apidDscConstruct(), insert(), _CCSDS_apidDsc::node, and _CCSDS_apidDscTbl::que.
void CCSDS_apidDscReset | ( | CCSDS_apidDsc * | dsc | ) |
Resets the specified APID descriptor to its initial state. This routine is used mainly for error recovery.
dsc | The descriptor to reset |
References _CCSDS_apidDsc::buf, CCSDS_APIDDSC_K_SEQ_RESET, CCSDS_istreamSivConstruct(), _CCSDS_apidDsc::cur, _CCSDS_apidDsc::seq, and _CCSDS_apidDsc::siv.
Referenced by CCSDS_istreamPktResynch().
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.
dsc | The descriptor for the data to be swapped |
References _CCSDS_apidDsc::buf, _CCSDS_apidDsc::cur, and swap16bN().
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.
dsc | The descriptor for the data to be swapped |
References _CCSDS_apidDsc::buf, _CCSDS_apidDsc::cur, and swap32bN().
Referenced by CCSDS_istreamProcess().
static __inline CCSDS_apidDscNode insert | ( | CCSDS_apidDscNode * | head, | |
CCSDS_apidDscNode * | node | |||
) | [static] |
Inserts an APID descriptor on the que.
head | The que head | |
node | The node to insert on the que |
References _CCSDS_apidDscNode::blnk, and _CCSDS_apidDscNode::flnk.
Referenced by CCSDS_apidDscRegister().
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.
a16 | The array of 16-bit words to swap | |
n16 | The number of words to half_word swap |
Referenced by CCSDS_apidDscSwap16().
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.
a32 | The array of 32-bit words to swap | |
n32 | The number of words to word swap |
Referenced by CCSDS_apidDscSwap32().