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

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:

Include dependency graph

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

Included by dependency graph

Data Structures

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


Defines

#define ITC_PRT_K_SNID   (3)
 Number of bits used for source node ID.

#define ITC_PRT_K_STID   (5)
 Number of bits used for source task ID.

#define ITC_PRT_K_DNID   (3)
 Number of bits used for destination node ID.

#define ITC_PRT_K_DTID   (5)
 Number of bits used for destination task ID.

#define ITC_PRT_K_DQID   (3)
 Number of bits used for destination queue ID.

#define ITC_PRT_K_PNID   (3)
 Number of bits used for proxy node ID.

#define ITC_PRT_K_DID   (2)
 Number of bits used for dispatch type ID.

#define ITC_PRT_K_PID   (2)
 Number of bits used for hardware protocol ID.

#define ITC_PRT_K_RSV   (4)
 Number of bits used for (reserved).

#define ITC_PRT_K_VER   (2)
 Number of bits used for protocol version.

#define ITC_PRT_V_SNID   ( 0 )
 Bit offset to the source node ID.

#define ITC_PRT_V_STID   ( ITC_PRT_V_SNID + ITC_PRT_K_SNID )
 Bit offset to the source task ID.

#define ITC_PRT_V_DNID   ( ITC_PRT_V_STID + ITC_PRT_K_STID )
 Bit offset to the destination node ID.

#define ITC_PRT_V_DTID   ( ITC_PRT_V_DNID + ITC_PRT_K_DNID )
 Bit offset to the destination task ID.

#define ITC_PRT_V_DQID   ( ITC_PRT_V_DTID + ITC_PRT_K_DTID )
 Bit offset to the destination queue ID.

#define ITC_PRT_V_PNID   ( ITC_PRT_V_DQID + ITC_PRT_K_DQID )
 Bit offset to the proxy node ID.

#define ITC_PRT_V_DID   ( ITC_PRT_V_PNID + ITC_PRT_K_PNID )
 Bit offset to the dispatch type ID.

#define ITC_PRT_V_PID   ( ITC_PRT_V_DID + ITC_PRT_K_DID )
 Bit offset to the hardware protocol ID.

#define ITC_PRT_V_RSV   ( ITC_PRT_V_PID + ITC_PRT_K_PID )
 Bit offset to the (reserved).

#define ITC_PRT_V_VER   ( ITC_PRT_V_RSV + ITC_PRT_K_RSV )
 Bit offset to the protocol version.

#define ITC_PRT_M_SNID   (((1 << ITC_PRT_K_SNID ) - 1) << ITC_PRT_V_SNID )
 Mask for the source node ID.

#define ITC_PRT_M_STID   (((1 << ITC_PRT_K_STID ) - 1) << ITC_PRT_V_STID )
 Mask for the source task ID.

#define ITC_PRT_M_DNID   (((1 << ITC_PRT_K_DNID ) - 1) << ITC_PRT_V_DNID )
 Mask for the destination node ID.

#define ITC_PRT_M_DTID   (((1 << ITC_PRT_K_DTID ) - 1) << ITC_PRT_V_DTID )
 Mask for the destination task ID.

#define ITC_PRT_M_DQID   (((1 << ITC_PRT_K_DQID ) - 1) << ITC_PRT_V_DQID )
 Mask for the destination queue ID.

#define ITC_PRT_M_PNID   (((1 << ITC_PRT_K_PNID ) - 1) << ITC_PRT_V_PNID )
 Mask for the proxy node ID.

#define ITC_PRT_M_DID   (((1 << ITC_PRT_K_DID ) - 1) << ITC_PRT_V_DID )
 Mask for the dispatch type ID.

#define ITC_PRT_M_PID   (((1 << ITC_PRT_K_PID ) - 1) << ITC_PRT_V_PID )
 Mask for the hardware protocol ID.

#define ITC_PRT_M_RSV   (((1 << ITC_PRT_K_RSV ) - 1) << ITC_PRT_V_RSV )
 Mask for the (reserved).

#define ITC_PRT_M_VER   (((1 << ITC_PRT_K_VER ) - 1) << ITC_PRT_V_VER )
 Mask for the protocol version.


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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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 9 03:34:01 2005 by doxygen 1.3.3