GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LHK / V12-2-4 > lhk / rhel5-64
#include <string.h>
#include <ITC/ITC_apidefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LHK/LHK_msgs.h>
#include <MDB/MDB_pubdefs.h>
#include <PBS/FFS.ih>
#include <PBS/INT.ih>
#include <PBS/MBA.h>
#include <PBS/WCT.h>
#include <LHK_prvdefs.h>
Functions | |
static WUT_cb_status | expireTimer (void *prm, WUT_tmr *wut) |
Timer callback to produce a diagnostic packet. | |
static FORK_cb_status | forkBlip (FORK_cb_prm *prm, FORK_msg_hdr *hdr) |
Task level target of the diagnostic timer interrupt. | |
static FORK_cb_status | forkTimer (FORK_cb_prm *prm, FORK_msg_hdr *hdr) |
Task level target of the diagnostic timer interrupt. | |
static void | freePacket (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx) |
An ITC completion routine to free a queue item after use. | |
static void | initializePacket (void *prm, void *pkt, int siz, int off) |
Initialize the ITC elements of diagnostic packets. | |
static LHK_PacketStatus | noPacket (void *prm, unsigned int abas, unsigned int aidx, unsigned int seq, unsigned char *out) |
If a packet is not defined, then requests for that packet come here. | |
static unsigned int | sendDiagnostic (unsigned int aidx) |
Timer callback to produce a diagnostic packet. | |
unsigned int | LHK_diagnosticCancel (unsigned int aidx) |
Cancel a diagnostic packet request. | |
unsigned int | LHK_diagnosticInitialize (LHK_Control *lcb) |
Initialize the resources needed to produce diagnostic packets. | |
unsigned int | LHK_diagnosticRequest (unsigned int aidx, unsigned int count, unsigned int delta) |
Cancel a diagnostic packet request. | |
unsigned int | LHK_diagnosticStart (unsigned int aidx, unsigned int count, unsigned int delta) |
Service a diagnostic packet request. | |
Variables | |
LHK_Packet | LHK_packet [ITC_L_APID_HOUSE] |
Packet description and control data, per APID. | |
unsigned int | LHK_noPacketDiagnostic [ITC_L_APID_HOUSE] |
Counters/timeouts for undefined diagnostic packets. | |
unsigned int | LHK_noPacketHousekeeping [ITC_L_APID_HOUSE] |
Counters/timeouts for undefined diagnostic packets. |
CVS $Id: LHK_diagnostic.c,v 1.3 2011/03/29 01:45:00 apw Exp $
static WUT_cb_status expireTimer | ( | void * | prm, | |
WUT_tmr * | wut | |||
) | [static] |
Timer callback to produce a diagnostic packet.
prm | (in) User parameter (unused) | |
wut | (in) Wake-up timers |
References forkTimer(), _LHK_Control::fqi, _LHK_Timeout::frk, and _LHK_Control::msg.
Referenced by LHK_diagnosticStart().
static FORK_cb_status forkBlip | ( | FORK_cb_prm * | prm, | |
FORK_msg_hdr * | hdr | |||
) | [static] |
Task level target of the diagnostic timer interrupt.
prm | (in) Fork parameter (unused) | |
hdr | (in) Pointer to message |
References _LHK_Blip::aidx, _LHK_Control::bpa, LHK_diagnosticStart(), and LHK_lcb.
Referenced by LHK_diagnosticRequest().
static FORK_cb_status forkTimer | ( | FORK_cb_prm * | prm, | |
FORK_msg_hdr * | hdr | |||
) | [static] |
Task level target of the diagnostic timer interrupt.
prm | (in) Fork parameter (unused) | |
hdr | (in) Pointer to message (unused) |
References _LHK_Control::active, _LHK_Control::aidx, _LHK_Packet::alarm, _LHK_Packet::count, _LHK_Packet::delta, LHK_lcb, _LHK_Packet::noend, sendDiagnostic(), and _LHK_Control::tmr.
Referenced by expireTimer().
static void freePacket | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
void * | prm0, | |||
void * | prm1, | |||
void * | prm2, | |||
unsigned int | tx | |||
) | [static] |
An ITC completion routine to free a queue item after use.
qitem | (in) Queue item | |
status | (in) Status from ITC | |
prm0 | (in) User param 0 (LHK control block) | |
prm1 | (in) User param 1 (unused) | |
prm2 | (in) User param 2 (unused) | |
tx | (in) Failure during send phase of ITC_send() (unused) |
References _LHK_Control::dpa.
Referenced by initializePacket().
static void initializePacket | ( | void * | prm, | |
void * | pkt, | |||
int | siz, | |||
int | off | |||
) | [static] |
Initialize the ITC elements of diagnostic packets.
prm | (in) User parameter (actually the LHK control block pointer) | |
pkt | (in) Packet pointer | |
siz | (in) Packet size (unused) | |
off | (in) Offset to packet control structure (unused) |
References freePacket().
Referenced by LHK_diagnosticInitialize().
unsigned int LHK_diagnosticCancel | ( | unsigned int | aidx | ) |
Cancel a diagnostic packet request.
aidx | (in) Diagnostic packet APID index (repeat, index) |
References _LHK_Control::active, _LHK_Packet::alarm, _LHK_Packet::count, _LHK_Packet::delta, LHK_lcb, and _LHK_Packet::noend.
Referenced by LHK_CancelDiag(), and LHK_StopDiag().
unsigned int LHK_diagnosticInitialize | ( | LHK_Control * | lcb | ) |
Initialize the resources needed to produce diagnostic packets.
lcb | (in) LHK control block |
References _LHK_Control::aidx, _LHK_Control::bpa, _LHK_Control::dpa, initializePacket(), LHK_definePacket(), noPacket(), and _LHK_Control::tmr.
Referenced by LHK_initialize().
unsigned int LHK_diagnosticRequest | ( | unsigned int | aidx, | |
unsigned int | count, | |||
unsigned int | delta | |||
) |
Cancel a diagnostic packet request.
aidx | (in) Diagnostic packet APID index (repeat, index) | |
count | (in) Number of packets to send (zero implies "forever") | |
delta | (in) Interval between packets (milliseconds) |
LHK_BADAIDX | Invalid APID index | |
LHK_DIAGTIME | Must specify a repetition time (unless count is zero) | |
LHK_SUCCESS | Success |
References _LHK_Blip::aidx, _LHK_Control::dpa, forkBlip(), _LHK_Control::fqi, _LHK_Blip::frk, and LHK_lcb.
unsigned int LHK_diagnosticStart | ( | unsigned int | aidx, | |
unsigned int | count, | |||
unsigned int | delta | |||
) |
Service a diagnostic packet request.
aidx | (in) Diagnostic packet APID index (repeat, index) | |
count | (in) Number of packets to send (zero implies "forever") | |
delta | (in) Interval between packets (milliseconds) |
LHK_BADAIDX | Invalid APID index | |
LHK_DIAGSEND | Send of diagnostic packet failed | |
LHK_DIAGTIME | Must specify a repetition time (unless count is zero) | |
LHK_SUCCESS | Success |
The exception is for a count of one. This will never alter the parameters of a diagnostic packet already being produced. The idea here is that a singleton request might come internally from software (e.g. as part of the response to some other command that changes the contents of one of these packets). The software request is essentially orthogonal to a "commanded" request, so the software request should not interfere with "commanded" request.
References _LHK_Control::active, _LHK_Control::aidx, _LHK_Packet::alarm, _LHK_Packet::count, _LHK_Packet::delta, expireTimer(), LHK_lcb, _LHK_Packet::noend, sendDiagnostic(), and _LHK_Control::tmr.
Referenced by forkBlip(), and LHK_ReqDiagPacket().
static LHK_PacketStatus noPacket | ( | void * | prm, | |
unsigned int | abas, | |||
unsigned int | aidx, | |||
unsigned int | seq, | |||
unsigned char * | out | |||
) | [static] |
If a packet is not defined, then requests for that packet come here.
prm | (in) User parameter (varies by housekeeping/diagnostic mode) | |
abas | (in) Base of APID table (ITC_K_APID_HOUSE or ITC_K_APID_DIAG) | |
aidx | (in) APID index | |
seq | (in) CCSDS sequence count | |
out | (in) Output buffer |
References LHK_PKT_TIMEOUT.
Referenced by LHK_diagnosticInitialize().
static unsigned int sendDiagnostic | ( | unsigned int | aidx | ) | [static] |
Timer callback to produce a diagnostic packet.
aidx | (in) Diagnostic packet APID index (repeat, index) |
LHK_ALLOCPKT | Cannot allocate diagnostic packet | |
LHK_DIAGSEND | Cannot send diagnostic packet | |
LHK_SUCCESS | Success |
References _LHK_Packet::dia, _LHK_Control::dpa, LHK_lcb, LHK_PKT_TIMEOUT, and _LHK_Packet::rtn.
Referenced by forkTimer(), and LHK_diagnosticStart().