GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCFG / V1-2-3

Constituent: lcfg     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LCFG_record.c File Reference

Functions for sending a RIM to the SSR. More...

#include "LCFG_p.h"
#include "LCFG/LCFG_msgs.h"
#include "RIM/RIM.h"
#include "LSF/LSF_ids.h"
#include "CCSDS/CCSDS_pkt.h"
#include "ITC/ITC_pubdefs.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/WCT.h"
#include <string.h>

Include dependency graph for LCFG_record.c:


Data Structures

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

Enumerations

enum  { LCFG_SSR_APID = 0x3fd }
 APID to use for data sent to the SSR.

Functions

static void freeDgm (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.
static void startDgm (SSR_pkt *pkt)
 Start a datagram.
static unsigned endDgm (SSR_pkt *pkt)
 Finish a datagram.
static unsigned startCtb (void *ctl, unsigned type, int size)
 Start a new contribution.
static unsigned addData (void *ctl, void *data, int size)
 Copy data into the datagram.
unsigned LCFG_record (RIM *rim, FPA_fcb *fpa)
 Send the RIM to the SSR.

Detailed Description

Functions for sending a RIM to the SSR.

Author:
James Swain & Owen Saxton
Id
LCFG_record.c,v 1.2 2007/11/12 22:27:55 saxton Exp

Function Documentation

unsigned addData void *  ctl,
void *  data,
int  size
[static]
 

Copy data into the datagram.

This routine is designed to work in conjunction with RIM_export and is called whenever there is data to be added to the current record. It just copies the data to the datagram after checking whether it overflows the record (contribution).

Parameters:
ctl Pointer to an SSR_pkt
data Pointer to the data to copy into the datagram
size Size of the data (in bytes) to copy)
Return values:
LCFG_SUCCESS Success
LCFG_RECDOFL Data overflows current record

unsigned endDgm SSR_pkt pkt  )  [static]
 

Finish a datagram.

This routine sends the datagram to the SSR and reports any errors.

Parameters:
pkt Pointer to an SSR_pkt
Return values:
LCFG_SUCCESS Success
ITC_xxxx If any ITC error

void freeDgm ITC_QueueItem *  qitem,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2,
unsigned int  tx
[static]
 

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

It 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 LCFG_record RIM *  rim,
FPA_fcb *  fpa
 

Send the RIM to the SSR.

Parameters:
rim Pointer to the RIM structure to send to the SSR
fpa Pointer to the fixed packet allocator that will provide storage for the datagrams produced by this function
Returns:
One of the error codes from ITC_send, LCFG_OUTSIZE if there is a coding error and one of the contributions will not fit into an otherwise empty datagram, LCFG_SUCCESS if all goes well.

unsigned startCtb void *  ctl,
unsigned  type,
int  size
[static]
 

Start a new contribution.

This routine is designed to work in conjunction with RIM_export and is called when a new record is to be started. A new contribution header is inserted into the datagram, possibly after sending out the current datagram and starting a new one if there is insufficient space in the current datagram for the new contribution

Parameters:
ctl Pointer to an SSR_pkt
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)
Return values:
LCFG_SUCCESS Success
LCFG_OUTSIZE Contribution cannot fit into empty datagram
ITC_xxxx Error from ITC_send

void startDgm SSR_pkt pkt  )  [static]
 

Start a datagram.

This routine gets a new packet and fills in the header information

Parameters:
pkt Pointer to an SSR_pkt


Generated on Wed Apr 22 01:15:36 2009 by  doxygen 1.4.4