GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EMP / V1-4-1 > asc / rhel5-32
Classes | |
struct | _LSD_sdiWriteCbp |
Binds the routine to write an ITC queue item with its context parameter. More... | |
Typedefs | |
typedef struct _LSD_sdi | LSD_sdi |
Typedef for struct _LSD_sdi. | |
typedef struct _LSD_sdiPds | LSD_sdiPds |
Typedef for the LSD_sdi Packet Descriptor Structure. | |
typedef struct _LSF_datagram | LSF_datagram |
typedef unsigned int(* | LSD_sdiWriteRtn )(void *prm, LSD_sdiPds *pds) |
Function to post a completed packet to the SDI. | |
typedef struct _LSD_sdiWriteCbp | LSD_sdiWriteCbp |
Typedef for struct _LSD_sdiWriteCbp. | |
Functions | |
unsigned int | LSD_sdiSizeof (void) |
Returns the size, in bytes of LSD_sdi context handle. | |
unsigned int | LSD_sdiConstruct (LSD_sdi *sdi, int apid, int ringSize, int ringOverflow, LSD_sdiWriteRtn writeRtn, void *writePrm) |
Creates an instance of an LSD_sdi stream. | |
LSD_sdiPds * | LSD_sdiGetW (LSD_sdi *sdi, int dgmSize, unsigned int ts_secs, unsigned int ts_usecs) |
Allocate and fill a packet for SDI, except for payload. | |
unsigned int | LSD_sdiShrink (LSD_sdi *sdi, LSD_sdiPds *pds, int shinkSize) |
Shrink the allocation of the created packet for changes in the payload length. | |
void | LSD_sdiDestruct (LSD_sdi *sdi) |
Destroy the SDI context. | |
unsigned int | LSD_sdiSend (LSD_sdi *sdi, LSD_sdiPds *pds) |
Send out filled-in packet to the SDI. | |
unsigned int | LSD_sdiWrite (void *prm, LSD_sdiPds *pds) |
Default routine to send completed queue item to the ITC queue. | |
unsigned int | LSD_sdiPdsLenGet (LSD_sdiPds *pds) |
Access function to return the length, in bytes, of the packet This includes the CCSDS header. | |
void * | LSD_sdiPdsCcsdsGet (LSD_sdiPds *pds) |
Access function to return a pointer to CCSDS header. | |
LSF_datagram * | LSD_sdiPdsDgmGet (LSD_sdiPds *pds) |
Access function to return a pointer to LSF datagram header. |
CVS $Id: LSD_sdi.h,v 1.2 2007/10/12 23:14:09 russell Exp $
unsigned int(* LSD_sdiWriteRtn)(void *prm, LSD_sdiPds *pds) |
Function to post a completed packet to the SDI.
prm | User parameter | |
pds | The packet descriptor structure of the data to be written |
unsigned int LSD_sdiConstruct | ( | LSD_sdi * | sdi, | |
int | apid, | |||
int | ringSize, | |||
int | ringOverflow, | |||
LSD_sdiWriteRtn | writeRtn, | |||
void * | writePrm | |||
) |
Creates an instance of an LSD_sdi stream.
0,Success | ||
-1,Failed | to create the RBM ring buffer |
sdi | The LSD_sdi context handle to construct | |
apid | The CCSDS APID to associate with this stream. Due to the single threaded nature of the SDI, a stream can only control one APID at a time | |
ringSize | Size, in bytes, of the ring buffer to create | |
ringOverflow | Size, in bytes, of the amount to be reserved from ringSize as an overflow buffer. This must be less than ringSize. | |
writeRtn | The routine to perform the physical write. If NULL is specified, the default routine, LSD_sdiWrite is used. | |
writePrm | The parameter to pass to the write routine. This parameter is irrelevant if writeRtn is specified as NULL. |
References _LSD_sdi::apid, _LSD_sdi::ccsdsHdrSize, LSD_sdiWrite(), _LSD_sdi::pool, _LSD_sdiWriteCbp::prm, _LSD_sdi::qitemHdrSize, RND_TO, _LSD_sdiWriteCbp::rtn, sdiRingConstruct(), _LSD_sdi::semaphore, and _LSD_sdi::write.
Referenced by AscEdsConstruct().
void LSD_sdiDestruct | ( | LSD_sdi * | sdi | ) |
Destroy the SDI context.
sdi | The LSD SDI context handle to destroy |
References _LSD_sdi::pool, and _LSD_sdi::semaphore.
Referenced by AscEdsDestruct().
LSD_sdiPds * LSD_sdiGetW | ( | LSD_sdi * | sdi, | |
int | dgmSize, | |||
unsigned int | ts_secs, | |||
unsigned int | ts_usecs | |||
) |
Allocate and fill a packet for SDI, except for payload.
sdi | The LSD SDI context handler | |
dgmSize | Size of the datagram (including any headers) | |
ts_secs | The seconds part of the timestamp to associate with this datagram | |
ts_usecs | The useconds part of the timestamp to associate with this datagram |
The only 2 failure modes, allocation failure and unable to format the CCSDS header are both likely due a memory corruption. Recovery is unlikely. The correct response should likely be to bugcheck.
References _LSD_sdi::apid, _LSD_sdi::ccsdsHdrSize, _LSD_sdi::pool, _LSD_sdi::qitemHdrSize, and RBM_PRINT.
Referenced by output().
void * LSD_sdiPdsCcsdsGet | ( | LSD_sdiPds * | pds | ) |
Access function to return a pointer to CCSDS header.
pds | The packet descriptor |
void * LSD_sdiPdsDgmGet | ( | LSD_sdiPds * | pds | ) |
Access function to return a pointer to LSF datagram header.
pds | The packet descriptor |
Referenced by output().
unsigned int LSD_sdiPdsLenGet | ( | LSD_sdiPds * | pds | ) |
Access function to return the length, in bytes, of the packet This includes the CCSDS header.
pds | The packet descriptor |
unsigned int LSD_sdiSend | ( | LSD_sdi * | sdi, | |
LSD_sdiPds * | pds | |||
) |
Send out filled-in packet to the SDI.
sdi | The LSD SDI context handler | |
pds | The packet descriptor structure |
References _LSD_sdi::ccsdsHdrSize, _LSD_sdiWriteCbp::prm, _LSD_sdiWriteCbp::rtn, sdiDone(), and _LSD_sdi::write.
Referenced by output().
unsigned int LSD_sdiShrink | ( | LSD_sdi * | sdi, | |
LSD_sdiPds * | pds, | |||
int | shrinkSize | |||
) |
Shrink the allocation of the created packet for changes in the payload length.
sdi | The LSD SDI context handler | |
pds | The packet descriptor structure | |
shrinkSize | The amount, in bytes, to shrink |
References _LSD_sdi::pool, and RBM_PRINT.
Referenced by output().
unsigned int LSD_sdiSizeof | ( | void | ) |
Returns the size, in bytes of LSD_sdi context handle.
Referenced by AscEdsConstruct().
static unsigned int LSD_sdiWrite | ( | void * | prm, | |
LSD_sdiPds * | pds | |||
) |
Default routine to send completed queue item to the ITC queue.
prm | User context parameter | |
pds | The packet descriptor |
Referenced by LSD_sdiConstruct().