GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LHK / V12-0-4

Constituent: lhk     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LHK_diagnostic.c File Reference

Facilities to run housekeeping packets as demand diagnostics. More...

#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"

Include dependency graph for LHK_diagnostic.c:


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.

Detailed Description

Facilities to run housekeeping packets as demand diagnostics.

CVS $Id: LHK_diagnostic.c,v 1.1 2007/10/28 23:38:19 apw Exp $
Author:
A.P.Waite
LHK_diagnostic.c provides the facilities to generate housekeeping packets as diagnostic packets on a different cadence to the regular housekeeping schedule. Think of it as "demand houekeeping". Such diagnostic packets can be requested as a one-shot, or repetitively. For repetitive requests, both the repetition count and period can be specified.

Function Documentation

static WUT_cb_status expireTimer void *  prm,
WUT_tmr *  wut
[static]
 

Timer callback to produce a diagnostic packet.

Parameters:
prm (in) User parameter (unused)
wut (in) Wake-up timers

static FORK_cb_status forkBlip FORK_cb_prm *  prm,
FORK_msg_hdr *  hdr
[static]
 

Task level target of the diagnostic timer interrupt.

Parameters:
prm (in) Fork parameter (unused)
hdr (in) Pointer to message

static FORK_cb_status forkTimer FORK_cb_prm *  prm,
FORK_msg_hdr *  hdr
[static]
 

Task level target of the diagnostic timer interrupt.

Parameters:
prm (in) Fork parameter (unused)
hdr (in) Pointer to message (unused)

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.

Parameters:
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)
freePacket() is the callback routine that's called once a diagnostic packet has been delivered to the spacecraft across the CTDB (a standard ITC completion routine).

static void initializePacket void *  prm,
void *  pkt,
int  siz,
int  off
[static]
 

Initialize the ITC elements of diagnostic packets.

Parameters:
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)

unsigned int LHK_diagnosticCancel unsigned int  aidx  ) 
 

Cancel a diagnostic packet request.

Parameters:
aidx (in) Diagnostic packet APID index (repeat, index)
LHK_cancelDiagnostic() cancels a request to send a diagnostic packet.

unsigned int LHK_diagnosticInitialize LHK_Control lcb  ) 
 

Initialize the resources needed to produce diagnostic packets.

Parameters:
lcb (in) LHK control block

unsigned int LHK_diagnosticRequest unsigned int  aidx,
unsigned int  count,
unsigned int  delta
 

Cancel a diagnostic packet request.

Parameters:
aidx (in) Diagnostic packet APID index (repeat, index)
count (in) Number of packets to send (zero implies "forever")
delta (in) Interval between packets (milliseconds)
Return values:
LHK_BADAIDX Invalid APID index
LHK_DIAGTIME Must specify a repetition time (unless count is zero)
LHK_SUCCESS Success
LHK_diagnosticRequest() builds a request for a diagnostic packet, which will be queued, like a command, to the housekeeping task.

unsigned int LHK_diagnosticStart unsigned int  aidx,
unsigned int  count,
unsigned int  delta
 

Service a diagnostic packet request.

Parameters:
aidx (in) Diagnostic packet APID index (repeat, index)
count (in) Number of packets to send (zero implies "forever")
delta (in) Interval between packets (milliseconds)
Return values:
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
LHK_startDiagnostic() services a request to send a diagnostic packet. With the exception noted below, a request for a diagnostic packet that is already being produced will overwrite the previous settings (of count and delta) for that packet.

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.

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.

Parameters:
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

static unsigned int sendDiagnostic unsigned int  aidx  )  [static]
 

Timer callback to produce a diagnostic packet.

Parameters:
aidx (in) Diagnostic packet APID index (repeat, index)
Return values:
LHK_ALLOCPKT Cannot allocate diagnostic packet
LHK_DIAGSEND Cannot send diagnostic packet
LHK_SUCCESS Success


Generated on Mon Nov 5 04:41:34 2007 by  doxygen 1.4.4