GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LRA / V5-2-4 > lra / sun-gcc
#include <LRA_p.h>
#include <LRA/LRA_msgs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/FPA.h>
#include <PBS/SEM.h>
#include <ITC/ITC_pubdefs.h>
#include <string.h>
Classes | |
struct | _LRA_parmSend |
struct | _LRA_rqstData |
Typedefs | |
typedef struct _LRA_parmSend | LRA_parmSend |
typedef struct _LRA_rqstData | LRA_rqstData |
Functions | |
static unsigned | doRequest (LRA_rqstData *rqst) |
Local routine to send a request packet. | |
static void | rqstDone (ITC_QueueItem *qitem, unsigned status, void *prm0, void *prm1, void *prm2, unsigned tx) |
Local routine called after a request has been completed. | |
unsigned | LRA_send (const LRA_regSpec *rSpec) |
Send register values to the spacecraft. | |
unsigned | LRA_sendEsr (void) |
Send the error and status register values to the spacecraft. | |
unsigned | LRA_sendStats (void) |
Send statistics data to the spacecraft. | |
unsigned | LRA_process (void *prm, const ITC_QueueItem *qItem, void *pay, unsigned len) |
Process a received request. |
Because the LRA routines that send data to the spacecraft use internal non-shareable resources, they cannot be called directly by other code runnning on the LAT. They must always be executed within the LRA task. The routines in this module provide a callable interface to queue requests to the LRA task and wait for their completion.
$Id: LRA_process.c,v 1.7 2011/03/28 16:18:25 saxton Exp $
unsigned doRequest | ( | LRA_rqstData * | rqst | ) | [static] |
Local routine to send a request packet.
This routine queues a request to the LRA task, then waits for its completion.
rqst | The address of a request data packet |
ITC_SENDTID | Destination task (LRA) not started |
References LRA_getCtrl(), LRA_NUM_RQSTS, _LRA_control::rFcb, _LRA_control::rIndx, rqstDone(), _LRA_control::rRtn, _LRA_return::sem, and _LRA_return::status.
Referenced by LRA_send(), LRA_sendEsr(), and LRA_sendStats().
unsigned LRA_process | ( | void * | prm, | |
const ITC_QueueItem * | qItem, | |||
void * | pay, | |||
unsigned | len | |||
) |
Process a received request.
This routine runs within the LRA task and handles the queued raw requests for service.
prm | User parameter (not used) | |
qItem | The address of the queue item (not used) | |
pay | The address of the request payload | |
len | The length of the request payload (not used) |
LRA_INVFCODE | The received function code was invalid |
References LRA_doSend(), LRA_doSendEsr(), LRA_doSendStats(), LRA_FNC_SEND, LRA_FNC_SENDESR, and LRA_FNC_SENDSTATS.
Referenced by LRA_initialize().
unsigned LRA_send | ( | const LRA_regSpec * | rSpec | ) |
Send register values to the spacecraft.
A request is queued to the LRA task to read the specified registers and send them to the spacecraft via the SSR.
rSpec | The register specifier, specifying which register (or set of registers) is (are) to be read. This contains the component, the register block, the TEM number, cable controller number, readout controller number, front-end number, and register number. The latter five parameters may be set individually to the value LRA_WILD to cause all values to be used. |
LRA_SUCCESS | The read and send were successful | |
LRA_INVCMPT | Invalid component number | |
LRA_INVREG | Invalid register number | |
LRA_INVBLOCK | Invalid register block number | |
LRA_INVTEM | Invalid TEM number | |
LRA_INVCC | Invalid cable controller number | |
LRA_INVRC | Invalid readout controller number | |
LRA_INVFE | Invalid front-end number | |
LCBD_RTOERR | Operation timed out | |
ITC_SENDNID | Destination node not reachable | |
ITC_SENDPRX | Proxy task for destination node not started | |
ITC_SENDQID | Destination queue not available | |
ITC_SENDTID | Destination task (LRA) not started |
References doRequest(), and LRA_FNC_SEND.
unsigned LRA_sendEsr | ( | void | ) |
Send the error and status register values to the spacecraft.
A request is queued to the LRA task to read the contents of a pre- determined set of LAT error and status registers and send them to the spacecraft via the SSR.
LRA_SUCCESS | The read and send were successful | |
ITC_SENDNID | Destination node not reachable | |
ITC_SENDPRX | Proxy task for destination node not started | |
ITC_SENDQID | Destination queue not available | |
ITC_SENDTID | Destination task (LRA) not started |
References doRequest(), and LRA_FNC_SENDESR.
unsigned LRA_sendStats | ( | void | ) |
Send statistics data to the spacecraft.
A request is queued to the LRA task to send the statistics data block to the spacecraft via the SSR.
LRA_SUCCESS | The statistics were sent successfully | |
LRA_NOTINIT | LRA not initialized | |
ITC_SENDNID | Destination node not reachable | |
ITC_SENDPRX | Proxy task for destination node not started | |
ITC_SENDQID | Destination queue not available | |
ITC_SENDTID | Destination task not started |
References doRequest(), and LRA_FNC_SENDSTATS.
void rqstDone | ( | ITC_QueueItem * | qitem, | |
unsigned | status, | |||
void * | prm0, | |||
void * | prm1, | |||
void * | prm2, | |||
unsigned | tx | |||
) | [static] |
Local routine called after a request has been completed.
This routine is called by ITC after a request has been completed. It stores the return status and wakes the requesting task via a semaphore.
References _LRA_return::sem, and _LRA_return::status.
Referenced by doRequest(), and procUpdTimer().