GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIH / dev > lih_test / rad750
#include <stdio.h>
#include <CCSDS/CCSDS_pkt.h>
#include <ITC/ITC_pubdefs.h>
#include <LIH/LIH_msgs.h>
#include <LIH/LIH_cmddefs.h>
#include <LIH_prvdefs.h>
Defines | |
#define | LIH_L_TESTPKT (256) |
Functions | |
unsigned char * | composeCommand (unsigned int func, unsigned int size) |
Start filling out a telecommand. | |
void | freePacket (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2) |
Free the LIH command "buffer". | |
void | LIH_dumpAdc (unsigned int adx) |
Immediate dump of the database entries for an ADC. | |
unsigned int | LIH_sendDumpLimits (unsigned int reason, unsigned int ident) |
Send command to dump the limits. | |
unsigned int | LIH_sendDumpLimitsAdc (unsigned int adx) |
Send command to dump the limits for a single ADC. | |
unsigned int | LIH_sendEnableActions (unsigned int state) |
Send command enable/disable taking action on limits. | |
unsigned int | LIH_sendSetActionsAdc (unsigned int adx, unsigned int from, unsigned int to, signed short alert, signed short diag, signed short msg) |
Send command enable/disable taking action on limits. | |
unsigned int | LIH_sendSetLimitsAdc (unsigned int adx, signed short zero, signed short one, signed short two, signed short three, signed short four, signed short five) |
Send command enable/disable taking action on limits. | |
unsigned int | LIH_sendSetNagTimesAdc (unsigned int adx, signed int zero, signed int one, signed int two, signed int three, signed int four, signed int five, signed int six, signed int seven) |
Send command enable/disable taking action on limits. | |
unsigned int | LIH_sendSetPersistAdc (unsigned int adx, signed int delta) |
Send command enable/disable taking action on limits. | |
unsigned int | LIH_sendSetSettleAdc (unsigned int adx, signed int delta) |
Send command enable/disable taking action on limits. | |
Variables | |
static unsigned int | LIH_lock |
Test packet interlock control. | |
static unsigned char | LIH_pkt [LIH_L_TESTPKT] |
Test packet buffer. | |
ITC_CommandItem | LIH_CmdLength [10] |
Annoying. Must be maintained by hand. |
CVS $Id: LIH_test.c,v 1.2 2011/03/29 22:38:00 apw Exp $
unsigned char * composeCommand | ( | unsigned int | func, | |
unsigned int | size | |||
) |
Start filling out a telecommand.
func | (in) Function code | |
size | (in) Command size |
NULL | Command buffer in use | |
x | Address of queue item |
References freePacket().
Referenced by LIH_sendDumpLimits(), LIH_sendDumpLimitsAdc(), LIH_sendEnableActions(), LIH_sendSetActionsAdc(), LIH_sendSetLimitsAdc(), LIH_sendSetNagTimesAdc(), LIH_sendSetPersistAdc(), and LIH_sendSetSettleAdc().
void freePacket | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
void * | prm0, | |||
void * | prm1, | |||
void * | prm2 | |||
) |
Free the LIH command "buffer".
qitem | (in) Queue item (unused) | |
status | (in) Processing completion code (unused) | |
prm0 | (in) User parameter 0 (unused) | |
prm1 | (in) User parameter 1 (unused) | |
prm2 | (in) User parameter 2 (unused) |
LIH_SUCCESS | Success |
Referenced by composeCommand(), LIH_sendDumpLimits(), LIH_sendDumpLimitsAdc(), LIH_sendEnableActions(), LIH_sendSetActionsAdc(), LIH_sendSetLimitsAdc(), LIH_sendSetNagTimesAdc(), LIH_sendSetPersistAdc(), and LIH_sendSetSettleAdc().
void LIH_dumpAdc | ( | unsigned int | adx | ) |
Immediate dump of the database entries for an ADC.
adx | (in) ADC index |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References _LIH_Control::enable, and _LIH_Control::tbl.
unsigned int LIH_sendDumpLimits | ( | unsigned int | reason, | |
unsigned int | ident | |||
) |
Send command to dump the limits.
reason | (in) Reason for generating this dump | |
ident | (in) User provided dump identifier |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References composeCommand(), freePacket(), _LIH_DumpLimits_Prm::ident, LIH_DUMPLIMITS_FCODE, _LIH_DumpLimits_Pkt::pay, and _LIH_DumpLimits_Prm::reason.
unsigned int LIH_sendDumpLimitsAdc | ( | unsigned int | adx | ) |
Send command to dump the limits for a single ADC.
adx | (in) ADC index |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References _LIH_DumpLimitsAdc_Prm::adx, composeCommand(), freePacket(), LIH_DUMPLIMITSADC_FCODE, and _LIH_DumpLimitsAdc_Pkt::pay.
unsigned int LIH_sendEnableActions | ( | unsigned int | state | ) |
Send command enable/disable taking action on limits.
state | (in) Enable/disable (boolean, 1 => enable) |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References composeCommand(), freePacket(), LIH_ENABLEACTIONS_FCODE, _LIH_EnableActions_Pkt::pay, and _LIH_EnableActions_Prm::state.
unsigned int LIH_sendSetActionsAdc | ( | unsigned int | adx, | |
unsigned int | from, | |||
unsigned int | to, | |||
signed short | alert, | |||
signed short | diag, | |||
signed short | msg | |||
) |
Send command enable/disable taking action on limits.
adx | (in) ADC index | |
from | (in) Previous state | |
to | (in) Next state | |
alert | (in) Action: generate an alert | |
diag | (in) Action: ping a housekeeping packet | |
msg | (in) Action: generate message (with severity) |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References _LIH_SetActionsAdc_Prm::adx, _LIH_SetActionsAdc_Prm::alert, composeCommand(), _LIH_SetActionsAdc_Prm::diag, freePacket(), _LIH_SetActionsAdc_Prm::from, LIH_SETACTIONSADC_FCODE, _LIH_SetActionsAdc_Prm::msg, _LIH_SetActionsAdc_Pkt::pay, and _LIH_SetActionsAdc_Prm::to.
unsigned int LIH_sendSetLimitsAdc | ( | unsigned int | adx, | |
signed short | zero, | |||
signed short | one, | |||
signed short | two, | |||
signed short | three, | |||
signed short | four, | |||
signed short | five | |||
) |
Send command enable/disable taking action on limits.
adx | (in) ADC index | |
zero | (in) limit[0] | |
one | (in) limit[1] | |
two | (in) limit[2] | |
three | (in) limit[3] | |
four | (in) limit[4] | |
five | (in) limit[5] |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References _LIH_SetLimitsAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETLIMITSADC_FCODE, _LIH_SetLimitsAdc_Prm::limit, and _LIH_SetLimitsAdc_Pkt::pay.
unsigned int LIH_sendSetNagTimesAdc | ( | unsigned int | adx, | |
signed int | zero, | |||
signed int | one, | |||
signed int | two, | |||
signed int | three, | |||
signed int | four, | |||
signed int | five, | |||
signed int | six, | |||
signed int | seven | |||
) |
Send command enable/disable taking action on limits.
adx | (in) ADC index | |
zero | (in) nag[0] | |
one | (in) nag[1] | |
two | (in) nag[2] | |
three | (in) nag[3] | |
four | (in) nag[4] | |
five | (in) nag[5] | |
six | (in) nag[6] | |
seven | (in) nag[7] |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References _LIH_SetNagTimesAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETNAGTIMESADC_FCODE, _LIH_SetNagTimesAdc_Prm::nag, and _LIH_SetNagTimesAdc_Pkt::pay.
unsigned int LIH_sendSetPersistAdc | ( | unsigned int | adx, | |
signed int | delta | |||
) |
Send command enable/disable taking action on limits.
adx | (in) ADC index | |
delta | (in) Delta persistence time |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References _LIH_SetPersistAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETPERSISTADC_FCODE, _LIH_SetPersistAdc_Pkt::pay, and _LIH_SetPersistAdc_Prm::persist.
unsigned int LIH_sendSetSettleAdc | ( | unsigned int | adx, | |
signed int | delta | |||
) |
Send command enable/disable taking action on limits.
adx | (in) ADC index | |
delta | (in) Delta persistence time |
LIH_GENERROR | Failure | |
LIH_SUCCESS | Success |
References _LIH_SetSettleAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETSETTLEADC_FCODE, _LIH_SetSettleAdc_Pkt::pay, and _LIH_SetSettleAdc_Prm::settle.
ITC_CommandItem LIH_CmdLength[10] |
Initial value:
{ { 0 , 8, NULL }, { 1 , 12, NULL }, { 2 , 10, NULL }, { 3 , 22, NULL }, { 4 , 20, NULL }, { 5 , 44, NULL }, { 6 , 16, NULL }, { 7 , 16, NULL }, { 8 , 10, NULL }, { 9 , 16, NULL } }