GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTS / V2-3-2 > cts_lcp_enet / sun-gcc
#include <string.h>
#include <PBS/MBA.h>
#include <MSG/MSG_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CTDB/CTDB_config.h>
#include <CTDB/CTDB_rt.h>
#include <CTDB/SUMT_rt.h>
#include <ITC/ITC_apidefs.h>
#include <ITC/ITC_drvdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <ITC/ITC_msgs.h>
#include <CTS/CTS_pubdefs.h>
#include <CTS/CTS_msgs.h>
#include <CTS_prvdefs.h>
Functions | |
static void | CTX_freePacket (void *pkt, void *prm) |
Free a queue item. | |
unsigned int | CTX_createService (ITC_TaskID tid, unsigned int nim, ITC_cb_Memory *rtn, void *prm) |
Initialize an CTX service control block. | |
unsigned int | CTX_sendCmd (void *prm, const ITC_QueueItem *qitem, void *pay, unsigned int len) |
CTDB service layer callback. | |
unsigned int | CTX_sendTlm (void *prm, const ITC_QueueItem *qitem, void *pay, unsigned int len) |
CTDB service layer callback. |
CVS $Id: CTX_lcp.c,v 1.6 2011/03/28 23:55:14 apw Exp $
unsigned int CTX_createService | ( | ITC_TaskID | tid, | |
unsigned int | nim, | |||
ITC_cb_Memory * | rtn, | |||
void * | prm | |||
) |
Initialize an CTX service control block.
tid | (in) ITC task ID for this service | |
nim | (in) Mask of ITC nodes served by this service (not implemented) | |
rtn | (in) Memory allocator for diagnostic stream | |
prm | (in) Memory allocator for diagnostic stream - parameter |
CTS_SUCCESS | Success | |
CTS_QCREATE | Cannot create queue |
References _CTS_Control::cnt, CTS_ccb, CTS_CTL_INITIALIZED, CTS_ctl_states, _CTS_Control::ctx, CTX_createQ(), CTX_deleteQ(), CTX_sendCmd(), CTX_sendTlm(), CTX_SVC_INITIALIZED, _CTS_Control::mtx, and _CTS_Control::state.
Referenced by CTS_configure().
static void CTX_freePacket | ( | void * | pkt, | |
void * | prm | |||
) | [static] |
Free a queue item.
pkt | Packet to free (unused) | |
prm | User context parameter (queue item) |
Referenced by CTX_sendCmd(), and CTX_sendTlm().
unsigned int CTX_sendCmd | ( | void * | prm, | |
const ITC_QueueItem * | qitem, | |||
void * | pay, | |||
unsigned int | len | |||
) |
CTDB service layer callback.
prm | (in) User context parameter | |
qitem | (in) Queue item | |
pay | (in) Queue item payload pointer | |
len | (in) Queue item payload length |
ITC_QID_CMD
, looking for commands that LAT side applications want to send to the spacecraft. Commands are expected to be valid CCSDS packets contained in ITC protocol (though CTX_sendCmd() will check CCSDS integrity, see below).
CTDB_CONFIG_PKT_SIZE_CMD_RX
. CTS_BADQUEU | CTX does not accept packets this queue | |
CTS_CMDAPID | Telecommand APID not in valid range | |
CTS_CMDBITC | Telecommand bit clear in telecommand packet | |
CTS_CMDEVEN | Telecommand packet length not an even number of bytes | |
CTS_CMDHEAD | Telecommand packet header verification failed | |
CTS_CMDLEN | Telecommand packet length not in valid range | |
CTS_CMDQUEU | Error queueing telecommmand packet to CTDB driver | |
ITC_FORWARD | Service completed successfully, do not free packet |
References _CTX_Service::cmd, CTS_getDevice(), and CTX_freePacket().
Referenced by CTX_createService().
unsigned int CTX_sendTlm | ( | void * | prm, | |
const ITC_QueueItem * | qitem, | |||
void * | pay, | |||
unsigned int | len | |||
) |
CTDB service layer callback.
prm | (in) User context parameter | |
qitem | (in) Queue item | |
pay | (in) Queue item payload pointer | |
len | (in) Queue item payload length |
ITC_QID_CTL_X
and ITC_QID_CTL
, looking for telemetry that LAT side applications want to send to the spacecraft. Telemtry is expected to be in the form of valid CCSDS packets contained in ITC protocol (though CTX_sendTlm() will check CCSDS integrity, see below). The two queues have dedicated purposes: ITC_QID_CTL_X
Alert telemetry ITC_QID_CTL
Diagnostic telemetryCTDB_CONFIG_PKT_SIZE_TELEM
. ITC_QID_CTL_X
queue, the APID is outside the valid range for alert telemetry. ITC_QID_CTL
queue, the APID is outside the valid range for diagnostic telemetry.CTS_BADQUEU | CTX does not accept packets this queue | |
CTS_TLMAPID | Telemetry APID not in valid range | |
CTS_TLMBITS | Telecommand bit set in telemetry packet | |
CTS_TLMEVEN | Telemetry packet length not an even number of bytes | |
CTS_TLMHEAD | Telemetry packet header verification failed | |
CTS_TLMLEN | Telemetry packet length not in valid range | |
CTS_TLMQUEU | Error queueing telemetry to CTDB driver | |
ITC_FORWARD | Service completed successfully, do not free packet |
References CTS_getDevice(), CTX_freePacket(), and _CTX_Service::tlm.
Referenced by CTX_createService().