GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSD / V0-5-0 > qsdccsds / rhel5-32
Classes | |
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 struct _CCSDS_header | CCSDS_header |
Typedef for struct _CCSDS_header. | |
typedef struct _CCSDS_apidDscTbl | CCSDS_apidDscTbl |
Typedef for struct _CCSDS_apidDscTbl. | |
typedef struct _CCSDS_apidDscNode | CCSDS_apidDscNode |
Typedef for _CCSDS_apidDscNode. | |
typedef struct _CCSDS_apidHandlers | CCSDS_apidHandlers |
Typedef for struct _CCSDS_apidHandlers. | |
typedef struct _CCSDS_apidDsc | CCSDS_apidDsc |
Typedef for struct _CCSDS_apidDsc. | |
typedef struct _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) |
User callback routine to process the fully assembled payload of a sequence of CCSDS packets. | |
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_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. | |
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) |
Establishes the packet checking routine. This routine is called to verify the integrity of a just read CCSDS packet. | |
static __inline void | CCSDS_apidDscPayloadProcessorSet (CCSDS_apidDsc *dsc, int enb, CCSDS_payloadProcessor rtn, void *ctx) |
Establishes the payload processing routine. This routine is called when the payload of all CCSDS packets have been assembled. Enabling the SWAP option will 32-bit swap the payload before handing it to the user. | |
static __inline void | CCSDS_apidDscPoptsEnable (CCSDS_apidDsc *dsc, unsigned int popt) |
Enables the specified set of processing options,. | |
static __inline void | CCSDS_apidDscPoptsDisable (CCSDS_apidDsc *dsc, unsigned int popt) |
Disables the specified set of processing options,. | |
static __inline void | CCSDS_apidDscPoptsSet (CCSDS_apidDsc *dsc, unsigned int popts) |
Sets the specified set of processing options,. | |
static __inline unsigned int | CCSDS_apidDscPopts (CCSDS_apidDsc *dsc) |
Returns the set of currently enabled processing options. | |
static __inline void | CCSDS_apidDscPoptsSwapEnable (CCSDS_apidDsc *dsc) |
Convenience function to enabled the swapping processing option. | |
static __inline void | CCSDS_apidDscPoptsSwapDisable (CCSDS_apidDsc *dsc) |
Convenience function to disabled the swapping processing option. |
CVS $Id: CCSDS_apidDsc.h,v 1.5 2009/03/28 16:10:35 russell Exp $
Typedef for enum _CCSDS_APIDDSC_BRIDGE_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.
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. |
int(* CCSDS_payloadProcessor)(void *ctx, const void *payload, int nbytes) |
User callback routine to process the fully assembled payload of a sequence of CCSDS packets.
== | 0 Continue | |
!= | 0 Stop |
ctx | Context parameter | |
payload | The payload to process | |
nbytes | The length, in bytes, of the payload |
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.
enum _CCSDS_APIDDSC_K |
Encapsulates known constants of the 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.
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.
static __inline void CCSDS_apidDscPacketCheckerSet | ( | CCSDS_apidDsc * | dsc, | |
int | enb, | |||
CCSDS_packetChecker | rtn, | |||
void * | ctx | |||
) | [static] |
Establishes the packet checking routine. This routine is called to verify the integrity of a just read CCSDS packet.
dsc | The target APID descriptor | |
enb | If non-zero, enable checking. If this is zero, then the checking routine is established, but is not called. This is useful in some circumstances. | |
rtn | The packet checking routine. | |
ctx | A user provided context parameter to be passed to the packet checking routine. |
References CCSDS_APIDDSC_POPTS_V_CHECKER, _CCSDS_apidHandlers::checker_ctx, _CCSDS_apidHandlers::checker_rtn, _CCSDS_apidDsc::handler, and _CCSDS_apidDsc::popts.
static __inline void CCSDS_apidDscPayloadProcessorSet | ( | CCSDS_apidDsc * | dsc, | |
int | enb, | |||
CCSDS_payloadProcessor | rtn, | |||
void * | ctx | |||
) | [static] |
Establishes the payload processing routine. This routine is called when the payload of all CCSDS packets have been assembled. Enabling the SWAP option will 32-bit swap the payload before handing it to the user.
dsc | The target APID descriptor | |
enb | If non-zero, enable checking. If this is zero, then the payload processing routine is established, but is not called. This is useful in some circumstances. | |
rtn | The payload processing routine. | |
ctx | A user provided context parameter to be passed to the payload processing routine. |
References CCSDS_APIDDSC_POPTS_V_PROCESSOR, _CCSDS_apidDsc::handler, _CCSDS_apidDsc::popts, _CCSDS_apidHandlers::processor_ctx, and _CCSDS_apidHandlers::processor_rtn.
static __inline const void * CCSDS_apidDscPktBeg | ( | const CCSDS_apidDsc * | dsc | ) | [static] |
Returns a pointer to the beginning of the current LDF datagram.
dsc | The APID descriptor |
References _CCSDS_apidDsc::buf.
Referenced by CCSDS_istreamProcess().
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.
dsc | The APID descriptor |
References _CCSDS_apidDsc::cur.
static __inline int CCSDS_apidDscPktLen | ( | const CCSDS_apidDsc * | dsc | ) | [static] |
Returns the length, in bytes, of the current LDF record.
dsc | The APID descriptor |
References _CCSDS_apidDsc::buf, and _CCSDS_apidDsc::cur.
Referenced by CCSDS_istreamProcess().
static __inline unsigned int CCSDS_apidDscPopts | ( | CCSDS_apidDsc * | dsc | ) | [static] |
Returns the set of currently enabled processing options.
dsc | The target APID descriptor |
References _CCSDS_apidDsc::popts.
static __inline void CCSDS_apidDscPoptsDisable | ( | CCSDS_apidDsc * | dsc, | |
unsigned int | popts | |||
) | [static] |
Disables the specified set of processing options,.
dsc | The target APID descriptor | |
popts | The list of processing options presented as an OR'd set of the CCSDS_APIDDSC_POPTS_M enumeration to disable. |
References _CCSDS_apidDsc::popts.
static __inline void CCSDS_apidDscPoptsEnable | ( | CCSDS_apidDsc * | dsc, | |
unsigned int | popts | |||
) | [static] |
Enables the specified set of processing options,.
dsc | The target APID descriptor | |
popts | The list of processing options presented as an OR'd set of the CCSDS_APIDDSC_POPTS_M enumeration to enable |
References _CCSDS_apidDsc::popts.
static __inline void CCSDS_apidDscPoptsSet | ( | CCSDS_apidDsc * | dsc, | |
unsigned int | popts | |||
) | [static] |
Sets the specified set of processing options,.
dsc | The target APID descriptor | |
popts | The list of processing options presented as an OR'd set of the CCSDS_APIDDSC_POPTS_M enumeration. |
References _CCSDS_apidDsc::popts.
static __inline void CCSDS_apidDscPoptsSwapDisable | ( | CCSDS_apidDsc * | dsc | ) | [static] |
Convenience function to disabled the swapping processing option.
dsc | The target APID descriptor |
References CCSDS_APIDDSC_POPTS_M_SWAP, and _CCSDS_apidDsc::popts.
static __inline void CCSDS_apidDscPoptsSwapEnable | ( | CCSDS_apidDsc * | dsc | ) | [static] |
Convenience function to enabled the swapping processing option.
dsc | The target APID descriptor |
References CCSDS_APIDDSC_POPTS_M_SWAP, and _CCSDS_apidDsc::popts.
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().
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.
dsc | The APID descriptor |
References _CCSDS_apidDsc::seq.
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.
dsc | The APID descriptor | |
seq | The new sequence number. This should be only a maximum of 14 bits. |
References _CCSDS_apidDsc::seq.
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().