GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / V2-4-0 > qsedgm / sun-gcc
#include <QSE/QSE_dgmDvr.h>
#include <QSE/QSE_update.h>
#include <QSE/QSE_evt.h>
#include <QSE/QSE_dgmEventSkip.h>
#include <LSE/LSE_stdCtb.h>
#include <LSE/LSE_ids.h>
#include <LSF/LSF.h>
#include <LSF/LSF_scan.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Classes | |
struct | _QSE_dgmDvr |
Datagram context. More... | |
Typedefs | |
typedef struct _QSE_dgmDvr | QSE_dgmDvr |
struct _QSE_dgmDvr | |
Functions | |
static LSF_scanRecordHandler | evt_contribution_handler (QSE_dgmDvr *dvr, const LSF_contribution *ctb) |
Handles the specified contribution. | |
static unsigned int | evt_record_handler (QSE_dgmDvr *dvr, const LSF_record *rec) |
Handles the specified event record. | |
static unsigned int | handle_dgm_noop (void *stream, const LSF_datagram *dgm, void *qsex) |
Noop routine to handle a datatgram. This is used when no datagram handling routine was provided. | |
static unsigned int | handle_ctb_noop (void *stream, const LSF_contribution *ctb, void *qsex) |
Noop routine to handle a contribution. This is used when no contribution handling routine was provided. | |
static unsigned int | handle_rec_noop (void *stream, const LSF_record *rec, void *qsex) |
Noop routine to handle a record. This is used when no routine handling routine was provided. | |
static const unsigned int * | load_ptr (int **ptr, const unsigned int *cfg) |
Load a pointer from the configuration array. | |
unsigned int | QSE_dgmDvrSizeof (const unsigned int *cfg) |
Returns the size, in bytes of a QSE_dgmDvr structure. | |
QSE_dgmDvr * | QSE_dgmDvrConstruct (QSE_dgmDvr *dvr, const unsigned int *dvr_cfg, QSE_updateAtDatagram update_dgm, QSE_updateAtContribution update_ctb, QSE_updateAtRecord update_rec, void *update_ctx, QSE_dgmDvrDgm handle_dgm, QSE_dgmDvrCtb handle_ctb, QSE_dgmDvrRec handle_rec, void *handle_ctx) |
Constructs/initializes the datagram context control block. | |
int | QSE_dgmDvrProcess (QSE_dgmDvr *dvr, const LSF_datagram *dgms, int dgms_len) |
Convenience routine for the CCSDS_istreamProcess routine. | |
LSF_scanContributionHandler | QSE_dgmDvrDatagram (QSE_dgmDvr *dvr, const LSF_datagram *dgm) |
Handles each datagram. | |
void | QSE_dgmDvrDestruct (QSE_dgmDvr *dvr) |
Frees the QSE datagram driver context. | |
const QSE_dgmDvrStats * | QSE_dgmDvrStatsLocate (QSE_dgmDvr *dvr) |
Retrieves a pointer to the statistics. | |
void | QSE_dgmDvrStatsClear (QSE_dgmDvr *dvr) |
Clears the datagram driver statistics. |
CVS $Id: QSE_dgmDvr.c,v 1.5 2011/03/27 01:45:45 russell Exp $
LSF_scanRecordHandler evt_contribution_handler | ( | QSE_dgmDvr * | dvr, | |
const LSF_contribution * | ctb | |||
) | [static] |
Handles the specified contribution.
0,indicating | to continue the scan |
dvr | Datagram driver context parameter | |
ctb | The contribution to handle |
References _QSE_dgmDvrStats::ctb, _QSE_dgmDvrStatsDgm::ctbs, _QSE_dgmDvrStatsGbl::ctbs, _QSE_dgmDvrStats::dgm, evt_record_handler(), _QSE_dgmDvrStats::gbl, _QSE_dgmDvr::handle_ctb, _QSE_dgmDvr::handle_ctx, _QSE_dgmDvr::nctb, QSE_DGMDVR_FATE_K_NEXT_CONTRIBUTION, QSE_DGMDVR_FATE_K_NEXT_DATAGRAM, QSE_DGMDVR_FATE_K_PROCESS, QSE_DGMDVR_FATE_K_STOP, _QSE_dgmDvrStatsCtb::recs, _QSE_dgmDvr::stats, _QSE_dgmDvr::update_ctb, _QSE_dgmDvr::update_ctx, and _QSE_dgmDvr::update_rec.
Referenced by QSE_dgmDvrDatagram().
static unsigned int evt_record_handler | ( | QSE_dgmDvr * | dvr, | |
const LSF_record * | rec | |||
) | [static] |
Handles the specified event record.
0,indicating | to continue the scan |
dvr | Datagram driver context parameter | |
rec | The record to print |
References _QSE_dgmDvrStats::ctb, _QSE_dgmDvrStats::dgm, _QSE_dgmDvrStats::gbl, _QSE_dgmDvr::handle_ctx, _QSE_dgmDvr::handle_rec, _QSE_dgmDvr::nprocess, _QSE_dgmDvr::nskip, _QSE_dgmDvr::pprocess, _QSE_dgmDvr::pskip, QSE_DGMDVR_FATE_K_CONTINUE, QSE_DGMDVR_FATE_K_NEXT_CONTRIBUTION, QSE_DGMDVR_FATE_K_NEXT_DATAGRAM, QSE_DGMDVR_FATE_K_STOP, _QSE_dgmDvrStatsDgm::recs, _QSE_dgmDvrStatsGbl::recs, _QSE_dgmDvrStatsCtb::recs, _QSE_dgmDvr::stats, _QSE_dgmDvr::update_ctx, and _QSE_dgmDvr::update_rec.
Referenced by evt_contribution_handler().
static unsigned int handle_ctb_noop | ( | void * | stream, | |
const LSF_contribution * | ctb, | |||
void * | qsex | |||
) | [static] |
Noop routine to handle a contribution. This is used when no contribution handling routine was provided.
stream | The apid stream context (ignored) | |
ctb | The datagram contribution (ignored) | |
qsex | The QSEP/QSEC context (ignored) |
References QSE_DGMDVR_FATE_K_CONTINUE.
Referenced by QSE_dgmDvrConstruct().
static unsigned int handle_dgm_noop | ( | void * | stream, | |
const LSF_datagram * | dgm, | |||
void * | ctx | |||
) | [static] |
Noop routine to handle a datatgram. This is used when no datagram handling routine was provided.
stream | The apid stream context (ignored) | |
dgm | The datagram (ignored) | |
ctx | The QSEP/QSEC context (ignored) |
References QSE_DGMDVR_FATE_K_CONTINUE.
Referenced by QSE_dgmDvrConstruct().
static unsigned int handle_rec_noop | ( | void * | astream, | |
const LSF_record * | rec, | |||
void * | ctx | |||
) | [static] |
Noop routine to handle a record. This is used when no routine handling routine was provided.
astream | The apid stream context (ignored) | |
rec | The LSF record containing the event (ignored) | |
ctx | The QSEP/QSEC context (ignored) |
References QSE_DGMDVR_FATE_K_CONTINUE.
Referenced by QSE_dgmDvrConstruct().
static const unsigned int * load_ptr | ( | int ** | ptr, | |
const unsigned int * | cfg | |||
) | [static] |
Load a pointer from the configuration array.
[out] | ptr | The storage for the pointer |
[in] | cfg | The configuration array |
Referenced by QSE_dgmDvrConstruct().
QSE_dgmDvr * QSE_dgmDvrConstruct | ( | QSE_dgmDvr * | dvr, | |
const unsigned int * | dvr_cfg, | |||
QSE_updateAtDatagram | update_dgm, | |||
QSE_updateAtContribution | update_ctb, | |||
QSE_updateAtRecord | update_rec, | |||
void * | update_ctx, | |||
QSE_dgmDvrDgm | handle_dgm, | |||
QSE_dgmDvrCtb | handle_ctb, | |||
QSE_dgmDvrRec | handle_rec, | |||
void * | handle_ctx | |||
) |
Constructs/initializes the datagram context control block.
dvr | The datagram context to construct/initialize, if this is NULL, a QSE_dgmDvr context will be allocated using malloc. | |
dvr_cfg | The driver configuration parameters, may be NULL | |
update_dgm | The QSEP/QSEC update at datagram routine | |
update_ctb | The QSEP/QSEC update at contribution routine | |
update_rec | The QSEP/QSEC update at record routine | |
update_ctx | The update routines' context parameter | |
handle_dgm | The user routine to handle a datagram | |
handle_ctb | The user routine to handle a contribution | |
handle_rec | The user routine to handle a record | |
handle_ctx | The user handler routines' context parameter |
References _QSE_dgmDvr::free, _QSE_dgmDvr::handle_ctb, handle_ctb_noop(), _QSE_dgmDvr::handle_ctx, _QSE_dgmDvr::handle_dgm, handle_dgm_noop(), _QSE_dgmDvr::handle_rec, handle_rec_noop(), load_ptr(), _QSE_dgmDvr::nctb, _QSE_dgmDvr::nprocess, _QSE_dgmDvr::nskip, _QSE_dgmDvr::pprocess, _QSE_dgmDvr::pskip, QSE_DGMDVR_PRM_K_ECOUNT, QSE_DGMDVR_PRM_K_END, QSE_DGMDVR_PRM_K_ESKIP, QSE_DGMDVR_PRM_K_PCOUNT, QSE_DGMDVR_PRM_K_PSKIP, _QSE_dgmDvr::stats, _QSE_dgmDvr::update_ctb, _QSE_dgmDvr::update_ctx, _QSE_dgmDvr::update_dgm, and _QSE_dgmDvr::update_rec.
LSF_scanContributionHandler QSE_dgmDvrDatagram | ( | QSE_dgmDvr * | dvr, | |
const LSF_datagram * | dgm | |||
) |
Handles each datagram.
The | contribution level handler (routine + parameter) |
dvr | Datagram driver context parameter | |
dgm | The datagram to print |
References _QSE_dgmDvrStatsDgm::ctbs, _QSE_dgmDvrStats::dgm, _QSE_dgmDvrStatsGbl::dgms, evt_contribution_handler(), _QSE_dgmDvrStats::gbl, _QSE_dgmDvr::handle_ctx, _QSE_dgmDvr::handle_dgm, _QSE_dgmDvr::nctb, _QSE_dgmDvr::nskip, _QSE_dgmDvr::pskip, QSE_DGMDVR_FATE_K_NEXT_DATAGRAM, QSE_DGMDVR_FATE_K_PROCESS, QSE_DGMDVR_FATE_K_STOP, QSE_dgmEventSkip(), _QSE_dgmDvrStatsDgm::recs, _QSE_dgmDvr::stats, _QSE_dgmDvr::update_ctx, and _QSE_dgmDvr::update_dgm.
Referenced by QSE_dgmDvrProcess().
void QSE_dgmDvrDestruct | ( | QSE_dgmDvr * | dvr | ) |
Frees the QSE datagram driver context.
dvr | The datagram context to destruct |
References _QSE_dgmDvr::free.
int QSE_dgmDvrProcess | ( | QSE_dgmDvr * | dvr, | |
const LSF_datagram * | dgms, | |||
int | dgms_len | |||
) |
Convenience routine for the CCSDS_istreamProcess routine.
== | 0 Continue | |
!= | 0 Stop |
dvr | The driver context parameter | |
dgms | The datagrams to handle | |
dgms_len | The length of the datagram |
References QSE_dgmDvrDatagram().
unsigned int QSE_dgmDvrSizeof | ( | const unsigned int * | cfg | ) |
Returns the size, in bytes of a QSE_dgmDvr structure.
cfg | The datagram configuration list. This is a variable length list containing various configuration parameters. See the QSE__dgmDvrCfg routines for what can be specified and how to build this list. |
void QSE_dgmDvrStatsClear | ( | QSE_dgmDvr * | dvr | ) |
Clears the datagram driver statistics.
dvr | Datagram driver context parameter |
References _QSE_dgmDvr::stats.
const QSE_dgmDvrStats * QSE_dgmDvrStatsLocate | ( | QSE_dgmDvr * | dvr | ) |
Retrieves a pointer to the statistics.
dvr | Datagram driver context parameter |
References _QSE_dgmDvr::stats.