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

Constituent: itc     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

ITC_confirm.c File Reference

Functionality specific to confirming spacecraft telecommands. More...

#include <string.h>
#include "PBI/TBD_id.h"
#include "PBS/MBA.h"
#include "PBS/RNG.h"
#include "PBS/RW.ih"
#include "PBS/TBD.ih"
#include "PBS/WCT.h"
#include "MSG/MSG_pubdefs.h"
#include "CCSDS/CCSDS_pkt.h"
#include "ITC/ITC_msgs.h"
#include "ITC/ITC_pubdefs.h"
#include "ITC/ITC_tlmdefs.h"
#include "ITC_prvdefs.h"

Include dependency graph for ITC_confirm.c:

Include dependency graph

Functions

unsigned int ITC_attachCmdConfirm (ITC_Task *task, ITC_cb_Memory *rtn, void *prm)
 Attach a command confirmation memory allocator to a task.

void ITC_copyCmdConfirm (ITC_Task *task, const char *cmd, WCT_time tim)
 Make a copy of a spacecraft command.

unsigned int ITC_detachCmdConfirm (ITC_Task *task)
 Detach a command confirmation memory allocator from a task.

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.

unsigned int ITC_setCmdConfirm (ITC_TaskID tid, ITC_CmdClass scb, ITC_CmdAction fwd, ITC_CmdLevel new, ITC_CmdLevel *old)
 Set the command confirmation level for a task.

unsigned int ITC_setMsgResponse (ITC_TaskID tid, MSG_Level new)
 Set the message response level of a task.


Detailed Description

Functionality specific to confirming spacecraft telecommands.

CVS $Id: ITC_confirm.c,v 1.6 2005/03/29 04:42:02 apw Exp $
Author:
A.P.Waite

Function Documentation

unsigned int ITC_attachCmdConfirm ITC_Task task,
ITC_cb_Memory rtn,
void *  prm
 

Attach a command confirmation memory allocator to a task.

Parameters:
task (in) Task handle
rtn (in) Memory allocation routine
prm (in) Memory allocation routine parameter
Return values:
ITC_CNFRTNAT Command confirmation memory allocator already attached
ITC_CTLSTAT Control block not in state initialized
ITC_NOTINIT ITC control block does not exist
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized
ITC_SUCCESS Success
ITC_VARNULL NULL variable (pointer) detected
ITC_attachConfirm() allows a user to attach a memory allocator to a task for the express purpose of sending command confirmations back to the spacecraft. By making the allocation the responsibility of a task, one task cannot blame another for having hogged all the command confirmation memory.

Any (ITC compliant) memory manager will do, but this memory manager application has the characteristics of "single write/single reader" with all deallocations being done in the exact order of allocations. In other words it's tailor made for a ring buffer. If a ring buffer is used (better yet, a managed ring buffer as provided in the IMM package), a buffer size of 1 kByte with a 256 byte overflow area should suffice (most command confirmations are of order 110-120 bytes (minimum 98, maximum 150), so this is sufficient buffering to hold ~8 command confirmations.

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.

unsigned int ITC_detachCmdConfirm ITC_Task task  ) 
 

Detach a command confirmation memory allocator from a task.

Parameters:
task (in) Task handle
Return values:
ITC_CNFRTNDE No command confirmation memory allocator exists to detach
ITC_CTLSTAT 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 Task not in state initialized
ITC_detachCmdConfirm() detaches a task's command confirmation memory allocator.

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:

unsigned int ITC_setCmdConfirm ITC_TaskID  tid,
ITC_CmdClass  scb,
ITC_CmdAction  fwd,
ITC_CmdLevel  new,
ITC_CmdLevel old
 

Set the command confirmation level for a task.

Parameters:
tid (in) Task ID
scb (in) Spacecraft broadcast APID flag
fwd (in) Task acting as forwarding agent flag
new (in) New command confirmation level
old (in) Old command confirmation level (pointer can be NULL)
Return values:
ITC_SUCCESS S Success
ITC_TASKMISS E No entry in task table for task
ITC_TASKPTR E Task pointer check failed
ITC_VARRNG E Out of range variable detected
ITC_setCmdConfirm() sets one of the command confirmation levels for a task. There are four levels that can be controlled, arranged as a two-by-two matrix. The first element of the matrix is whether the command belongs to the class "spacecraft broadcast" (parameter scb). The second element of the matrix is whether the task is acting as a forwarding agent (parameter fwd). Thus the call ITC_setCmdReponse( tid, ITC_CMD_NORMAL, ITC_ACT_FORWARD, ITC_LVL_ERROR, &old ); would mean "for task tid, set the command confirmation level to ITC_LVL_ERROR when forwarding non-broadcast spacecraft commands".

unsigned int ITC_setMsgResponse ITC_TaskID  tid,
MSG_Level  new
 

Set the message response level of a task.

Parameters:
tid (in) Task ID
new (in) New task response level
Return values:
ITC_SUCCESS S Success
ITC_TASKMISS E No entry in task table for task
ITC_TASKPTR E Task pointer check failed
ITC_VARRNG E Out of range variable detected
ITC_setMsgResponse() sets the message reporting level of a task.


Generated on Wed May 11 00:03:57 2005 by doxygen 1.3.3