GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSEP / dev > lsepw / rhel5-64
#include <LSEPW_pvtdef.h>
#include <LSEP/LSEPW.h>
#include <LSEP/LSEP_ids.h>
#include <LSEP/LSEP_etxCtb.h>
#include <LSEP/LSEPW_evt0.h>
#include <LSEP/LSEP_evtBdy0.h>
#include <LSE/LSEW_dgmFw.h>
#include <LDT/BFP.h>
#include <EDS/EDS_fw.h>
#include <EDS/EDS_rsd.h>
#include <EDS/EDS_cfg.h>
#include <EDS/EBF_gemLocate.h>
#include <EDS/EBF_gem.h>
#include <PBI/FFS.ih>
#include <string.h>
Defines | |
#define | ADVANCE(_ptr, _nbytes) (void *)(((unsigned char *)(_ptr) + (_nbytes))) |
Advance a generic pointer by the specified number of bytes. | |
Functions | |
static __inline unsigned int | pack_rsdDscs (unsigned int *wrds, unsigned int position, unsigned int list, const EDS_rsdDsc *dscs[32]) |
Packs the byte length of the result summary data specified by active into the output bit array. | |
static __inline unsigned int | copy_pack_rsds (LSEPW_rsdTbl *rsdTbl, unsigned int *wrds, unsigned int position, const LSEPW_eds *eds, unsigned int rsd, const EDS_rsdDsc dscs[32]) |
Copies and packs the result summary information for those handlers that are both active and have non-zero result summary data. | |
static __inline unsigned int | pack_cfgs (unsigned int *wrds, unsigned int position, unsigned int active, const EDS_cfgInfo cfgs[32], LSEPW_eds *eds) |
Packs the cfgs ids specified by active into the output bit array. | |
int | LSEPW_sizeof (int level) |
Return the size of the LSEP data structure. | |
const EDS_fwPostServices * | LSEPW_constructC (LSEPW *lsepw, int level, const void *cfg, unsigned short int apid, unsigned int dgm_id, LSF_CPU_K cpu, LSF_ORIGIN_K origin, unsigned int sw_key, LSEW_dgmFwPoster postRtn, void *postPrm, unsigned int *buf, int buf_size) |
Constructs/initializes the physics application specific context. | |
const EDS_fwPostServices * | LSEPW_construct (LSEPW *lsepw, int level, unsigned short int apid, unsigned int dgm_id, LSF_CPU_K cpu, LSF_ORIGIN_K origin, unsigned int sw_key, LSEW_dgmFwPoster postRtn, void *postPrm, unsigned int *buf, int buf_size) |
Constructs/initializes the physics application specific context. | |
int | LSEPW_start (LSEPW *lsepw, LSF_REASON_OPEN_K reason, unsigned int run_id, unsigned int startTime, LSF_MODE_K mode, unsigned int hw_key, unsigned int lpa_key) |
Start or more accurately, prepare a posting stream to receive events. | |
int | LSEPW_flush (LSEPW *lsepw, int reason) |
Flushes the current datagram. | |
int | LSEPW_levelSet (LSEPW *lsepw, int level) |
Modifies to the current working level to the minimum of level and the maximum allowable compression level that LSEPW is configured to. | |
int | LSEPW_notify (LSEPW *lsepw, unsigned int mode, unsigned int active, const EDS_cfgInfo cfgs[32], const EDS_rsdTbl *rsdTbl) |
Called when the configuration has changed, for example by a mode change. | |
unsigned int * | LSEPW_ctbAdd (LSEPW *lsepw, unsigned int *cur, int len32) |
Adds the Physics specific context contribution to the datagram. | |
int | LSEPW_evtAdd (LSEPW *lsepw, EDS_fwIxb *ixb) |
Formats the event specified in by the EDS_fw Information Exchange block, flushing the current record to the output stream if the datagram is full. |
CVS $Id: LSEPW.c,v 1.16 2011/03/26 23:32:30 russell Exp $
#define ADVANCE | ( | _ptr, | |||
_nbytes | ) | (void *)(((unsigned char *)(_ptr) + (_nbytes))) |
Advance a generic pointer by the specified number of bytes.
_ptr | The pointer to advance | |
_nbytes | The nubmer of bytes to advance |
Referenced by copy(), ctb_trim(), evt4_add(), evt5_add(), evt_trim(), and LSEPW_constructC().
static __inline unsigned int copy_pack_rsds | ( | LSEPW_rsdTbl * | rsdTbl, | |
unsigned int * | wrds, | |||
unsigned int | position, | |||
const LSEPW_eds * | eds, | |||
unsigned int | rsd, | |||
const EDS_rsdDsc | dscs[32] | |||
) | [static] |
Copies and packs the result summary information for those handlers that are both active and have non-zero result summary data.
rsdTbl | The result summary data table to receive a copy of the active, non-zero length descriptors | |
wrds | The beginning of 32-bit output buffer | |
position | The current bit position in the output buffer | |
eds | The Event Delivery System description | |
rsd | The set of handlers with non-zero result summary data. This bit list is collapsed by removing all the corresponding bits in active that are zero. Since only active handlers can contribute result summary data, the set is reduced to only the active handlers. Thus for each set bit in active a result bit is emitted that is 0/1 if that handler does/does not produce any summary data. This map is ordered by priority id. | |
dscs | The result summary data descriptor array |
References _LSEPW_rsdTbl::cnt, _LSEPW_rsdTbl::dscs, _LSEPW_eds::h_active, _LSEPW_eds::h_to_p, _LSEPW_rsdTbl::list, _LSEPW_rsdTbl::max_bytes, and pack_rsdDscs().
Referenced by LSEPW_notify().
const EDS_fwPostServices* LSEPW_construct | ( | LSEPW * | lsepw, | |
int | level, | |||
unsigned short int | apid, | |||
unsigned int | dgm_id, | |||
LSF_CPU_K | cpu, | |||
LSF_ORIGIN_K | origin, | |||
unsigned int | sw_key, | |||
LSEW_dgmFwPoster | postRtn, | |||
void * | postPrm, | |||
unsigned int * | buf, | |||
int | buf_size | |||
) |
Constructs/initializes the physics application specific context.
lsepw | The physics application specific context to construct | |
level | The maximum compression level that will be used | |
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 | |
sw_key | The master software configuration key; this is the key to the Secondary Boot File. | |
postRtn | Routine used to post a formatted event | |
postPrm | Parameter passed to the post routine | |
buf | The first, preallocated buffer to fill | |
buf_size | The size, in bytes, of the ouptut buffer. Events will be packed into this buffer until full |
References LSEPW_constructC().
const EDS_fwPostServices* LSEPW_constructC | ( | LSEPW * | lsepw, | |
int | level, | |||
const void * | cfg, | |||
unsigned short int | apid, | |||
unsigned int | dgm_id, | |||
LSF_CPU_K | cpu, | |||
LSF_ORIGIN_K | origin, | |||
unsigned int | sw_key, | |||
LSEW_dgmFwPoster | postRtn, | |||
void * | postPrm, | |||
unsigned int * | buf, | |||
int | buf_size | |||
) |
Constructs/initializes the physics application specific context.
lsepw | The physics application specific context to construct | |
level | The maximum compression level that will be used | |
cfg | Level level specific configuration parameters | |
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 | |
sw_key | The master software configuration key; this is the key to the Secondary Boot File. | |
postRtn | Routine used to post a formatted event | |
postPrm | Parameter passed to the post routine | |
buf | The first, preallocated buffer to fill | |
buf_size | The size, in bytes, of the ouptut buffer. Events will be packed into this buffer until full |
References ADVANCE, _LSEP_etxCtb::bdy, _LSEPW::cur_level, _LSEPW::defaults, _LSEPW::dgmFw, _LSEPW::etx, _LSEP_etxCtb::hdr, _LSEP_etxBdy::keys, LSEP_ID_K_ETX, LSEPW_ctbAdd(), LSEPW_evt0_construct(), LSEPW_evt0_sizeof(), LSEPW_evtAdd(), LSEPW_flush(), LSEPW_notify(), LSEPW_start(), _LSEPW::max_level, _LSEP_etxKeys::software, and _LSEPW::usrCtxs.
Referenced by LSEPW_construct().
unsigned int* LSEPW_ctbAdd | ( | LSEPW * | lsepw, | |
unsigned int * | cur, | |||
int | len32 | |||
) |
Adds the Physics specific context contribution to the datagram.
lsepw | The physics application specific context | |
cur | Pointer to the where to add the informaton | |
len32 | The length, in 32-bit words, of the available space in the datagram |
References _LSEPW::etx, and _LSEP_etxCtb::hdr.
Referenced by beg8_add(), and LSEPW_constructC().
int LSEPW_evtAdd | ( | LSEPW * | lsepw, | |
EDS_fwIxb * | ixb | |||
) |
Formats the event specified in by the EDS_fw Information Exchange block, flushing the current record to the output stream if the datagram is full.
lsepw | The physics application specific context | |
ixb | The Information Exchange Block |
References _LSEPW::dgmFw.
Referenced by LSEPW_constructC().
int LSEPW_flush | ( | LSEPW * | lsepw, | |
int | reason | |||
) |
Flushes the current datagram.
lsepw | The physics application specific context | |
reason | The reason for the flush |
References _LSEPW::dgmFw.
Referenced by LSEPW_constructC().
int LSEPW_levelSet | ( | LSEPW * | lsepw, | |
int | level | |||
) |
Modifies to the current working level to the minimum of level and the maximum allowable compression level that LSEPW is configured to.
lsepw | The physics application specific context | |
level | The new compression level |
References _LSEPW::cur_level, _LSEPW::defaults, _LSEPW::dgmFw, LSEPW_evt0_level_set(), _LSEPW::max_level, and _LSEPW::usrCtxs.
int LSEPW_notify | ( | LSEPW * | lsepw, | |
unsigned int | mode, | |||
unsigned int | active, | |||
const EDS_cfgInfo | cfgs[32], | |||
const EDS_rsdTbl * | rsdTbl | |||
) |
Called when the configuration has changed, for example by a mode change.
lsepw | The physics application specific context | |
mode | The new mode | |
active | The list of active handlers | |
cfgs | The current configuration information for each handler. | |
rsdTbl | The result summary data table |
References _LSEP_etxCtb::bdy, copy_pack_rsds(), _LSEPW::dgmFw, _LSEPW::eds, _LSEP_etxBdy::eds, _LSEPW::etx, _LSEP_etxCtb::hdr, LSEP_ROOTHDR_BRIDGE_M_RSD, pack_cfgs(), _LSEPW::rsdTbl, and _LSEP_etxEds::wrds.
Referenced by LSEPW_constructC().
int LSEPW_sizeof | ( | int | level | ) |
Return the size of the LSEP data structure.
level | The maximum compression level that will be used. Resources will be allocated consistent with supporting events written in this and all lesser compression levels. |
References LSEPW_evt0_sizeof().
int LSEPW_start | ( | LSEPW * | lsepw, | |
LSF_REASON_OPEN_K | reason, | |||
unsigned int | run_id, | |||
unsigned int | startTime, | |||
LSF_MODE_K | mode, | |||
unsigned int | hw_key, | |||
unsigned int | lpa_key | |||
) |
Start or more accurately, prepare a posting stream to receive events.
lsepw | The physics application specific context | |
reason | The reason why this run is being started | |
run_id | The run identifier. Only the first 24-bits are used. | |
startTime | The run start time rounded to the nearest second | |
mode | The operational mode | |
hw_key | The master hardware configuraion key; this is the key to the LATc file | |
lpa_key | The LPA_DB file key |
References _LSEP_etxCtb::bdy, _LSEPW::dgmFw, _LSEPW::etx, _LSEP_etxKeys::hardware, _LSEP_etxBdy::keys, and _LSEP_etxKeys::lpa_db.
Referenced by LSEPW_constructC().
static __inline unsigned int pack_cfgs | ( | unsigned int * | wrds, | |
unsigned int | position, | |||
unsigned int | active, | |||
const EDS_cfgInfo | cfgs[32], | |||
LSEPW_eds * | eds | |||
) | [static] |
Packs the cfgs ids specified by active into the output bit array.
wrds | The beginning of 32-bit output buffer | |
position | The current bit position in the output buffer | |
active | Bit mask indicating which of the elements of cfgs should be packed | |
cfgs | The array of up-to 32 configuration information blocks | |
eds | The Event Delivery System description |
References _LSEPW_eds::h_active, _LSEPW_eds::h_to_p, and _LSEPW_eds::p_active.
Referenced by LSEPW_notify().
static __inline unsigned int pack_rsdDscs | ( | unsigned int * | wrds, | |
unsigned int | position, | |||
unsigned int | list, | |||
const EDS_rsdDsc * | dscs[32] | |||
) | [static] |
Packs the byte length of the result summary data specified by active into the output bit array.
wrds | The beginning of 32-bit output buffer | |
position | The current bit position in the output buffer | |
list | The list of non-zero length descriptors to copy | |
dscs | A dense array of the active descriptors ordered by handler identity |
Referenced by copy_pack_rsds().