GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QCFG / V1-1-3 > qcfg / rhel6-32
#include <QCFG/QCFG.h>
#include <QCFG/QCFG_msgs.h>
#include <RIM/RIM.h>
#include <RIM/RIM_msgs.h>
#include <DUMP/dump.h>
#include <LSF/LSF.h>
#include <LSF/LSF_ids.h>
#include <LSF/LSF_scan.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/MBA.h>
#include <string.h>
Classes | |
struct | _QCFG_ctl |
Structure holding the in-memory model and callback info. More... | |
struct | _QCFG_dgmParm |
Datagram parameter block. More... | |
Typedefs | |
typedef struct _QCFG_ctl | QCFG_ctl |
Structure holding the in-memory model and callback info. | |
typedef struct _QCFG_dgmParm | QCFG_dgmParm |
Datagram parameter block. | |
Functions | |
static LSF_scanContributionHandler | procDgm (ApidStream *astream, const LSF_datagram *dgm) |
Process a datagram. | |
static unsigned | getRecd (void *vParm, unsigned *type, int *leng) |
Get a record header. | |
static unsigned | getData (void *vParm, int quiet, void *data, int leng, int *rLeng) |
Get record data. | |
unsigned | QCFG_ingest (RIM *rim, const char *filename, QCFG_rimProcCB procRtn, void *parm) |
Process a file of LAT configuration datagrams. |
$Id: QCFG_ingest.c,v 1.5 2011/03/29 21:47:53 saxton Exp $
unsigned getData | ( | void * | vParm, | |
int | quiet, | |||
void * | data, | |||
int | leng, | |||
int * | rLeng | |||
) | [static] |
Get record data.
This routine, designed to work in conjunction with RIM_import, gets the next block of data from the datagram, making sure that it will not overflow the current record.
vParm | The address of the file parameter block. | |
quiet | If TRUE, don't return or report any error. | |
data | The address of the area to receive the data. | |
leng | The number of bytes of data to get. | |
rLeng | The address of an integer to receive the number of bytes actually obtained. |
QCFG_SUCCESS | Success | |
QCFG_CTBSHRT | Request extends beyond end of contribution |
References _QCFG_dgmParm::addr, and _QCFG_dgmParm::ctbRem.
Referenced by procDgm().
unsigned getRecd | ( | void * | vParm, | |
unsigned * | type, | |||
int * | leng | |||
) | [static] |
Get a record header.
This routine, designed to work in conjunction with RIM_import, gets the next record (contribution) header from the datagram.
vParm | The address of the datagram parameter block | |
type | The address of an integer to receive the record type. | |
leng | The address of an integer to receive the record length, in bytes. This is set to 0 if the end of the datagram was reached, or to -1 for other error conditions. |
QCFG_SUCCESS | Success | |
QCFG_EOFREAD | End of datagram was reached | |
QCFG_DGMSHRT | Partial header was obtained |
References _QCFG_dgmParm::addr, _QCFG_dgmParm::ctbRem, and _QCFG_dgmParm::dgmRem.
Referenced by procDgm().
LSF_scanContributionHandler procDgm | ( | ApidStream * | astream, | |
const LSF_datagram * | dgm | |||
) | [static] |
Process a datagram.
This routine is called for each datagram found in the packet file. It assumes that a datagram contains the complete dump of the LAT registers and retrieves and prints out the register values.
astream | The APID stream | |
dgm | The datagram |
References _QCFG_dgmParm::addr, _QCFG_dgmParm::ctbRem, _QCFG_dgmParm::dgmRem, getData(), getRecd(), _QCFG_ctl::noMore, _QCFG_ctl::parm, _QCFG_ctl::procRtn, and _QCFG_ctl::rim.
Referenced by QCFG_ingest().
unsigned QCFG_ingest | ( | RIM * | rim, | |
const char * | filename, | |||
QCFG_rimProcCB | procRtn, | |||
void * | parm | |||
) |
Process a file of LAT configuration datagrams.
This routine reads a file of LAT configuration datagrams and populates a RIM structure with each datagram. An optional callback routine may be called to process the contents of the RIM each time.
rim | In-memory model to populate | |
filename | Name of the file to use as the source of dgms | |
procRtn | Routine to call to process the RIM each time it is populated from a new datagram. May be NULL. | |
parm | User parameter to pass to the callback routine. |
References procDgm().