GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> ITC / V3-9-2 > itc / linux-gcc
#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>
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. | |
unsigned int | ITC_reportConfiguration (ITC_Configuration *cfg) |
Generate a configuration report. | |
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. |
CVS $Id: ITC_confirm.c,v 1.10 2011/03/25 21:01:10 apw Exp $
unsigned int ITC_attachCmdConfirm | ( | ITC_Task * | task, | |
ITC_cb_Memory * | rtn, | |||
void * | prm | |||
) |
Attach a command confirmation memory allocator to a task.
task | (in) Task handle | |
rtn | (in) Memory allocation routine | |
prm | (in) Memory allocation routine parameter |
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 |
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.
References _ITC_Task::chk, _ITC_Task::cnf, ITC_CTL_INITIALIZED, ITC_ctl_states, ITC_icb, ITC_TSK_INITIALIZED, ITC_tsk_states, _ITC_Control::mtx, _ITC_TaskConfirm::prm, _ITC_TaskConfirm::rtn, _ITC_Task::state, _ITC_Control::state, and _ITC_Task::tid.
void ITC_copyCmdConfirm | ( | ITC_Task * | task, | |
const char * | cmd, | |||
WCT_time | tim | |||
) |
Make a copy of a spacecraft command.
task | (in) Task handle | |
cmd | (in) Pointer to CCSDS telecommand | |
tim | (in) Time command was dequeued |
References _ITC_TaskConfirm::cmd, _ITC_Task::cnf, _ITC_CommandCount::cnt, _ITC_Task::sav, and _ITC_CommandCount::tim.
Referenced by ITC_dispatch().
unsigned int ITC_detachCmdConfirm | ( | ITC_Task * | task | ) |
Detach a command confirmation memory allocator from a task.
task | (in) Task handle |
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 |
References _ITC_Task::chk, _ITC_Task::cnf, ITC_CTL_INITIALIZED, ITC_ctl_states, ITC_icb, ITC_TSK_INITIALIZED, ITC_tsk_states, _ITC_Control::mtx, _ITC_TaskConfirm::prm, _ITC_TaskConfirm::rtn, _ITC_Task::state, _ITC_Control::state, and _ITC_Task::tid.
unsigned int ITC_reportConfiguration | ( | ITC_Configuration * | cfg | ) |
Generate a configuration report.
cfg | (in) Pointer to array of configuration records |
References _ITC_Configuration::bf, _ITC_Task::cnf, ITC_CTL_INITIALIZED, ITC_ctl_states, ITC_icb, ITC_L_TASKS, ITC_tpl, _ITC_TaskConfirm::level, _ITC_Control::state, _ITC_Task::tbd, and _ITC_Configuration::us.
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.
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 |
References _ITC_CommandCount::bad, _ITC_Flags::bf, _ITC_TaskConfirm::cmd, _ITC_CmdConfirm_Tlm::cmd_hdr, _ITC_Task::cnf, _ITC_CmdConfirm_Tlm::deq_lsui, _ITC_CmdConfirm_Tlm::deq_msui, _ITC_CmdConfirm_Tlm::drp, _ITC_TaskConfirm::drp, _ITC_CmdConfirm_Tlm::exe_lsui, _ITC_CmdConfirm_Tlm::exe_msui, _ITC_CmdConfirm_Tlm::flags, ITC_bind(), ITC_CMDCONFIRM_TLM_APID, ITC_DID_APID, ITC_icb, ITC_LVL_ALL, ITC_NID_SC, ITC_PID_ACK, ITC_QID_CTL, ITC_rollback(), ITC_send(), ITC_TID_ANON, _ITC_TaskConfirm::level, _ITC_Control::nid, _ITC_CmdConfirm_Tlm::nid, _ITC_TaskConfirm::prm, _ITC_TaskConfirm::rtn, _ITC_Task::sav, _ITC_CmdConfirm_Tlm::status, _ITC_CmdConfirm_Tlm::tid, _ITC_Task::tid, and _ITC_Flags::us.
Referenced by ITC_dispatch().
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.
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) |
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 |
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".
References _ITC_Task::cnf, ITC_icb, ITC_L_ACTIONS, ITC_L_CLASSES, ITC_L_LEVELS, ITC_L_TASKS, ITC_LVL_UNKNOWN, ITC_tpl, _ITC_TaskConfirm::level, _ITC_Control::rwi, and _ITC_Task::tbd.
unsigned int ITC_setMsgResponse | ( | ITC_TaskID | tid, | |
MSG_Level | new | |||
) |
Set the message response level of a task.
tid | (in) Task ID | |
new | (in) New task response level |
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 |
References ITC_icb, ITC_L_TASKS, ITC_tpl, _ITC_Control::rwi, and _ITC_Task::tbd.