GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LIH / V0-1-0

Constituent: lih     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LIH_limit.c File Reference

Control functions the ADC limit monitoring facility. More...

#include <string.h>
#include "CCSDS/CCSDS_pkt.h"
#include "CDM/CDM_pubdefs.h"
#include "LIH_DB/LIH_DB_ADCdefs.h"
#include "LIH_DB/LIH_DB_schema.h"
#include "MDB/MDB_pubdefs.h"
#include "LIH/LIH_msgs.h"
#include "LIH/LIH_tlmdefs.h"
#include "LIH_prvdefs.h"

Include dependency graph for LIH_limit.c:


Functions

static void freePacket_cb (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx)
 Clean up after sending an alert message.
static __inline unsigned int isInvalid (const LIH_DB_Limit *adc)
 Check an ADC limit set.
unsigned int LIH_limitAble (LIH_DB_ADC adx, unsigned int able)
 Disable limit checking on an ADC.
unsigned int LIH_limitAction (LIH_DB_ADC adx, LIH_DB_ADCState prv, LIH_DB_ADCState cur, unsigned int msk, unsigned int val)
 Change nag time for an ADC/state.
unsigned int LIH_limitCheck (LIH_Control *hcb, unsigned int adx, unsigned short *val, WCT_time_sat_u sat)
 Test ADC limits and take requested action.
unsigned int LIH_limitCheckCDM (LIH_DB_Schema *ldb)
 Check the contents of an LIH CDM database.
void LIH_limitExternalDefault (LIH_Control *hcb, LIH_DB_Schema *ldb)
 Use an external default limit set to initialize the limit table.
void LIH_limitExternalTable (LIH_Control *hcb, LIH_DB_Schema *ldb)
 Use an external default limit set to initialize the limit table.
void LIH_limitInternalDefault (LIH_Control *hcb)
 Use internal defaults to initialize the limit table.
unsigned int LIH_limitNag (LIH_DB_ADC adx, LIH_DB_ADCState state, unsigned int delta)
 Change nag time for an ADC/state.
unsigned int LIH_limitSendADC (LIH_DB_ADC adx)
 Send the limit set for an ADC via diagnostic telemetry.
unsigned int LIH_limitSet (LIH_DB_ADC adx, const signed short limit[LIH_DB_L_LIMIT])
 Set the limit boundaries for monitoring an ADC.

Variables

static const char * LIH_ADCStateString [LIH_DB_L_ADC_STATE]
 String constants for the various ADC limit states.
static const char * s_able [2] = { "disabled", "enabled" }
 Strings used in enable/disable error reporting.
static const char * s_pktType [2] = { "an alert", "a diagnostic" }
 Strings used in telemetry error reporting.

Detailed Description

Control functions the ADC limit monitoring facility.

CVS $Id: LIH_limit.c,v 1.3 2007/12/07 03:59:21 apw Exp $
Author:
A.P.Waite
LIH_limit.c provides all the control functions (enabling/disabling, setting limits and so on) for managing the ADC limit monitoring facility.

Function Documentation

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

Clean up after sending an alert message.

Parameters:
qitem (in) Queue item
status (in) Status from ITC_send()
prm0 (in) User param 0 (LIH control block)
prm1 (in) User param 1 (unused)
prm2 (in) User param 2 (unused)
tx (in) Failure during send phase of ITC_send() (unused)
freePacket_cb() is the callback routine that's called once a telemetry record has been delivered (a standard ITC completion routine).

static __inline unsigned int isInvalid const LIH_DB_Limit *  adc  )  [static]
 

Check an ADC limit set.

Parameters:
adc (in) An ADC limit set
Return values:
0 ADC limit definitions is valid
1 ADC limit definitions is not valid

unsigned int LIH_limitAble LIH_DB_ADC  adx,
unsigned int  able
 

Disable limit checking on an ADC.

Parameters:
adx (in) ADC index on which to disable limit checking
able (in) Enable/disable state (boolean, 1 => enable)

unsigned int LIH_limitAction LIH_DB_ADC  adx,
LIH_DB_ADCState  prv,
LIH_DB_ADCState  cur,
unsigned int  msk,
unsigned int  val
 

Change nag time for an ADC/state.

Parameters:
adx (in) ADC index on which to set set a nag time
prv (in) ADC state on previous read
cur (in) ADC state on current read
msk (in) Mask of actions to change
val (in) New values for masked bits

unsigned int LIH_limitCheck LIH_Control hcb,
unsigned int  adx,
unsigned short *  val,
WCT_time_sat_u  sat
 

Test ADC limits and take requested action.

Parameters:
hcb (in) Control block
adx (in) ADC index
val (in/out) ADC value
sat (in) ADC data acquisition timestamp (seconds since LAT epoch)
Return values:
0 Output of corresponding diagnostic packet -not- requested
1 Output of corresponding diagnostic packet -requested-

unsigned int LIH_limitCheckCDM LIH_DB_Schema *  ldb  ) 
 

Check the contents of an LIH CDM database.

Parameters:
ldb (in) Handle to the CDM database data

void LIH_limitExternalDefault LIH_Control hcb,
LIH_DB_Schema *  ldb
 

Use an external default limit set to initialize the limit table.

Parameters:
hcb (in) LIH control block
ldb (in) Handle to the CDM database data
Warning:
This routine does no validation. It assumes that the database file has already been validted using LIH_limitCheckCDM().
LIH_limitExternalDefault() uses the default limit set in the CDM to initialize all ADC limits to default values. If there is no default limit set in the CDM, this routine does nothing.

void LIH_limitExternalTable LIH_Control hcb,
LIH_DB_Schema *  ldb
 

Use an external default limit set to initialize the limit table.

Parameters:
hcb (in) LIH control block
ldb (in) Handle to the CDM database data
Warning:
This routine does no validation. It assumes that the database file has already been validated using LIH_limitCheckCDM().
LIH_limitExternalTable() uses the list of individual ADC limit sets in the CDM database to set up individual ADC limits. The list is allowed to be empty.

void LIH_limitInternalDefault LIH_Control hcb  ) 
 

Use internal defaults to initialize the limit table.

Parameters:
hcb (in) LIH control block

unsigned int LIH_limitNag LIH_DB_ADC  adx,
LIH_DB_ADCState  state,
unsigned int  delta
 

Change nag time for an ADC/state.

Parameters:
adx (in) ADC index on which to set set a nag time
state (in) ADC state on which to set set a nag time
delta (in) Interval between nags (seconds, 0 => don't nag)

unsigned int LIH_limitSendADC LIH_DB_ADC  adx  ) 
 

Send the limit set for an ADC via diagnostic telemetry.

Parameters:
adx (in) ADC index on which to disable limit checking

unsigned int LIH_limitSet LIH_DB_ADC  adx,
const signed short  limit[LIH_DB_L_LIMIT]
 

Set the limit boundaries for monitoring an ADC.

Parameters:
adx (in) ADC index on which to set limits
limit (in) New limit set (negative => leave value as is)


Variable Documentation

static const char LIH_ADCStateString[LIH_DB_L_ADC_STATE] [static]
 

Initial value:

 
{
    "undefined",
    "red low",
    "yellow low",
    "green",
    "yellow high",
    "red high"
}
String constants for the various ADC limit states.


Generated on Fri Dec 7 01:36:33 2007 by  doxygen 1.4.4