GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCFG / V1-2-5 > lcfg / mv2304
#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>
Classes | |
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. |
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).
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) |
LCFG_SUCCESS | Success | |
LCFG_RECDOFL | Data overflows current record |
References SSR_pkt::ctb_rem, and SSR_pkt::dat.
Referenced by LCFG_record().
unsigned endDgm | ( | SSR_pkt * | pkt | ) | [static] |
Finish a datagram.
This routine sends the datagram to the SSR and reports any errors.
pkt | Pointer to an SSR_pkt |
LCFG_SUCCESS | Success | |
ITC_xxxx | If any ITC error |
References SSR_pkt::ccsds, SSR_pkt::fpa, freeDgm(), SSR_pkt::pay_size, and SSR_pkt::qitem.
Referenced by LCFG_record().
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.
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 endDgm().
unsigned LCFG_record | ( | RIM * | rim, | |
FPA_fcb * | fpa | |||
) |
Send the RIM to the SSR.
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 |
References addData(), endDgm(), SSR_pkt::fpa, SSR_pkt::qitem, startCtb(), and startDgm().
Referenced by LCFG_consign().
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
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) |
LCFG_SUCCESS | Success | |
LCFG_OUTSIZE | Contribution cannot fit into empty datagram | |
ITC_xxxx | Error from ITC_send |
References SSR_pkt::ctb, SSR_pkt::ctb_rem, SSR_pkt::dat, SSR_pkt::dgm, SSR_pkt::fpa, SSR_pkt::pay_rem, SSR_pkt::pay_size, and SSR_pkt::qitem.
Referenced by LCFG_record().
void startDgm | ( | SSR_pkt * | pkt | ) | [static] |
Start a datagram.
This routine gets a new packet and fills in the header information
pkt | Pointer to an SSR_pkt |
References SSR_pkt::ccsds, SSR_pkt::dat, SSR_pkt::dgm, SSR_pkt::fpa, LCFG_DATAGRAM_SIZE, SSR_pkt::pay_rem, SSR_pkt::pay_size, and SSR_pkt::qitem.
Referenced by LCFG_record().