GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-5 > eds_posttest / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

eds_posttest.c File Reference

Program to test the post functions in EDS_fw. More...

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <EDS/EDS_fw.h>
#include <EDS/TMR.h>
#include <EDS/LCBV.h>
#include <EDS/io/LCBP.h>
#include <EDS/io/EBF_stream.h>

Classes

struct  _Ctl
 Collections all the control parameters together. These are essentially the interpretted command line options. More...
struct  _Stream
 Contains the posting context. More...

Typedefs

typedef struct _Ctl Ctl
 Typedef for struct _Ctl.
typedef struct _Stream Stream
 Typedef for struct _Stream.

Functions

static unsigned int posttest (Ctl *ctl)
 Finishes the platform common setup and initalization, starts the packet flow.
static void reportUsage (void)
 Brief explanation on readtest usage.
static int fillCtl (Ctl *ctl, int argc, char *const argv[])
 Examines the command line parameters and fills the print control structure.
static int passThrough (void *unused, unsigned int nbytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, int id)
 Pass through filter routine.
static void streamWrite (Stream *stream, EDS_fwIxb *ixb)
 Dummy stream posting routine.
static int streamFlush (Stream *stream, int reason)
 Dummy stream flushing routine.
int main (int argc, char *const argv[])
 Usual entry point for the readtest.


Detailed Description

Program to test the post functions in EDS_fw.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id: eds_posttest.c,v 1.6 2011/03/25 22:16:55 russell Exp $
This tests the EDS_fw posting functionality. One can post to any combination of four output streams. The posting can be done either by setting the appropriate bit on the return code of a handler or by statically declaring it during registeration. The first method is what a filter would do, the second might be usefull when one wishes to direct the information for all events to a particular stream. In this test POST stream 0 is of the former type and POST stream 1 is of the latter type.

Function Documentation

static int fillCtl ( Ctl ctl,
int  argc,
char *const   argv[] 
) [static]

Examines the command line parameters and fills the print control structure.

Parameters:
ctl The parameter control block.
argc The number of command line parameters.
argv The array of pointers to the command line parameters.
Return values:
0,Everything is okay.
-1,Incorrect command usage. Usually this means that the input file name was absent.

References _Ctl::name, reportUsage(), _Ctl::to_process, _Ctl::to_skip, and _Ctl::type.

Referenced by main().

int main ( int  argc,
char *const   argv[] 
)

Usual entry point for the readtest.

Parameters:
argc The number of arguments
argv The vector of arguments.
An example of how to run this program is
    $ eds_posttest -s2 -n4  event.ebf
   

Skips the first 2 events, and tests the next 4 events (assuming the file has 4 more events.
Executing the program with no arguments prints a usage guide.

References fillCtl(), and posttest().

static int passThrough ( void *  unused,
unsigned int  nbytes,
EBF_pkt pkt,
EBF_siv  siv,
EDS_fwIxb *  ixb,
int  id 
) [static]

Pass through filter routine.

Parameters:
unused Context variable (unused)
nbytes Number of bytes in the packet
pkt The event packet
siv The state information vector
ixb The EDS framework information exchange block
id The identity of this handler

References _EDS_rsdDsc::id, _EDS_rsdDsc::len, and _EDS_rsdDsc::ptr.

Referenced by posttest().

static unsigned int posttest ( Ctl ctl  )  [static]

Finishes the platform common setup and initalization, starts the packet flow.

Parameters:
ctl The control structure

References _Stream::cnt, _Stream::id, _Ctl::name, passThrough(), streamFlush(), streamWrite(), _Ctl::to_process, _Ctl::to_skip, and _Ctl::type.

Referenced by main().

static int streamFlush ( Stream stream,
int  reason 
) [static]

Dummy stream flushing routine.

Parameters:
stream The stream context handle
reason The reason the stream is being flushed

References _Stream::cnt, and _Stream::id.

Referenced by posttest().

static void streamWrite ( Stream stream,
EDS_fwIxb *  ixb 
) [static]

Dummy stream posting routine.

Parameters:
stream The stream context handle
ixb The EDS framework information exchange block

References _Stream::cnt, and _Stream::id.

Referenced by posttest().


Generated on Mon Nov 14 09:14:45 2011 by  doxygen 1.5.8