GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LSEP / V1-2-0
Constituent: lsep_write     Tag: linux-gcc
#include <dprintf.h>
#include "CCSDS/CCSDS_pkt.h"
#include "CDM/CDM_pubdefs.h"
#include "PBS/BSWP.h"
#include "LSEP/LSEP_ids.h"
#include "LSEP/LSEPW.h"
#include "CDFP.h"
#include "CDFP_def.h"
#include "LSE/CDF_gem.h"
#include "LSE/LSE_time.h"
#include "LSE/CCSDS_ostream.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_match.h"
#include "EDS/EDS_fw.h"
#include "EDS/FFS.h"
#include "EDS/io/EBF_stream.h"
#include "EDS/io/LCBP.h"
#include "EDS/io/EBF_swap.h"
#include "EDS/LCBV.h"
#include "EDS/TMR.h"
#include "LSF/LSF_cpu.h"
#include "LSF/LSF_mode.h"
#include "LSF/LSF_origin.h"
#include "LSF/LSF_reason.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <libgen.h>
Include dependency graph for lsep_write.c:
Data Structures | |
struct | _StrDsc |
Defines a string descriptor as a length and a pointer. More... | |
struct | _FileNamBlk |
Describes a file name as consisting of 3 pieces, a directory, a name, and an extension. More... | |
struct | _HandlerCtx |
Bogus handler context for testing purposes. More... | |
struct | _PostStream |
Post Stream Services + Context Parameter. More... | |
struct | _File |
Definition of a file. More... | |
struct | _OutputFiles |
Managing structure for the output files. More... | |
struct | _PostSeqSpec |
Post Sequence Specification. More... | |
struct | _PostCtx |
Combines the EDS posting services with its context parameter. More... | |
struct | _ModeSeqSpec |
Mode Sequence Specification. More... | |
struct | _ModeSeqCtx |
Captures the Mode Sequence Context. More... | |
struct | _Ctl |
Collections all the control parameters together. These are essentially the interpretted command line options. More... | |
struct | _PostHandler |
Binds a posting routine with its parameter. More... | |
The fully qualified name of the output file to create | |
static PostHandler | post_handler_get (int fd, int ccsdsFlag) |
Sets up the physical posting routine plus its context parameter. | |
static int | postCtxConstruct (PostCtx *ctx, Ctl *ctl) |
Constructs the posting context. | |
static int | postStart (PostCtx *ctx, int reason, unsigned int run_id, unsigned int startTime, unsigned int mode, unsigned int hw_key, unsigned int cfg_key) |
Callback routine when a posting queue is started, i.e. made ready to receive events. | |
static void | postWrite (PostCtx *ctx, EDS_fwIxb *ixb) |
Callback routine to write an event to the post stream. | |
static int | postNotify (PostCtx *ctx, unsigned int mode, unsigned int active, const unsigned char cfgs[32], const EDS_rsdTbl *rsdTbl) |
Routine to notify clients of a change in the handlers' configuration. | |
static int | postFlush (PostCtx *ctx, int reason) |
Callback routine for the event post que flushing Status 0, success, anything else failure. | |
static unsigned int | modeSelect (HandlerCtx *ctx, unsigned int mode) |
Mode select routine for the toy handlers. | |
static void | msxConstruct (ModeSeqCtx *ctx, EDS_fw *fw, const ModeSeqSpec *mss, unsigned int handlers, unsigned int ostreams) |
Constructs a Mode Sequence Context from the Mode Sequence Specification. | |
static unsigned int | msxService (ModeSeqCtx *msx) |
Routine that is responsible for determining whether to do a mode switch for the next event. | |
static int | file_create (const char *name) |
Creates the output file. | |
Defines | |
#define | RND_TO(_x, _r) ((((_x) + (_r) -1) / (_r)) * (_r)) |
Rounds the specified number, _x up to the nearest multiple of _r. | |
Typedefs | |
typedef _StrDsc | StrDsc |
Typedef for struct _StrDsc. | |
typedef _FileNamBlk | FileNamBlk |
Typedef for struct _FileNamBlk. | |
typedef _HandlerCtx | HandlerCtx |
Typedef for struct _HandlerCtx. | |
typedef _PostStream | PostStream |
Typedef for struct _PostStream. | |
typedef _File | File |
Typedef for a file. | |
typedef _OutputFiles | OutputFiles |
Typedef for struct _OutputFiles. | |
typedef _PostSeqSpec | PostSeqSpec |
Typedef for struct _PostSeqSpec. | |
typedef _PostCtx | PostCtx |
Typedef for struct _PostCtx. | |
typedef _ModeSeqSpec | ModeSeqSpec |
Typedef for struct _ModeSeqSpec. | |
typedef _ModeSeqCtx | ModeSeqCtx |
Typedef for struct _ModeSeqCtx. | |
typedef _Ctl | Ctl |
Typedef for struct _Ctl. | |
typedef _PostHandler | PostHandler |
Typedef for struct _PostHandler. | |
Functions | |
static LSEPW * | lsepw_allocate (int level) |
Sizes and allocates an LSEPW control structure. | |
static unsigned int * | ccsds_post (void *prm, void *buf, int nbytes) |
Routine to write the data for the CCSDS ostream. | |
static unsigned int * | buf_post (void *prm, void *buf, int nbytes) |
Routine to write the data to a file. | |
static unsigned int * | dummy_post (void *prm, void *buf, int nbytes) |
Dummy event posting routine. | |
static CDFP_cfg * | cdfp_cfg_allocate (int level) |
Sizes and allocates an CDFP configuration structure. | |
static unsigned int | getObjects (HandlerCtx *ctx) |
Returns the objects needed by this handler. | |
static unsigned int | getNeeds (HandlerCtx *ctx) |
Returns the needs of this handler. | |
static unsigned int | getResultSize (HandlerCtx *ctx) |
Returns the needs of this handler. | |
static unsigned int | evt_lcbd_handler (ModeSeqCtx *msx, unsigned int edw, EBF_pkt *pkt) |
LCBD event handler call back routine. | |
static unsigned int | output (Ctl *ctl) |
Finishes the platform common setup and initalization, starts the packet flow. | |
static void | reportUsage (void) |
Brief explanation on readtest usage. | |
unsigned int | evt_handler (HandlerCtx *ctx, unsigned int pktBytes, void *pkt, unsigned int siv, EDS_fwIxb *ixb, int id) |
Dummy event handler. | |
static int | fillCtl (Ctl *ctl, int argc, char *const argv[]) |
Examines the command line parameters and fills the output control structure. | |
int | main (int argc, char *const argv[]) |
Usual entry point for lsep_write. | |
static void | parse (FileNamBlk *nam, const char *filename, unsigned int opts) |
Breaks a file name into its components. | |
static const char * | compose (char *name, const char *iname, const FileNamBlk *relblk, int apid, const char *defext) |
static int | loadLib (const char *library_name, int verbose) |
Dynamically loads the specified configuration library. | |
static time_t | getTime (const char *s) |
Parses an input time specification to produce a 32-bit time value. | |
static void | addHandler (HandlerCtx *handler, const char *s, unsigned int reassemble) |
Parses and adds a handler. | |
static void | addOutputFile (OutputFiles *output, const char *s) |
Captures the names of the output files. | |
static int | initHandler (HandlerCtx *handler, int objects, unsigned int reassemble) |
Initializes a default handler context. | |
static __inline int | count_chr (const char *s, char c) |
Counts the number of times c appears in the string s. | |
static void | report_flag_err (const char *reason, const char *s, int count) |
Issue an error message when the parsing of the flag sequence options string is not specified correctly. | |
static void | report_mss_err (const char *reason, const char *s, int count) |
Issue an error message when the parsing of the flag sequence options string is not specified correctly. | |
static LSE_timeFlagSpec * | constructTfs (const char *s, unsigned int *flags) |
Constructs a Time Flag Specification orders. | |
static ModeSeqSpec * | constructMss (const char *s) |
Constructs a Mode Sequence Specification orders. | |
static void | report_pss_err (const char *reason, const char *s, int count) |
Issue an error message when the parsing of the Posting sequence options string is not specified correctly. | |
static PostSeqSpec * | constructPss (const char *s) |
Constructs a list of Post Sequence Specification orders. | |
Variables | |
static unsigned short int | Apids [4] |
The APIDs as a function of CPU number. |
$ lsde -n<# of events> -s<# to skip> <file.ebf>
CVS $Id: lsep_write.c,v 1.20 2007/02/14 06:13:58 russell Exp $
|
Rounds the specified number, _x up to the nearest multiple of _r.
|
|
Typedef for struct _ModeSeqSpec.
|
|
Parses and adds a handler.
|
|
Captures the names of the output files.
|
|
Routine to write the data to a file.
|
|
Routine to write the data for the CCSDS ostream.
|
|
Sizes and allocates an CDFP configuration structure.
|
|
Constructs a Mode Sequence Specification orders.
|
|
Constructs a list of Post Sequence Specification orders.
|
|
Constructs a Time Flag Specification orders.
|
|
Counts the number of times c appears in the string s.
|
|
Dummy event posting routine.
|
|
Dummy event handler.
|
|
LCBD event handler call back routine.
|
|
Creates the output file.
|
|
Examines the command line parameters and fills the output control structure.
|
|
Returns the needs of this handler.
|
|
Returns the objects needed by this handler.
|
|
Returns the needs of this handler.
|
|
Parses an input time specification to produce a 32-bit time value.
|
|
Initializes a default handler context.
|
|
Dynamically loads the specified configuration library.
|
|
Sizes and allocates an LSEPW control structure.
|
|
Usual entry point for lsep_write.
|
|
Mode select routine for the toy handlers.
|
|
Constructs a Mode Sequence Context from the Mode Sequence Specification.
|
|
Routine that is responsible for determining whether to do a mode switch for the next event.
|
|
Finishes the platform common setup and initalization, starts the packet flow.
|
|
Breaks a file name into its components.
|
|
Sets up the physical posting routine plus its context parameter.
|
|
Constructs the posting context.
|
|
Callback routine for the event post que flushing Status 0, success, anything else failure.
|
|
Routine to notify clients of a change in the handlers' configuration.
|
|
Callback routine when a posting queue is started, i.e. made ready to receive events.
|
|
Callback routine to write an event to the post stream.
|
|
Issue an error message when the parsing of the flag sequence options string is not specified correctly.
|
|
Issue an error message when the parsing of the flag sequence options string is not specified correctly.
|
|
Issue an error message when the parsing of the Posting sequence options string is not specified correctly.
|
|
Initial value: { APID_K_BASE + 1, APID_K_BASE + 2, APID_K_BASE + 3, APID_K_BASE }
|