GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRB / dev > grb_doc / rhel5-32
#include <PBI/Endianness.h>
#include <PBI/BSWP.ih>
#include <GRB/GRB_msgdef.h>
Classes | |
struct | _GRB_pktHdr |
The packet header. More... | |
Typedefs | |
typedef enum _GRB_PKT_OPEN_REASON | GRB_PKT_OPEN_REASON |
Typedef for enum _GRB_PKT_OPEN_REASON. | |
typedef enum _GRB_PKT_OPEN_REASON | GRB_pktOpenReason |
Typedef for enum _GRB_PKT_OPEN_REASON. | |
typedef enum _GRB_PKT_CLOSE_REASON | GRB_PKT_CLOSE_REASON |
Typedef for enum _GRB_PKT_CLOSE_REASON. | |
typedef enum _GRB_PKT_CLOSE_REASON | GRB_pktCloseReason |
Typedef for enum _GRB_PKT_CLOSE_REASON. | |
typedef struct _GRB_pktHdr | GRB_pktHdr |
Typedef for struct _GRB_pktHdr. | |
Enumerations | |
enum | _GRB_PKT_OPEN_REASON { GRB_PKT_OPEN_REASON_START = 0x0, GRB_PKT_OPEN_REASON_TIME = 0x1, GRB_PKT_OPEN_REASON_COUNT = 0x2, GRB_PKT_OPEN_REASON_FULL = 0x3 } |
These are the open reasons for a GRB_pkt. More... | |
enum | _GRB_PKT_CLOSE_REASON { GRB_PKT_CLOSE_REASON_STOP = 0x0, GRB_PKT_CLOSE_REASON_TIME = 0x1, GRB_PKT_CLOSE_REASON_COUNT = 0x2, GRB_PKT_CLOSE_REASON_FULL = 0x3 } |
These are the close reasons for a GRB_pkt. More... | |
Functions | |
static __inline void | GRB__pktConstruct (GRB_pktHdr *hdr, unsigned char src, GRB_pktOpenReason reason, unsigned int seq) |
Constructs a packet header. | |
static __inline void | GRB__pktConstructNext (GRB_pktHdr *hdr, GRB_pktOpenReason reason) |
Constructs the next packet header. This is just a short-hand routine that can be used when constructing subsequent packets. It presumes that GRBP__pktConstruct has already been called, thus establishing the source and sequence values. This routine retains the source field and increments the sequence field. | |
static __inline int | GRB__pktMsgDeclare (GRB_pktHdr *hdr, unsigned int len32) |
Declares that a new message of length len32 has been added to packet. | |
static __inline void | GRB__pktClose (GRB_pktHdr *hdr, GRB_pktCloseReason reason) |
Declares that a packet is closed. | |
static __inline void | GRB__pktHdrSwap (GRB_pktHdr *dst, const GRB_pktHdr *hdr) |
Ensures the packet header is in big-endian style. | |
static __inline unsigned int | GRB__pktLength (const GRB_pktHdr *hdr) |
Accessor function to return the length in 32-bit words. | |
static __inline unsigned int | GRB__pktSequence (const GRB_pktHdr *hdr) |
Accessor function to return the packet's sequence number. This is primarily used as an integrity check, ensuring that all packets from a given source ID have been seen. | |
static __inline unsigned short int | GRB__pktMsgCount (const GRB_pktHdr *hdr) |
Accessor function to return the number of messages in the packet. | |
static __inline unsigned char | GRB__pktSource (const GRB_pktHdr *hdr) |
Accessor function to return the source CPU identifier. | |
static __inline GRB_pktOpenReason | GRB__pktOpenReason (const GRB_pktHdr *hdr) |
Accessor function to return the packet's open reason. | |
static __inline GRB_pktCloseReason | GRB__pktCloseReason (const GRB_pktHdr *hdr) |
Accessor function to return the packet's close reason. | |
static __inline GRB_msgHdr * | GRB__pktFirstMsg (const GRB_pktHdr *hdr) |
Accessor function to return the packet's first message. | |
static __inline GRB_pktHdr * | GRB__pktNext (const GRB_pktHdr *hdr) |
Returns a pointer to the next packet. | |
static __inline GRB_pktHdr * | GRB__pktAdvance (const GRB_pktHdr *hdr, unsigned int len32) |
Advances the packet header pointer by the specified number of 32-bit words. This is function can be used instead of GRB__pktNext when the length of the packet has already been extracted or when advancing by more than 1 packet. It is assumed the len32 came from adding one or more packet lengths. If not, there is no guarantee that what is returned has anything to do with a packet header. |
CVS $Id: GRB_pktdef.h,v 1.6 2011/03/25 23:20:51 apw Exp $
Typedef for struct _GRB_pktHdr.
These are the close reasons for a GRB_pkt.
enum _GRB_PKT_OPEN_REASON |
These are the open reasons for a GRB_pkt.
static __inline GRB_pktHdr * GRB__pktAdvance | ( | const GRB_pktHdr * | hdr, | |
unsigned int | len32 | |||
) | [static] |
Advances the packet header pointer by the specified number of 32-bit words. This is function can be used instead of GRB__pktNext when the length of the packet has already been extracted or when advancing by more than 1 packet. It is assumed the len32 came from adding one or more packet lengths. If not, there is no guarantee that what is returned has anything to do with a packet header.
hdr | The packet header | |
len32 | The number of 32-bit words to advance header by |
static __inline void GRB__pktClose | ( | GRB_pktHdr * | hdr, | |
GRB_pktCloseReason | reason | |||
) | [static] |
Declares that a packet is closed.
hdr | The packet header | |
reason | The packet close reason of type GRB_PKT_CLOSE_REASON |
static __inline GRB_pktCloseReason GRB__pktCloseReason | ( | const GRB_pktHdr * | hdr | ) | [static] |
Accessor function to return the packet's close reason.
hdr | The packet header to extract the packet's close reason |
static __inline void GRB__pktConstruct | ( | GRB_pktHdr * | hdr, | |
unsigned char | src, | |||
GRB_pktOpenReason | reason, | |||
unsigned int | seq | |||
) | [static] |
Constructs a packet header.
hdr | The packet header to construct | |
src | The data source, usually something denoting EPU0/EPU1/EPU2 | |
reason | The packet open reason | |
seq | The sequence number to assign this packet |
References _GRB_pktHdr::len32, _GRB_pktHdr::rsvd_1, and _GRB_pktHdr::seq.
static __inline void GRB__pktConstructNext | ( | GRB_pktHdr * | hdr, | |
GRB_pktOpenReason | reason | |||
) | [static] |
Constructs the next packet header. This is just a short-hand routine that can be used when constructing subsequent packets. It presumes that GRBP__pktConstruct has already been called, thus establishing the source and sequence values. This routine retains the source field and increments the sequence field.
hdr | The packet header to construct | |
reason | The packet open reason |
References _GRB_pktHdr::len32, and _GRB_pktHdr::seq.
static __inline GRB_msgHdr * GRB__pktFirstMsg | ( | const GRB_pktHdr * | hdr | ) | [static] |
Accessor function to return the packet's first message.
hdr | The packet header to extract the first message |
static __inline void GRB__pktHdrSwap | ( | GRB_pktHdr * | dst, | |
const GRB_pktHdr * | hdr | |||
) | [static] |
Ensures the packet header is in big-endian style.
dst | The swapped packet header | |
hdr | The packet header to swap |
static __inline unsigned int GRB__pktLength | ( | const GRB_pktHdr * | hdr | ) | [static] |
Accessor function to return the length in 32-bit words.
hdr | The packet header to extract the length from |
References _GRB_pktHdr::len32.
static __inline unsigned short int GRB__pktMsgCount | ( | const GRB_pktHdr * | hdr | ) | [static] |
Accessor function to return the number of messages in the packet.
hdr | The packet header to extract the message count |
static __inline int GRB__pktMsgDeclare | ( | GRB_pktHdr * | hdr, | |
unsigned int | len32 | |||
) | [static] |
Declares that a new message of length len32 has been added to packet.
hdr | The packet header | |
len32 | The length, in 32-bit words, of the message |
References _GRB_pktHdr::len32.
static __inline GRB_pktHdr * GRB__pktNext | ( | const GRB_pktHdr * | hdr | ) | [static] |
Returns a pointer to the next packet.
hdr | The packet header |
References _GRB_pktHdr::len32.
static __inline GRB_pktOpenReason GRB__pktOpenReason | ( | const GRB_pktHdr * | hdr | ) | [static] |
Accessor function to return the packet's open reason.
hdr | The packet header to extract the packet's open reason |
static __inline unsigned int GRB__pktSequence | ( | const GRB_pktHdr * | hdr | ) | [static] |
Accessor function to return the packet's sequence number. This is primarily used as an integrity check, ensuring that all packets from a given source ID have been seen.
hdr | The packet header to extract the packet's sequence number |
References _GRB_pktHdr::seq.
static __inline unsigned char GRB__pktSource | ( | const GRB_pktHdr * | hdr | ) | [static] |
Accessor function to return the source CPU identifier.
hdr | The packet header to extract the source identifier |