GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-1-0 > lsew / linux-gcc
#include <LSF/LSF_cpu.h>
#include <LSF/LSF_mode.h>
#include <LSF/LSF_origin.h>
Classes | |
struct | _LSEW_dgmBuf |
Structure giving the defining pointers of the current buffer. More... | |
Typedefs | |
typedef struct _LSEW_dgmBuf | LSEW_dgmBuf |
Typedef for LSEW_dgmBuf. | |
Functions | |
unsigned int | LSEW_dgmSizeof (void) |
The size, in bytes, of the control structure. | |
unsigned int | LSEW_dgmInit (LSEW_dgm *dgm, unsigned short int apid, unsigned int dgm_id, LSF_CPU_K cpu, LSF_ORIGIN_K origin) |
Initializes the control structure. | |
int | LSEW_dgmBufSet (LSEW_dgm *dgm, unsigned int *buf, int buf_size) |
Sets the specified buffer as the new output buffer. | |
unsigned int * | LSEW_dgmOpen (LSEW_dgm *dgm, unsigned int reason, unsigned int evt_seq, const EBF_gem *gem) |
Opens a new event datagram. | |
void | LSEW_dgmRunStart (LSEW_dgm *dgm, unsigned int runId, unsigned int startTime, LSF_MODE_K mode) |
Sets the context for a new run. | |
void | LSEW_dgmModeChange (LSEW_dgm *dgm, LSF_MODE_K mode) |
Changes the current data-taking mode. | |
void | LSEW_dgmRootClose (LSEW_dgm *dgm, const unsigned int *end) |
unsigned int * | LSEW_dgmEvtOpen (LSEW_dgm *dgm, unsigned int *cur) |
Opens a new event datagram. | |
unsigned int * | LSEW_dgmEvtCommit (LSEW_dgm *dgm, unsigned int *cur) |
Commits this event. This does two things, updates the current write pointer and increments the number of events in this contribution. | |
unsigned int * | LSEW_dgmEvtClose (LSEW_dgm *dgm) |
Completes the final processing of an event just before it is presented to the output stream. | |
unsigned int * | LSEW_dgmUpdate (LSEW_dgm *dgm, unsigned int evt_seq, const EBF_gem *gem) |
Updates the current datagram, adding a time record if necessary. | |
unsigned int * | LSEW_dgmClose (LSEW_dgm *dgm, unsigned int *cur, unsigned int reason) |
Closes out the datagram; it is now ready to be written out. | |
unsigned int * | LSEW_dgmCommit (LSEW_dgm *dgm, unsigned int *cur) |
Commits the current write by updating the write potnter. | |
unsigned int * | LSEW_dgmBeg (const LSEW_dgm *dgm) |
Returns the value of the beginning of the specified event datagram. | |
unsigned int * | LSEW_dgmCur (const LSEW_dgm *dgm) |
Returns the value of the beginning of the specified event datagram. | |
unsigned int * | LSEW_dgmEnd (const LSEW_dgm *dgm) |
Returns the value of the end of the specified event datagram. | |
unsigned int | LSEW_dgmLeft32 (const LSEW_dgm *dgm) |
Returns the number of 32 words left in the buffer. | |
const LSEW_ctxPub * | LSEW_dgmCtxPub (const LSEW_dgm *dgm) |
Returns a pointer to the public context structure. | |
static __inline unsigned int * | LSEW__dgmBeg (const LSEW_dgm *dgm) |
Returns the value of the beginning of the specified event datagram. | |
static __inline unsigned int * | LSEW__dgmCur (const LSEW_dgm *dgm) |
Returns the value of the beginning of the specified event datagram. | |
static __inline unsigned int * | LSEW__dgmEnd (const LSEW_dgm *dgm) |
Returns the value of the end of the specified event datagram. | |
static __inline unsigned int | LSEW__dgmLeft32 (const LSEW_dgm *dgm) |
Returns the number of 32 words left in the buffer. |
CVS $Id: LSEW_dgm.h,v 1.10 2011/03/26 17:35:23 russell Exp $
Typedef for LSEW_dgmBuf.
static unsigned int * LSEW__dgmBeg | ( | const LSEW_dgm * | dgm | ) | [static] |
Returns the value of the beginning of the specified event datagram.
dgm | The event datagram to query |
Referenced by datagram_close(), LSEW_dgmFwEvtAdd(), and LSEW_dgmFwFlush().
static __inline unsigned int * LSEW__dgmCur | ( | const LSEW_dgm * | dgm | ) | [static] |
Returns the value of the beginning of the specified event datagram.
dgm | The event datagram to query |
Referenced by LSEW_dgmFwEvtAdd(), and LSEW_dgmFwFlush().
static __inline unsigned int * LSEW__dgmEnd | ( | const LSEW_dgm * | dgm | ) | [static] |
Returns the value of the end of the specified event datagram.
dgm | The event datagram to query |
Referenced by datagram_close(), datagram_open(), datagram_retry(), LSEW_dgmFwEvtAdd(), and LSEW_dgmFwUsrAdd().
static __inline unsigned int LSEW__dgmLeft32 | ( | const LSEW_dgm * | dgm | ) | [static] |
Returns the number of 32 words left in the buffer.
dgm | The event datagram to query |
unsigned int * LSEW_dgmBeg | ( | const LSEW_dgm * | dgm | ) |
Returns the value of the beginning of the specified event datagram.
dgm | The event datagram to query |
References _LSEW_dgmBuf::beg, and _LSEW_dgm::buf.
int LSEW_dgmBufSet | ( | LSEW_dgm * | dgm, | |
unsigned int * | buf, | |||
int | buf_size | |||
) |
Sets the specified buffer as the new output buffer.
dgm | The output control block | |
buf | The new buffer | |
buf_size | The size, in bytes, of the new buffer |
References _LSEW_dgmBuf::beg, _LSEW_dgm::buf, _LSEW_dgmBuf::cur, _LSEW_dgm::dat, _LSEW_dgmBuf::end, _LSEW_dgm::hdr_size, _LSEW_dgm::lsf, and _LSEW_dgm::nevts.
Referenced by datagram_close(), and LSEW_dgmFwBufSet().
unsigned int * LSEW_dgmClose | ( | LSEW_dgm * | dgm, | |
unsigned int * | cur, | |||
unsigned int | reason | |||
) |
Closes out the datagram; it is now ready to be written out.
dgm | The event datagram to close | |
cur | The next write pointer, unless NULL, then it is ignored | |
reason | One of an enumeration describing why this event datagram is being closed. |
References _LSEW_dgm::apid, _LSEW_dgmBuf::beg, _LSEW_dgm::buf, ccsds_complete(), _LSEW_dgm::ccsds_seq, _LSEW_dgm::ctx, _LSEW_dgmBuf::cur, _LSEW_dgm::dat, datagram_close(), _LSEW_dgm::dgm_id, _LSEW_dgmBuf::end, _LSEW_dgm::evt, LSEW_ctxCloseAdd(), _LSEW_dgm::lsf, and _LSEW_dgm::nevts.
Referenced by datagram_close().
unsigned int * LSEW_dgmCommit | ( | LSEW_dgm * | dgm, | |
unsigned int * | cur | |||
) |
Commits the current write by updating the write potnter.
dgm | The output control block | |
cur | The current write pointer. |
References _LSEW_dgm::buf, _LSEW_dgmBuf::cur, and RND_UP.
Referenced by LSEW_dgmFwUsrAdd().
const LSEW_ctxPub * LSEW_dgmCtxPub | ( | const LSEW_dgm * | dgm | ) |
Returns a pointer to the public context structure.
dgm | The event datagram to query |
References _LSEW_dgm::ctx, and _LSEW_ctx::pub.
Referenced by LSEW_dgmFwCtxPub().
unsigned int * LSEW_dgmCur | ( | const LSEW_dgm * | dgm | ) |
Returns the value of the beginning of the specified event datagram.
dgm | The event datagram to query |
References _LSEW_dgm::buf, and _LSEW_dgmBuf::cur.
unsigned int * LSEW_dgmEnd | ( | const LSEW_dgm * | dgm | ) |
Returns the value of the end of the specified event datagram.
dgm | The event datagram to query |
References _LSEW_dgm::buf, and _LSEW_dgmBuf::end.
unsigned int * LSEW_dgmEvtClose | ( | LSEW_dgm * | dgm | ) |
Completes the final processing of an event just before it is presented to the output stream.
dgm | The datagram to close the event contribution |
References _LSEW_dgm::buf, _LSEW_dgmBuf::cur, _LSEW_dgm::evt, evt_close(), _LSEW_dgm::evt_id, and _LSEW_dgm::nevts.
Referenced by datagram_close(), and LSEW_dgmFwUsrAdd().
unsigned int * LSEW_dgmEvtCommit | ( | LSEW_dgm * | dgm, | |
unsigned int * | cur | |||
) |
Commits this event. This does two things, updates the current write pointer and increments the number of events in this contribution.
dgm | The output control block | |
cur | The current write pointer, if NULL, then the internal value of the write pointer is used. |
References _LSEW_dgm::buf, _LSEW_dgmBuf::cur, _LSEW_dgm::nevts, and RND_UP.
Referenced by LSEW_dgmFwEvtAdd().
unsigned int * LSEW_dgmEvtOpen | ( | LSEW_dgm * | dgm, | |
unsigned int * | cur | |||
) |
Opens a new event datagram.
dgm | The output control block | |
cur | The current write pointer, if NULL, then the internal value of the write pointer is used. |
References _LSEW_dgm::buf, _LSEW_dgmBuf::cur, _LSEW_dgm::evt, evt_open(), and _LSEW_dgm::nevts.
Referenced by datagram_open().
unsigned int LSEW_dgmInit | ( | LSEW_dgm * | dgm, | |
unsigned short int | apid, | |||
unsigned int | dgm_id, | |||
LSF_CPU_K | cpu, | |||
LSF_ORIGIN_K | origin | |||
) |
Initializes the control structure.
dgm | The output control structure to initialize | |
apid | The application id to use in the CCSDS packets | |
dgm_id | The LAT Science Format Data Id (LSF) to use | |
cpu | The CPU identifier | |
origin | The originating data source (ie LAT, GLEAM, etc) |
References _LSEW_dgm::apid, _LSEW_dgm::ccsds_seq, _LSEW_dgm::ctx, _LSEW_dgm::dgm_id, _LSEW_dgm::evt_id, _LSEW_dgm::hdr_size, LSE_ID_EVT_VERSION_K_2, LSE_ID_K_EVT, and LSEW_ctxInit().
Referenced by LSEW_dgmFwInit().
unsigned int LSEW_dgmLeft32 | ( | const LSEW_dgm * | dgm | ) |
Returns the number of 32 words left in the buffer.
dgm | The event datagram to query |
void LSEW_dgmModeChange | ( | LSEW_dgm * | dgm, | |
LSF_MODE_K | mode | |||
) |
Changes the current data-taking mode.
dgm | The destination event datagram context | |
mode | The new data-taking mode |
References _LSEW_dgm::ctx, and LSEW_ctxModeChange().
Referenced by LSEW_dgmFwModeChange().
unsigned int * LSEW_dgmOpen | ( | LSEW_dgm * | dgm, | |
unsigned int | reason, | |||
unsigned int | evt_seq, | |||
const EBF_gem * | gem | |||
) |
Opens a new event datagram.
dgm | The output control block | |
reason | One of an enumeration describing why this event datagram is being opened | |
evt_seq | The event sequence number | |
gem | The GEM contributor |
References _LSEW_dgm::buf, _LSEW_dgm::ctx, _LSEW_dgmBuf::end, LSEW_ctxOpenAdd(), and _LSEW_dgm::lsf.
Referenced by datagram_open().
void LSEW_dgmRootClose | ( | LSEW_dgm * | dgm, | |
const unsigned int * | end | |||
) |
dgm | The output control block | |
end | Pointer to the end of the root contribution |
References _LSEW_dgm::lsf.
Referenced by datagram_open().
void LSEW_dgmRunStart | ( | LSEW_dgm * | dgm, | |
unsigned int | runId, | |||
unsigned int | startTime, | |||
LSF_MODE_K | mode | |||
) |
Sets the context for a new run.
dgm | The event datagram control handle | |
runId | The run identifier | |
startTime | The run start time to the nearest second | |
mode | The running mode |
References _LSEW_dgm::ctx, and LSEW_ctxRunStart().
Referenced by LSEW_dgmFwRunStart().
unsigned int * LSEW_dgmUpdate | ( | LSEW_dgm * | dgm, | |
unsigned int | evt_seq, | |||
const EBF_gem * | gem | |||
) |
Updates the current datagram, adding a time record if necessary.
dgm | The output control block | |
evt_seq | The event sequence number | |
gem | The GEM contributor |
References _LSEW_dgm::buf, _LSEW_dgm::ctx, _LSEW_dgmBuf::cur, _LSEW_dgmBuf::end, _LSEW_dgm::evt, evt_close(), _LSEW_dgm::evt_id, evt_open(), evt_size(), LSEW_ctxUpdateAdd(), MAXIMUM_EVENTS_PER_CONTRIBUTION, and _LSEW_dgm::nevts.
Referenced by LSEW_dgmFwEvtAdd().