GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > ITC / V3-5-4

Constituent: itc     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

ITC_drvdefs.h File Reference

Driver definitions for the ITC package. More...

#include "PBS/FORK.h"
#include "ITC/ITC_pubdefs.h"

Include dependency graph for ITC_drvdefs.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  _ITC_Map
 Structure to hold node/task proxies for foreign nodes. More...

Defines

#define ITC_PRT_K_SNID   (3)
#define ITC_PRT_K_STID   (5)
#define ITC_PRT_K_DNID   (3)
#define ITC_PRT_K_DTID   (5)
#define ITC_PRT_K_DQID   (3)
#define ITC_PRT_K_PNID   (3)
#define ITC_PRT_K_DID   (2)
#define ITC_PRT_K_PID   (2)
#define ITC_PRT_K_RSV   (4)
#define ITC_PRT_K_VER   (2)
#define ITC_PRT_V_SNID   ( 0 )
#define ITC_PRT_V_STID   ( ITC_PRT_V_SNID + ITC_PRT_K_SNID )
#define ITC_PRT_V_DNID   ( ITC_PRT_V_STID + ITC_PRT_K_STID )
#define ITC_PRT_V_DTID   ( ITC_PRT_V_DNID + ITC_PRT_K_DNID )
#define ITC_PRT_V_DQID   ( ITC_PRT_V_DTID + ITC_PRT_K_DTID )
#define ITC_PRT_V_PNID   ( ITC_PRT_V_DQID + ITC_PRT_K_DQID )
#define ITC_PRT_V_DID   ( ITC_PRT_V_PNID + ITC_PRT_K_PNID )
#define ITC_PRT_V_PID   ( ITC_PRT_V_DID + ITC_PRT_K_DID )
#define ITC_PRT_V_RSV   ( ITC_PRT_V_PID + ITC_PRT_K_PID )
#define ITC_PRT_V_VER   ( ITC_PRT_V_RSV + ITC_PRT_K_RSV )
#define ITC_PRT_M_SNID   (((1 << ITC_PRT_K_SNID ) - 1) << ITC_PRT_V_SNID )
#define ITC_PRT_M_STID   (((1 << ITC_PRT_K_STID ) - 1) << ITC_PRT_V_STID )
#define ITC_PRT_M_DNID   (((1 << ITC_PRT_K_DNID ) - 1) << ITC_PRT_V_DNID )
#define ITC_PRT_M_DTID   (((1 << ITC_PRT_K_DTID ) - 1) << ITC_PRT_V_DTID )
#define ITC_PRT_M_DQID   (((1 << ITC_PRT_K_DQID ) - 1) << ITC_PRT_V_DQID )
#define ITC_PRT_M_PNID   (((1 << ITC_PRT_K_PNID ) - 1) << ITC_PRT_V_PNID )
#define ITC_PRT_M_DID   (((1 << ITC_PRT_K_DID ) - 1) << ITC_PRT_V_DID )
#define ITC_PRT_M_PID   (((1 << ITC_PRT_K_PID ) - 1) << ITC_PRT_V_PID )
#define ITC_PRT_M_RSV   (((1 << ITC_PRT_K_RSV ) - 1) << ITC_PRT_V_RSV )
#define ITC_PRT_M_VER   (((1 << ITC_PRT_K_VER ) - 1) << ITC_PRT_V_VER )

Typedefs

typedef unsigned int ITC_cb_Dispatch (void *prm, const ITC_QueueItem *qitem, void *qipay, unsigned int qilen)
 Signature for an ITC dispatch plug-in routine.
typedef _ITC_Map ITC_Map
 Typedef for struct _ITC_Map.

Functions

void * ITC_allocFromQueue (ITC_Queue *queue, unsigned int siz, ITC_cb_Completion **rtn, void **cb0, void **cb1, void **cb2)
 Allocate memory from a queue.
unsigned int ITC_convertDispatch (ITC_Task *task, ITC_QueueID qid, ITC_cb_Dispatch *rtn, void *prm)
 Modify the task dispatch routine with a new plug-in.
void ITC_copyCmdConfirm (ITC_Task *task, const char *cmd, WCT_time tim)
 Make a copy of a spacecraft command.
FORK_que * ITC_getForkQueueHandle (ITC_TaskID tid, ITC_QueueID qid)
 Return the fork queue handle for the given task/queue.
unsigned int ITC_getPacketProtocol (const ITC_QueueItem *qitem)
 Return the complete ITC protocol word.
unsigned int ITC_insertMap (unsigned int nim, ITC_TaskID tid)
 Insert entries into the ITC node map.
ITC_QueueITC_mapApid2Queue (unsigned short apid, ITC_TaskID *tid, ITC_QueueID *qid, unsigned int *scb)
 Return queue handle corresponding to APID.
ITC_QueueITC_mapDst2Queue (unsigned int itc)
 Return queue handle corresponding to destination task/queue IDs.
unsigned int ITC_redirectApid (unsigned int APID, ITC_TaskID ntid, ITC_QueueID nqid, ITC_TaskID *otid, ITC_QueueID *oqid)
 Redirect APID dispatch to a new task/queue.
unsigned int ITC_removeMap (unsigned int nim)
 Remove entries from the ITC node map.
unsigned int ITC_revertDispatch (ITC_Task *task, ITC_QueueID qid)
 Revert the task dispatch routine to the default plug-in.
void ITC_sendCmdConfirm (ITC_Task *task, const char *cmd, unsigned int scb, WCT_time dtim, WCT_time xtim, unsigned int status)
 Send a telecommand execution status reponse.
ITC_NodeID ITC_setPacketSrcNodeID (ITC_QueueItem *qitem, ITC_NodeID nid)
 Set the source node ID for the given queue item.
ITC_TaskID ITC_setPacketSrcTaskID (ITC_QueueItem *qitem, ITC_TaskID tid)
 Set the source task ID for the given queue item.

Detailed Description

Driver definitions for the ITC package.

CVS $Id: ITC_drvdefs.h,v 1.5 2005/05/03 20:14:21 apw Exp $
Author:
A.P.Waite
ITC_drvdefs.h defines a number of auxiliary entry points for use by driver level code.

Warning:
The entry points defined here are intended for use by hardware drivers (or their surrogates) only. Standard application code should have no reason to call these entry points.

Function Documentation

void* ITC_allocFromQueue ITC_Queue queue,
unsigned int  siz,
ITC_cb_Completion **  rtn,
void **  cb0,
void **  cb1,
void **  cb2
 

Allocate memory from a queue.

Parameters:
queue (in) Queue handle
siz (in) Bytes to allocate
rtn (out) Memory deallocation callback routine
cb0 (out) Memory deallocation callback routine parameter 0
cb1 (out) Memory deallocation callback routine parameter 1
cb2 (out) Memory deallocation callback routine parameter 2
Return values:
NULL Memory not allocated
x Pointer to allocated memory

unsigned int ITC_convertDispatch ITC_Task task,
ITC_QueueID  qid,
ITC_cb_Dispatch rtn,
void *  prm
 

Modify the task dispatch routine with a new plug-in.

Parameters:
task (in) Task handle
qid (in) Queue ID
rtn (in) Plug-in routine
prm (in) Plug-in routine parameter
Warning:
Caller is responsible for ensuring the persistence and validity of the context parameter. This routine only captures pointers.
Return values:
ITC_CTLSTAT ITC control block not in state initialized
ITC_NOTINIT ITC control block does not exist
ITC_QUEUSTAT Queue not in state initialized
ITC_SUCCESS Success
ITC_TASKDISP NULL dispatch routine specified
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Invalid task state for this operation
ITC_TASKTYP Invalid call for a lightweight task
ITC_VARRNG Out of range variable detected

void ITC_copyCmdConfirm ITC_Task task,
const char *  cmd,
WCT_time  tim
 

Make a copy of a spacecraft command.

Parameters:
task (in) Task handle
cmd (in) Pointer to CCSDS telecommand
tim (in) Time command was dequeued
ITC_copyCmdConfirm() makes a copy of a spacecraft command before any damage can be done to it by the command callback routine.

FORK_que* ITC_getForkQueueHandle ITC_TaskID  tid,
ITC_QueueID  qid
 

Return the fork queue handle for the given task/queue.

Parameters:
tid (in) Task ID
qid (in) Queue ID
Return values:
NULL Error (no such task, no such queue, task not started)
x The fork queue handle
ITC_getForkQueueHandle() returns the fork queue handle for task tid, queue qid.

Warning:
Fork queue handles are only known for ITC tasks in state "started".

unsigned int ITC_getPacketProtocol const ITC_QueueItem qitem  ) 
 

Return the complete ITC protocol word.

Parameters:
qitem (in) Queue item
Returns:
The complete ITC protocol word

unsigned int ITC_insertMap unsigned int  nim,
ITC_TaskID  tid
 

Insert entries into the ITC node map.

Parameters:
nim (in) Mask of nodes to be mapped to the given task ID
tid (in) Task ID that will serve as proxy for the listed nodes
Return values:
ITC_CTLSTAT ITC control block not in state initialized
ITC_NOTINIT ITC system not initialized
ITC_SUCCESS Success
ITC_insertMap() puts proxy node/task entries into the ITC node map.

ITC_Queue* ITC_mapApid2Queue unsigned short  APID,
ITC_TaskID tid,
ITC_QueueID qid,
unsigned int *  scb
 

Return queue handle corresponding to APID.

Parameters:
APID (in) Application ID
tid (out) Task ID
qid (out) Queue ID
scb (out) Is broadcast command (0/1 => not broadcast/broadcast)
Return values:
NULL No mapping possible
x Queue handle

ITC_Queue* ITC_mapDst2Queue unsigned int  itcp  ) 
 

Return queue handle corresponding to destination task/queue IDs.

Parameters:
itcp (in) ITC protocol word
Return values:
NULL No mapping possible
x Queue handle

unsigned int ITC_redirectApid unsigned int  APID,
ITC_TaskID  ntid,
ITC_QueueID  nqid,
ITC_TaskID otid,
ITC_QueueID oqid
 

Redirect APID dispatch to a new task/queue.

Parameters:
APID (in) APID to redirect
ntid (in) New task destination of APID dispatch
nqid (in) New queue destination of APID dispatch
otid (out) Old task destination of APID dispatch
oqid (out) Old queue destination of APID dispatch
Return values:
ITC_CTLSTAT ITC control block not in state initialized
ITC_NOTINIT ITC control block does not exist
ITC_RAWDBL Raw protocol handler for this queue already defined
ITC_RAWRTN Cannot specify a NULL routine
ITC_QUEUSTAT Queue not in state initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Invalid task state for this operation
ITC_VARRNG Out of range variable detected

unsigned int ITC_removeMap unsigned int  nim  ) 
 

Remove entries from the ITC node map.

Parameters:
nim (in) Mask of nodes to be mapped
Return values:
ITC_CTLSTAT ITC control block not in state initialized
ITC_NOTINIT ITC system not initialized
ITC_SUCCESS Success
ITC_removeMap() removes proxy node/task entries from the ITC node map.

unsigned int ITC_revertDispatch ITC_Task task,
ITC_QueueID  qid
 

Revert the task dispatch routine to the default plug-in.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
ITC_APIDRNG Invalid APID
ITC_APIDTBL No APID table entry for APID
ITC_CTLSTAT ITC control block not in state initialized
ITC_NOTINIT ITC control block does not exist
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Invalid task state for this operation
ITC_TASKTYP Invalid call for a lightweight task
ITC_VARRNG Out of range variable detected

void ITC_sendCmdConfirm ITC_Task task,
const char *  cmd,
unsigned int  scb,
WCT_time  dtim,
WCT_time  xtim,
unsigned int  status
 

Send a telecommand execution status reponse.

Parameters:
task (in) Task handle
cmd (in) Pointer to CCSDS telecommand
scb (in) Spacecraft broadcast APID flag
dtim (in) Time command dequeued
xtim (in) Time execution completed
status (in) Command completion code

ITC_NodeID ITC_setPacketSrcNodeID ITC_QueueItem qitem,
ITC_NodeID  nid
 

Set the source node ID for the given queue item.

Parameters:
qitem (in) Queue item pointer
nid (in) ITC node ID
Return values:
x Previous value of node ID (ITC_NID_NONE on error)
Warning:
This entry point is provided for use by ITC driver callbacks (lightweight tasks). There should never be any reason for other tasks to call this entry point.

ITC_TaskID ITC_setPacketSrcTaskID ITC_QueueItem qitem,
ITC_TaskID  tid
 

Set the source task ID for the given queue item.

Parameters:
qitem (in) Queue item pointer
tid (in) ITC task ID
Return values:
x Previous value of task ID (ITC_TID_NONE on error)
Warning:
This entry point is provided for use by ITC driver callbacks (lightweight tasks). There should never be any reason for other tasks to call this entry point.


Generated on Fri Sep 1 20:46:35 2006 by  doxygen 1.4.4