GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / dev > latc_wb / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

record_p.h File Reference

Functions to package up the IMM and send it to file or the SSR. More...

#include <record.h>
#include <enums_p.h>
#include <ITC/ITC_pubdefs.h>
#include <LSF/LSF.h>

Classes

struct  SSR_pkt
 State information used whilst constructing a datagram. More...

Defines

#define LCI_CTB_TYPE(base_, type_)   (base_ + type_)
 Caclulate the contribution type from the LAT component type and the contribution class.

Functions

void initPkt (SSR_pkt *pkt, FPA_fcb *fpa)
 Get a new packet and fill in the header information.
unsigned sendPkt (SSR_pkt *pkt, FPA_fcb *fpa)
 Hand the datagram off to ITC for transmission to the SSR.
unsigned startCtb (SSR_pkt *pkt, FPA_fcb *fpa, size_t size, unsigned type)
 Start a new contribution by inserting a new contribution header, possibly after sending out the current packet and starting a new one if there is insufficient space in the current datagram for the new contribution.
void endCtb (SSR_pkt *pkt)
 Finish off the contribution by padding to the next 32 bit boundary and updating all the contribution and datagram length fields.
void addData (SSR_pkt *pkt, void *data, size_t size)
 Copy a chunk of data into the datagram.
void LATC_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.


Detailed Description

Functions to package up the IMM and send it to file or the SSR.

Author:
James Swain -- jswain@slac.stanford.edu

Function Documentation

void addData ( SSR_pkt pkt,
void *  data,
size_t  size 
)

Copy a chunk of data into the datagram.

Parameters:
pkt Pointer to the state information for the qitem
data Pointer to the data to copy into the datagram
size Size of the data (in bytes) to copy)

References SSR_pkt::ctb_size, SSR_pkt::dat, SSR_pkt::pay_size, and SSR_pkt::rem.

Referenced by LATC_record().

void endCtb ( SSR_pkt pkt  ) 

Finish off the contribution by padding to the next 32 bit boundary and updating all the contribution and datagram length fields.

Parameters:
pkt Pointer to the state information for the qitem

References SSR_pkt::ctb, SSR_pkt::ctb_size, SSR_pkt::dat, SSR_pkt::dgm, SSR_pkt::pay_size, and SSR_pkt::rem.

Referenced by LATC_record().

void initPkt ( SSR_pkt pkt,
FPA_fcb *  fpa 
)

Get a new packet and fill in the header information.

Parameters:
pkt Pointer to the state information of this qitem
fpa Pointer to the FPA that will provide the storage for this qitem

References SSR_pkt::ccsds, SSR_pkt::dat, SSR_pkt::dgm, SSR_pkt::pay_size, SSR_pkt::qitem, and SSR_pkt::rem.

Referenced by LATC_record(), and startCtb().

void LATC_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

Referenced by sendPkt().

unsigned sendPkt ( SSR_pkt pkt,
FPA_fcb *  fpa 
)

Hand the datagram off to ITC for transmission to the SSR.

Parameters:
pkt Pointer to the state information for this qitem
fpa Pointer to the fixed packet allocator that provides the storage for these packets
Returns:
MSG code returned from the call to ITC send.

References SSR_pkt::ccsds, SSR_pkt::dgm, LATC_cb_dgmFree(), SSR_pkt::pay_size, and SSR_pkt::qitem.

Referenced by LATC_record(), and startCtb().

unsigned startCtb ( SSR_pkt pkt,
FPA_fcb *  fpa,
size_t  size,
unsigned  type 
)

Start a new contribution by inserting a new contribution header, possibly after sending out the current packet and starting a new one if there is insufficient space in the current datagram for the new contribution.

Parameters:
pkt Pointer to the state information for the qitem
fpa Pointer to the fixed packet allocator that provides the storage for these packets
size Size of the contribution (less header) in bytes
type Contribution type ID (a combination of the contribution class - map or data - and component type)
Returns:
An error from the ITC send, LATC_OUTSIZE if the contribution cannot fit into an otherwise empty datagram or LATC_SUCCESS if all goes well.

References SSR_pkt::ctb, SSR_pkt::ctb_size, SSR_pkt::dat, initPkt(), SSR_pkt::pay_size, SSR_pkt::qitem, SSR_pkt::rem, and sendPkt().

Referenced by LATC_record().


Generated on Thu Apr 7 17:39:14 2011 by  doxygen 1.5.8