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>
#include <LSF/LSF_reason.h>
Classes | |
struct | _LSEW_dgmFwBegAddCbp |
Binds the routine to add a Begin Context Contribution routine (the callback) with its context parameter. More... | |
struct | _LSEW_dgmFwEvtAddCbp |
Binds the routine to add an event (the callback) with its parameter. More... | |
struct | _LSEW_dgmFwUsrAddCbp |
Binds the routine to add an User Context Contribution routine (the callback) with its context parameter. More... | |
struct | _LSEW_dgmFwEndAddCbp |
Binds the routine to add an End Context Contribution routine (the callback) with its context parameter. More... | |
struct | _LSEW_dgmFwPostCbp |
Binds the routine to add an datagram posting routine (the callback) with its context parameter. More... | |
struct | _LSEW_dgmFwNotifyCbp |
Binds the routine to notify a datagram of a change in configuration with with its context parameter. More... | |
Typedefs | |
typedef unsigned int *(* | LSEW_dgmFwBegAdder )(void *prm, unsigned int *buf, unsigned int len32) |
Callback signature for the routine to add a Begin Context Contribtution the event datagram. | |
typedef struct _LSEW_dgmFwBegAddCbp | LSEW_dgmFwBegAddCbp |
Typedef for struct _LSEW_dgmFwBegAddCbp. | |
typedef unsigned int *(* | LSEW_dgmFwEvtAdder )(void *prm, void *evt, unsigned int *buf, unsigned int len32) |
Callback signature for an adding an event to the event datagram or, more specifically to the current Event Contribution record. | |
typedef struct _LSEW_dgmFwEvtAddCbp | LSEW_dgmFwEvtAddCbp |
Typedef for struct _LSEW_dgmFwAddCbp. | |
typedef unsigned int *(* | LSEW_dgmFwUsrAdder )(void *prm, void *usrInfo, int usrLen, unsigned int *buf, unsigned int len32) |
Callback signature for the routine to add an User Context Contribution at an arbitrary point in the event datagram. | |
typedef struct _LSEW_dgmFwUsrAddCbp | LSEW_dgmFwUsrAddCbp |
Typedef for struct _LSEW_dgmFwUsrAddCbp. | |
typedef unsigned int *(* | LSEW_dgmFwEndAdder )(void *prm, unsigned int *buf, unsigned int len32) |
Callback signature for the routine to add an End Context Contribution the event datagram. | |
typedef struct _LSEW_dgmFwEndAddCbp | LSEW_dgmFwEndAddCbp |
Typedef for struct _LSEW_dgmFwEndAddCbp. | |
typedef unsigned int *(* | LSEW_dgmFwPoster )(void *prm, void *buf, int bytes) |
Callback signature to post a buffer. | |
typedef struct _LSEW_dgmFwPostCbp | LSEW_dgmFwPostCbp |
Typedef for struct _LSEW_dgmFwPostCbp. | |
typedef unsigned int *(* | LSEW_dgmFwNotifier )(void *prm, unsigned int active, const unsigned char cfgs[32]) |
Callback signature to notify the datagram of the current configuration. | |
typedef struct _LSEW_dgmFwNotifyCbp | LSEW_dgmFwNotifyCbp |
Typedef for struct _LSEW_dgmFwNotifyCbp. | |
Functions | |
unsigned int | LSEW_dgmFwSizeof (void) |
The size, in bytes, of the control structure. | |
unsigned int | LSEW_dgmFwInit (LSEW_dgmFw *dgmFw, unsigned short int apid, unsigned int dgm_id, LSF_CPU_K cpu, LSF_ORIGIN_K origin) |
Initializes the control structure. | |
void | LSEW_dgmFwBufSet (LSEW_dgmFw *dgmFw, unsigned int *buf, int buf_size) |
Sets the buffer to be used for the event datagram and its size. | |
void | LSEW_dgmFwRunStart (LSEW_dgmFw *dgmFw, unsigned int runId, unsigned int startTime, LSF_MODE_K mode, LSF_REASON_OPEN_K reason) |
Sets the context for a new run. | |
void | LSEW_dgmFwModeChange (LSEW_dgmFw *dgmFw, LSF_MODE_K mode) |
Changes the current data-taking mode. | |
LSEW_dgmFwBegAddCbp | LSEW_dgmFwBegAddSet (LSEW_dgmFw *dgmFw, LSEW_dgmFwBegAdder begRtn, void *begPrm) |
Sets the callback to add a user specified Begin Context Contribution record. | |
LSEW_dgmFwEvtAddCbp | LSEW_dgmFwEvtAddSet (LSEW_dgmFw *dgmFw, LSEW_dgmFwEvtAdder evtRtn, void *evtPrm) |
Sets the callback to add an event to the event datagram. | |
LSEW_dgmFwUsrAddCbp | LSEW_dgmFwUsrAddSet (LSEW_dgmFw *dgmFw, LSEW_dgmFwUsrAdder usrRtn, void *usrPrm) |
Sets the callback to add an event to the event datagram. | |
LSEW_dgmFwEndAddCbp | LSEW_dgmFwEndAddSet (LSEW_dgmFw *dgmFw, LSEW_dgmFwEndAdder endRtn, void *endPrm) |
Sets the callback to add a user specified End Context Contribution record. | |
LSEW_dgmFwPostCbp | LSEW_dgmFwPostSet (LSEW_dgmFw *dgmFw, LSEW_dgmFwPoster postRtn, void *postPrm) |
Sets the callback to add a user specified End Context Contribution record. | |
unsigned int | LSEW_dgmFwEvtAdd (LSEW_dgmFw *dgmFw, void *evt, unsigned int evt_seq, const EBF_gem *gem) |
Formats the specified event, flushing the current event datagram if the event datagram is full. | |
unsigned int | LSEW_dgmFwUsrAdd (LSEW_dgmFw *dgmFw, void *usrInfo, int usrLen) |
Formats the specified event, flushing the current event datagram if the event datagram is full. | |
unsigned int | LSEW_dgmFwFlush (LSEW_dgmFw *dgmFw, int reason) |
Flushes the last events out. | |
unsigned int | LSEW_dgmFwNotify (LSEW_dgmFw *dgmFw, unsigned int active, const unsigned char cfgs[32]) |
unsigned int | LSEW_dgmFwLeft32 (LSEW_dgmFw *dgmFw) |
Returns the number of 32 words left in the datagram. | |
const LSEW_ctxPub * | LSEW_dgmFwCtxPub (const LSEW_dgmFw *dgmFw) |
Returns a pointer to the public portion of the standard context. |
CVS $Id: LSEW_dgmFw.h,v 1.12 2011/03/26 17:35:23 russell Exp $
unsigned int *(* LSEW_dgmFwBegAdder)(void *prm, unsigned int *buf, unsigned int len32) |
Callback signature for the routine to add a Begin Context Contribtution the event datagram.
prm | Static user provided parameter | |
buf | The buffer to accept the Begin Contribution data | |
len32 | The number of 32-bit words available in buf. If the information does not fit in this space, return NULL. |
unsigned int *(* LSEW_dgmFwEndAdder)(void *prm, unsigned int *buf, unsigned int len32) |
Callback signature for the routine to add an End Context Contribution the event datagram.
prm | Static user provided parameter | |
buf | The buffer to accept the End Contribution data. | |
len32 | The number of 32-bit words available in buf. If the information does not fit in this space, return NULL. |
unsigned int *(* LSEW_dgmFwEvtAdder)(void *prm, void *evt, unsigned int *buf, unsigned int len32) |
Callback signature for an adding an event to the event datagram or, more specifically to the current Event Contribution record.
prm | Static user provided parameter | |
evt | Dynamic user provided parameter, usually a pointer some representation of the event data. | |
buf | The buffer to accept the Event Record data | |
len32 | The number of 32-bit words available in buf. If the information does not fit in this space, return NULL. |
int(* LSEW_dgmFwNotifier)(void *prm, unsigned int active, const unsigned char cfgs[32]) |
Callback signature to notify the datagram of the current configuration.
prm | Arbitrary user context parameter | |
active | The bit list of active handlers | |
cfgs | The array of configuration ids; |
unsigned int *(* LSEW_dgmFwPoster)(void *prm, void *buf, int nbytes) |
Callback signature to post a buffer.
prm | Arbitrary user context parameter | |
buf | The buffer to post | |
nbytes | The number of bytes in the buffer |
unsigned int *(* LSEW_dgmFwUsrAdder)(void *prm, void *usrInfo, int usrLen, unsigned int *buf, unsigned int len32) |
Callback signature for the routine to add an User Context Contribution at an arbitrary point in the event datagram.
prm | Static user provided parameter | |
usrInfo | Pointer to the information (or some representation of the information) to be written | |
usrLen | Can be interpretted as the length of the information or can be used as an arbitrary 32-bit piece of information, i.e. it is just passed as is through to the user routine. | |
buf | The buffer to accept the User Contribution data | |
len32 | The number of 32-bit words available in buf. If the information does not fit in this space, return NULL. |
LSEW_dgmFwBegAddCbp LSEW_dgmFwBegAddSet | ( | LSEW_dgmFw * | dgmFw, | |
LSEW_dgmFwBegAdder | begRtn, | |||
void * | begPrm | |||
) |
Sets the callback to add a user specified Begin Context Contribution record.
dgmFw | The framework control block to initialize | |
begRtn | The begin context contribution add routine | |
begPrm | The begin context contribution add routine's user parameter |
References _LSEW_dgmFw::beg_add, _LSEW_dgmFwBegAddCbp::prm, and _LSEW_dgmFwBegAddCbp::rtn.
void LSEW_dgmFwBufSet | ( | LSEW_dgmFw * | dgmFw, | |
unsigned int * | buf, | |||
int | bufSize | |||
) |
Sets the buffer to be used for the event datagram and its size.
dgmFw | The target framework control block | |
buf | The first, preallocated buffer to fill | |
bufSize | The size, in bytes, of the ouptut buffer. Events will be packed into this buffer until full |
References _LSEW_dgmFw::buf_size, locate(), and LSEW_dgmBufSet().
const LSEW_ctxPub* LSEW_dgmFwCtxPub | ( | const LSEW_dgmFw * | dgmFw | ) |
Returns a pointer to the public portion of the standard context.
dgmFw | The framework's control block |
References locate(), and LSEW_dgmCtxPub().
Referenced by CDF_gem_construct().
LSEW_dgmFwEndAddCbp LSEW_dgmFwEndAddSet | ( | LSEW_dgmFw * | dgmFw, | |
LSEW_dgmFwEndAdder | endRtn, | |||
void * | endPrm | |||
) |
Sets the callback to add a user specified End Context Contribution record.
dgmFw | The target framework control block | |
endRtn | The end context contribution add routine | |
endPrm | The end context contribution add routine's context parameter |
References _LSEW_dgmFw::end_add, _LSEW_dgmFwEndAddCbp::prm, and _LSEW_dgmFwEndAddCbp::rtn.
unsigned int LSEW_dgmFwEvtAdd | ( | LSEW_dgmFw * | dgmFw, | |
void * | evt, | |||
unsigned int | evt_seq, | |||
const EBF_gem * | gem | |||
) |
Formats the specified event, flushing the current event datagram if the event datagram is full.
0,Record | use succesfully added | |
-1,User | callback routine refused to add the event because not only did it not fit in the current datagram, it would not fit in a new datagram. Either the user accepts that the event is too big or he must change recompile with a larger datagram size. |
dgmFw | The framework's control block | |
evt | Dynamic (i.e. associated with this event) context parameter | |
evt_seq | The event sequence number | |
gem | The GEM contributor |
References datagram_open(), datagram_retry(), _LSEW_dgmFw::evt_add, locate(), LSEW__dgmBeg(), LSEW__dgmCur(), LSEW__dgmEnd(), LSEW_dgmEvtCommit(), LSEW_dgmUpdate(), _LSEW_dgmFw::open_reason, _LSEW_dgmFwEvtAddCbp::prm, and _LSEW_dgmFwEvtAddCbp::rtn.
LSEW_dgmFwEvtAddCbp LSEW_dgmFwEvtAddSet | ( | LSEW_dgmFw * | dgmFw, | |
LSEW_dgmFwEvtAdder | evtRtn, | |||
void * | evtPrm | |||
) |
Sets the callback to add an event to the event datagram.
dgmFw | The target framework control block | |
evtRtn | The event add routine | |
evtPrm | The event add routine's context parameter |
References _LSEW_dgmFw::evt_add, _LSEW_dgmFwEvtAddCbp::prm, and _LSEW_dgmFwEvtAddCbp::rtn.
unsigned int LSEW_dgmFwFlush | ( | LSEW_dgmFw * | dgmFw, | |
int | reason | |||
) |
Flushes the last events out.
dgmFw | The framework's control block | |
reason | The reason the flush is being called |
References datagram_close(), locate(), LSEW__dgmBeg(), and LSEW__dgmCur().
unsigned int LSEW_dgmFwInit | ( | LSEW_dgmFw * | dgmFw, | |
unsigned short int | apid, | |||
unsigned int | dgm_id, | |||
LSF_CPU_K | cpu, | |||
LSF_ORIGIN_K | origin | |||
) |
Initializes the control structure.
dgmFw | The framework control block 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 originating CPU | |
origin | The data source type |
References locate(), and LSEW_dgmInit().
unsigned int LSEW_dgmFwLeft32 | ( | LSEW_dgmFw * | dgmFw | ) |
Returns the number of 32 words left in the datagram.
dgmFw | The framework's control block |
References locate().
void LSEW_dgmFwModeChange | ( | LSEW_dgmFw * | dgmFw, | |
LSF_MODE_K | mode | |||
) |
Changes the current data-taking mode.
dgmFw | The destination event datagram framework handle | |
mode | The new data-taking mode |
References locate(), and LSEW_dgmModeChange().
LSEW_dgmFwPostCbp LSEW_dgmFwPostSet | ( | LSEW_dgmFw * | dgmFw, | |
LSEW_dgmFwPoster | postRtn, | |||
void * | postPrm | |||
) |
Sets the callback to add a user specified End Context Contribution record.
dgmFw | The target framework control block | |
postRtn | The post event datagram routine | |
postPrm | The post event datagram routine's context parameter |
References _LSEW_dgmFw::post, _LSEW_dgmFwPostCbp::prm, and _LSEW_dgmFwPostCbp::rtn.
void LSEW_dgmFwRunStart | ( | LSEW_dgmFw * | dgmFw, | |
unsigned int | runId, | |||
unsigned int | startTime, | |||
LSF_MODE_K | mode, | |||
LSF_REASON_OPEN_K | reason | |||
) |
Sets the context for a new run.
dgmFw | The framework's control block | |
runId | The run identifier | |
startTime | The start time to the nearest second | |
mode | The running mode | |
reason | The start reason |
References locate(), LSEW_dgmRunStart(), and _LSEW_dgmFw::open_reason.
unsigned int LSEW_dgmFwUsrAdd | ( | LSEW_dgmFw * | dgmFw, | |
void * | usrInfo, | |||
int | usrLen | |||
) |
Formats the specified event, flushing the current event datagram if the event datagram is full.
0,if | the user information was added | |
-1,if | the user information was not added because the datagram did not have enough room. In this case the likely strategy is to for the user to have an ADD BEGIN contribution add this information This will happen automatically when the new datagram is opened, ie when the next event is inserted. |
dgmFw | The framework's control block | |
usrInfo | A pointer to the user information | |
usrLen | Meant to be the length of the user information, but since it is passed transparently the callback routine that does the adding, it can be any 32-bit parameter you wish. |
References datagram_close(), locate(), LSEW__dgmEnd(), LSEW_dgmCommit(), LSEW_dgmEvtClose(), _LSEW_dgmFwUsrAddCbp::prm, _LSEW_dgmFwUsrAddCbp::rtn, and _LSEW_dgmFw::usr_add.
LSEW_dgmFwUsrAddCbp LSEW_dgmFwUsrAddSet | ( | LSEW_dgmFw * | dgmFw, | |
LSEW_dgmFwUsrAdder | usrRtn, | |||
void * | usrPrm | |||
) |
Sets the callback to add an event to the event datagram.
dgmFw | The target framework control block | |
usrRtn | The user contribution add routine | |
usrPrm | The user contribution add rotuines's context parameter |
References _LSEW_dgmFwUsrAddCbp::prm, _LSEW_dgmFwUsrAddCbp::rtn, and _LSEW_dgmFw::usr_add.