GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCI / dev

Constituent: lci     Tag: mcp750


Interface   Data Structures   File List   Data Fields   Globals  

consign.c File Reference

Routines that act upon the consignment structure. More...

#include "LCI/LCI_msgs.h"
#include "consign_p.h"
#include "configure.h"
#include "PBS/MBA.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/BSWP.h"
#include "MON/MON_pubdefs.h"
#include "PBS/WCT.h"
#include "ITC/ITC_pubdefs.h"
#include "LSEC/LSEC_ctx.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_gemLocate.h"
#include <string.h>

Include dependency graph for consign.c:


Enumerations

enum  {
  LCI_DATAGRAM_SIZE = 1024*128,
  LCI_N_DATAGRAMS = 6,
  LCI_CNS_CYCLE_SPACE = 4*1024,
  LCI_SSR_APID_BASE = 0x3c5
}

Functions

unsigned int * LCI_begAdder (void *prm, unsigned int *buf, unsigned int len32)
 Copy the calibration context information into buf.
unsigned int * LCI_usrAdder (void *prm, void *usrInfo, int usrLen, unsigned int *buf, unsigned int len32)
 Add User Context Contribution at an arbitrary point in the event datagram.
unsigned int * LCI_evtAdder (void *prm, void *evt, unsigned int *buf, unsigned int len32)
 Compress the next event into the buffer.
unsigned int * LCI_poster (void *prm, void *buf, int bytes)
 Send the datagram to the SDI and get a new one from the FPA.
void LCI_cb_dgmFree (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx)
 Completion call-back for use with ITC when sending out a datagram.
void initFramework (LSEW_dgmFw *fw, LCI_consignment *cns, unsigned id, unsigned cpuid, unsigned srcid)
 Initialise one of the datagram frameworks.
LSEW_dgmFw * getFramework (LCI_consignment *cns)
 Get the framework appropriate for the current operating mode.
LCI_consignmentLCI_newConsignment (unsigned cpuid, unsigned srcid, LCI_configuration *cnf, LCI_collection *cll, LSEC_compaction *cpc)
 Allocate memory for an LCI_consigment structure and initialise (clear).
void LCI_deleteConsignment (LCI_consignment *cns)
 Free the previously allocated consignment structure.
WCT_time_sat LCI_prepare (LCI_consignment *cns, unsigned runid)
 Set the runid and start time for the first datagram of the new calibration.
unsigned LCI_complete (LCI_consignment *cns)
 Complete a consignment.
unsigned LCI_consign (LCI_consignment *cns)
 Perform a consignment.
void LCI_setReason (LCI_consignment *cns, int reason)
 Set the current datagram close reason.

Detailed Description

Routines that act upon the consignment structure.

Author:
James Swain & Owen Saxton
Id
consign.c,v 1.19 2007/08/21 22:51:19 saxton Exp

Function Documentation

LSEW_dgmFw * getFramework LCI_consignment cns  ) 
 

Get the framework appropriate for the current operating mode.

Parameters:
cns Pointer to the current consignment structure
Returns:
Pointer to the framework appropriate for the current operating mode

void initFramework LSEW_dgmFw *  fw,
LCI_consignment cns,
unsigned  id,
unsigned  cpuid,
unsigned  srcid
 

Initialise one of the datagram frameworks.

Parameters:
fw Pointer to the framework to initalise
cns Pointer to the consignment structure holding the FW
id Datagram ID
srcid ID of the data source
cpuid ID of the CPU LCI is being run on

unsigned int * LCI_begAdder void *  prm,
unsigned int *  buf,
unsigned int  len32
 

Copy the calibration context information into buf.

Parameters:
prm Pointer to a consignment structure
buf The buffer to accept the Begin Contribution data
len32 The number of 32-bit words available in buf.
Returns:
Pointer to the next output location to be filled, or NULL if the current buffer is not large enough to hold the context

void LCI_cb_dgmFree ITC_QueueItem *  qitem,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2,
unsigned int  tx
 

Completion call-back for use with ITC when sending out a datagram.

Just returns the qitem to the pool.

Parameters:
qitem Queue item to be returned to the pool
status Success or failure of the ITC delivery
prm0 User defined parameter 0 (pointer to the FPM pool)
prm1 User defined (NULL)
prm2 User defined (NULL)
tx Transmission status

unsigned LCI_complete LCI_consignment cns  ) 
 

Complete a consignment.

Parameters:
cns pointer to the consignment
Return values:
LCI_SUCCESS If all goes well

unsigned LCI_consign LCI_consignment cns  ) 
 

Perform a consignment.

Parameters:
cns Pointer to a consignment structure
Return values:
LCI_SUCCESS If all goes well

void LCI_deleteConsignment LCI_consignment cns  ) 
 

Free the previously allocated consignment structure.

Parameters:
cns Pointer to allocated, intialised consignment structure (from LCI_newConsignment)

unsigned int * LCI_evtAdder void *  prm,
void *  evt,
unsigned int *  buf,
unsigned int  len32
 

Compress the next event into the buffer.

Parameters:
prm Pointer to the consignment structure
evt User supplied event pointer
buf Pointer to the destination buffer
len32 Number of 32 bit words available in buf
Returns:
Pointer to the next output location, or NULL if the compressed event will not fit

LCI_consignment* LCI_newConsignment unsigned  cpuid,
unsigned  srcid,
LCI_configuration cnf,
LCI_collection cll,
LSEC_compaction *  cpc
 

Allocate memory for an LCI_consigment structure and initialise (clear).

Parameters:
srcid ID of the data source
cpuid ID of the CPU LCI is being run on
cll Pointer to the collection of events to consign
cpc Pointer to the compaction state information
cnf Pointer to the configuration data
Returns:
Pointer to an allocated, initialised consignment (NULL if there is an error allocating memory)

unsigned int * LCI_poster void *  prm,
void *  buf,
int  bytes
 

Send the datagram to the SDI and get a new one from the FPA.

Parameters:
prm Pointer to the consignment structure
buf The buffer to post
bytes The number of bytes in the buffer
Returns:
Pointer to the next buffer to be filled.

WCT_time_sat LCI_prepare LCI_consignment cns,
unsigned  runid
 

Set the runid and start time for the first datagram of the new calibration.

Parameters:
cns Pointer to allocated, intialised consignment structure (from LCI_newConsignment)
runid 32-bit number identifying the calibration run
Returns:
The run start time (as a 64-bit Spectrum Astro time)

void LCI_setReason LCI_consignment cns,
int  reason
 

Set the current datagram close reason.

Parameters:
cns Pointer to the consignment structure
reason The reason code to be set

unsigned int * LCI_usrAdder void *  prm,
void *  usrInfo,
int  usrLen,
unsigned int *  buf,
unsigned int  len32
 

Add User Context Contribution at an arbitrary point in the event datagram.

Parameters:
prm Static user provided parameter
usrInfo Pointer to the information (or some representation of the information) to be written
usrLen Can be interpretted as the length of the information or can be used as an arbitrary 32-bit piece of information, i.e. it is just passed as is through to the user routine.
buf The buffer to accept the User Contribution data
len32 The number of 32-bit words available in buf. If the information does not fit in this space, return NULL.
Returns:
If the information fits in the alloted space, a pointer to the next output location to be filled or NULL if the information does not fit.


Generated on Mon Aug 27 02:39:18 2007 by  doxygen 1.4.4