GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTS / dev > cts_scp_enet / rhel4-32
#include <PBS/TASK.h>
#include <ITC/ITC_pubdefs.h>
Defines | |
#define | CRX_L_SVC_TYPES (2) |
Number of CRX service types. | |
Typedefs | |
typedef enum _CRX_ServiceType | CRX_ServiceType |
Typedef for enum _CRX_ServiceType. | |
typedef unsigned int | CRX_cb_Driver (void *prm, unsigned char *pkt) |
Signature for an callback buried in the CTDB receive task. | |
Enumerations | |
enum | _CRX_ServiceType { CRX_TYP_CMD = 0, CRX_TYP_TLM = 1 } |
Enumeration of CRX service types. More... | |
Functions | |
unsigned int | CRX_createService (CRX_ServiceType typ, CRX_cb_Driver *rtn, void *prm) |
Create a CTDB (1553) receive service block. | |
unsigned int | CRX_deleteService (CRX_ServiceType typ) |
Delete a CTDB (1553) receive service block. | |
unsigned int | CRX_dispatch (void *prm, unsigned char *pkt) |
Driver level packet dispatch (used in CTDB driver). | |
unsigned int | CRX_startService (CRX_ServiceType typ, TASK_attr *attr) |
Start a CTDB (1553) receive service. | |
unsigned int | CRX_stopService (CRX_ServiceType typ) |
Start a CTDB (1553) receive service. | |
unsigned int | CTS_configure (void) |
Configure the CTDB/CTS system from a CDM configuration database. | |
unsigned int | CTS_createDevice (void *addr) |
Create and initialize a CTDB (1553) device. | |
unsigned int | CTS_deleteDevice (void) |
Delete a CTDB (1553) device. | |
void * | CTS_getDevice (void) |
Return the CTDB (1553) device handle. | |
unsigned int | CTS_initialize (void) |
Initialize the CTS master control block. | |
unsigned int | CTS_rundown (void) |
Run down the CTS tasks/resources configured with CTS_configure(). | |
unsigned int | CTS_shutdown (void) |
Shut down the CTS master control block and release resources. | |
unsigned int | CTS_startDevice (void) |
Start a CTDB (1553) device. | |
unsigned int | CTS_stopDevice (void) |
Stop a CTDB (1553) device. | |
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_deleteService (void) |
Delete an CTX task block and release the associated resources. | |
unsigned int | CTX_startService (TASK_attr *attr) |
Start the CTX service task. | |
unsigned int | CTX_stopService (void) |
Stop the task implementing the CTX service layer. |
CVS $Id: CTS_pubdefs.h,v 1.9 2011/03/28 23:55:13 apw Exp $
enum _CRX_ServiceType |
unsigned int CRX_createService | ( | CRX_ServiceType | typ, | |
CRX_cb_Driver * | rtn, | |||
void * | prm | |||
) |
Create a CTDB (1553) receive service block.
typ | (in) Service type (command or telemetry) | |
rtn | (in) Dispatch callback routine | |
prm | (in) Dispatch callback routine parameter |
CTS_ALOCFAIL | Memory allocation failure | |
CTS_BADSTAT | Not in state "uninitialized" (bad state transition) | |
CTS_MUALOCFL | Cannot allocate a mutex | |
CTS_SUCCESS | Success |
References _CRX_Service::chk, _CTS_Control::cnt, _CTS_Control::crx, CTS_ccb, CTS_CTL_INITIALIZED, CTS_ctl_states, CTX_SVC_INITIALIZED, _CRX_Service::flg, _CTS_Control::mtx, _CRX_Service::prm, _CRX_Service::rtn, _CRX_Service::state, _CTS_Control::state, _CRX_Service::tcb, and validType().
Referenced by CTS_configure().
unsigned int CRX_deleteService | ( | CRX_ServiceType | typ | ) |
Delete a CTDB (1553) receive service block.
typ | (in) Service type (command or telemetry) |
CTS_BADSTAT | Not in state "uninitialized" (bad state transition) | |
CTS_SUCCESS | Success |
References checkState(), _CRX_Service::chk, _CTS_Control::cnt, _CTS_Control::crx, CTS_ccb, CTS_CTL_INITIALIZED, CTX_SVC_INITIALIZED, CTX_SVC_UNINITIALIZED, _CRX_Service::flg, _CTS_Control::mtx, _CRX_Service::prm, _CRX_Service::rtn, _CRX_Service::state, _CRX_Service::tcb, and validType().
Referenced by CTS_rundown().
unsigned int CRX_dispatch | ( | void * | prm, | |
unsigned char * | pkt | |||
) |
Driver level packet dispatch (used in CTDB driver).
prm | (in) User context parameter | |
pkt | (in) CCSDS telecommand (first byte of primary header) |
CTS_ALOCFAIL | Cannot allocate packet to forward the command | |
CTS_APIDNOQ | Command APID does not map to an ITC queue | |
CTS_SUCCESS | Success |
Referenced by CTS_configure().
unsigned int CRX_startService | ( | CRX_ServiceType | typ, | |
TASK_attr * | attr | |||
) |
Start a CTDB (1553) receive service.
typ | (in) Service type (command or telemetry) | |
attr | (in) Task attributes |
CTS_BADSTAT | Not in state "initialized" (bad state transition) | |
CTS_NOTINIT | Control block has not been allocated/initialized | |
CTS_SUCCESS | Success | |
CTS_TASKSTRT | Cannot start receive task |
References checkState(), _CTS_Control::crx, CRX_SVC_STARTED, CTS_ccb, CTS_CTL_INITIALIZED, CTX_SVC_INITIALIZED, _CTS_Control::dev, _CTS_Control::mtx, _CRX_Service::state, _CRX_Service::tcb, and validType().
Referenced by CTS_configure().
unsigned int CRX_stopService | ( | CRX_ServiceType | typ | ) |
Start a CTDB (1553) receive service.
typ | (in) Service type (command or telemetry) |
CTS_BADSTAT | Not in state "initialized" (bad state transition) | |
CTS_NOTINIT | Control block has not been allocated/initialized | |
CTS_SUCCESS | Success | |
CTS_TASKSTRT | Cannot start receive task |
References checkState(), _CTS_Control::crx, CTS_ccb, CTS_CTL_INITIALIZED, CTX_SVC_STARTED, _CRX_Service::flg, _CTS_Control::mtx, _CRX_Service::tcb, and validType().
Referenced by CTS_rundown().
unsigned int CTS_configure | ( | void | ) |
Configure the CTDB/CTS system from a CDM configuration database.
CTS_ALOCFAIL | Memory allocation failure | |
CTS_CTLSTAT | CTS master control block in wrong state for operation | |
CTS_BADSTAT | Not in state "uninitialized" (bad state transition) | |
CTS_DEVDUP | Device already created | |
CTS_MUALOCFL | Cannot allocate a mutex | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_QCREATE | Cannot create queue | |
CTS_SUCCESS | Success | |
CTS_SVCHNDL | CTS service control block does not exist | |
CTS_SVCSTAT | CTS service control block in wrong state for operation | |
CTS_TASKSTRT | Cannot start receive task | |
ITC_ALOCFAIL | Cannot allocate an ITC_Task object | |
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_TASKQUEU | Cannot create task queues | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARNULL | NULL variable (pointer) detected | |
ITC_VARRNG | Out of range variable detected | |
FPM_ALOCFAIL | Memory allocation failure | |
FPM_CTLSTAT | FPM control block not in state initialized | |
FPM_FPAINIT | FPA initialization failure | |
FPM_NOTINIT | FPM system not initialized | |
FPM_PDSCCNT | Pool descriptor list size out of range | |
FPM_PDSCORDR | Pool descriptor list not sorted in ascending order | |
FPM_PDSCPKTN | Pool descriptor allocator count below minimum | |
FPM_PDSCPKTS | Pool descriptor allocator size out of range | |
FPM_PNAMLEN | Pool name length out of valid range | |
FPM_PNAMNULL | Pool name is a NULL pointer | |
FPM_PNAMSNTX | Pool name s has invalid syntax | |
FPM_POOLPTR | Pool control block pointer invalid | |
FPM_POOLSTAT | Pool control block not in state initialized | |
RBM_ALOCFAIL | Memory allocation failure | |
RBM_FPAINIT | FPA initialization failure | |
RBM_NOTINIT | RBM system not initialized | |
RBM_RINGPTR | Ring control block pointer invalid | |
RBM_RINGSTAT | Ring control block not in state initialized | |
RBM_RNAMLEN | Ring name length out of valid range | |
RBM_RNAMNULL | Ring name is a NULL pointer | |
RBM_RNAMSNTX | Ring name s has invalid syntax |
References CRX_createService(), CRX_dispatch(), CRX_startService(), CRX_TYP_CMD, CTS_createDevice(), CTS_startDevice(), CTX_createService(), CTX_startService(), _CTS_Configure::fpm, _CTS_Configure::itc, and _CTS_Configure::rbm.
unsigned int CTS_createDevice | ( | void * | addr | ) |
Create and initialize a CTDB (1553) device.
addr | (in) Address of remote terminal |
CTS_ALOCFAIL | Memory allocation failure | |
CTS_BADSTAT | Not in state "uninitialized" (bad state transition) | |
CTS_DEVDUP | Device already created | |
CTS_MUALOCFL | Cannot allocate a mutex | |
CTS_SUCCESS | Success |
References _CTS_Device::chk, _CTS_Control::cnt, CTS_CTL_INITIALIZED, CTS_DEV_INITIALIZED, CTS_initDevice(), _CTS_Control::dev, _CTS_Device::loc, _CTS_Control::mtx, _CTS_Device::state, and _CTS_Control::state.
Referenced by CTS_configure().
unsigned int CTS_deleteDevice | ( | void | ) |
Delete a CTDB (1553) device.
CTS_CTLSTAT | CTS master control block in wrong state for operation | |
CTS_DEVACTIV | Cannot delete, service task still attached | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success | |
CTS_SVCHNDL | CTS service control block does not exist | |
CTS_SVCSTAT | CTS service control block in wrong state for operation |
References checkState(), _CTS_Device::chk, _CTS_Control::cnt, _CTS_Control::crx, CRX_L_SVC_TYPES, CRX_SVC_STARTED, CTS_CTL_INITIALIZED, CTS_DEV_INITIALIZED, CTS_DEV_UNINITIALIZED, _CTS_Control::dev, _CTS_Device::loc, _CTS_Control::mtx, _CTS_Device::state, and _CRX_Service::state.
Referenced by CTS_rundown().
void * CTS_getDevice | ( | void | ) |
Return the CTDB (1553) device handle.
References _CTS_Control::dev, and _CTS_Device::loc.
Referenced by CTX_sendCmd().
unsigned int CTS_initialize | ( | void | ) |
Initialize the CTS master control block.
CTS_ALOCFAIL | Memory allocation failure | |
CTS_CTLSTAT | CTS master control block in wrong state for operation | |
CTS_MUALOCFL | Cannot allocate a mutex | |
CTS_SUCCESS | Success |
References CTS_CTL_INITIALIZED, CTS_CTL_UNINITIALIZED, _CTS_Control::mtx, _CTS_Control::rwi, and _CTS_Control::state.
unsigned int CTS_rundown | ( | void | ) |
Run down the CTS tasks/resources configured with CTS_configure().
CTS_BADSTAT | Not in state "initialized" (bad state transition) | |
CTS_CTLSTAT | CTS master control block not in requested state | |
CTS_DEVACTIV | Cannot delete, service task still attached | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success | |
CTS_SVCHNDL | CTS service control block does not exist | |
CTS_SVCSTAT | CTX service control block not in requested state | |
CTS_TASKSTRT | Cannot start receive task | |
FPM_POOLPTR | Pool control block pointer invalid | |
FPM_POOLSTAT | Pool control block not in state initialized | |
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_TASKHNDL | Task handle is invalid | |
ITC_TASKMISS | Task not in task table | |
ITC_TASKSTAT | Task not in state initialized | |
RBM_RINGPTR | Ring control block pointer invalid | |
RBM_RINGSTAT | Ring control block not in state started |
References CRX_deleteService(), CRX_stopService(), CRX_TYP_CMD, CTS_deleteDevice(), CTS_stopDevice(), CTX_deleteService(), CTX_stopService(), _CTS_Configure::fpm, _CTS_Configure::itc, and _CTS_Configure::rbm.
unsigned int CTS_shutdown | ( | void | ) |
Shut down the CTS master control block and release resources.
CTS_DEVACTIV | Generic error | |
CTS_CTLSTAT | CTS master control block in wrong state for operation | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success |
References CTS_CTL_INITIALIZED, CTS_CTL_UNINITIALIZED, _CTS_Control::mtx, and _CTS_Control::state.
unsigned int CTS_startDevice | ( | void | ) |
Start a CTDB (1553) device.
CTS_CTLSTAT | CTS master control block in wrong state for operation | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success | |
CTS_SVCHNDL | CTS service control block does not exist | |
CTS_SVCSTAT | CTS service control block in wrong state for operation |
References checkState(), CTS_CTL_INITIALIZED, CTS_DEV_INITIALIZED, CTS_DEV_STARTED, _CTS_Control::dev, _CTS_Device::loc, _CTS_Control::mtx, and _CTS_Device::state.
Referenced by CTS_configure().
unsigned int CTS_stopDevice | ( | void | ) |
Stop a CTDB (1553) device.
CTS_CTLSTAT | CTS master control block in wrong state for operation | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success | |
CTS_SVCHNDL | CTS service control block does not exist | |
CTS_SVCSTAT | CTS service control block in wrong state for operation |
References checkState(), CTS_CTL_INITIALIZED, CTS_DEV_INITIALIZED, CTS_DEV_STARTED, _CTS_Control::dev, _CTS_Device::loc, _CTS_Control::mtx, and _CTS_Device::state.
Referenced by CTS_rundown().
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_SVC_INITIALIZED, _CTS_Control::mtx, and _CTS_Control::state.
Referenced by CTS_configure().
unsigned int CTX_deleteService | ( | void | ) |
Delete an CTX task block and release the associated resources.
CTS_CTLSTAT | CTS master control block not in requested state | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success | |
CTS_SVCSTAT | CTX service control block not in requested state |
References checkState(), _CTX_Service::chk, _CTS_Control::cnt, CTS_ccb, CTS_CTL_INITIALIZED, _CTS_Control::ctx, CTX_SVC_INITIALIZED, CTX_SVC_UNINITIALIZED, _CTX_Service::itc, _CTX_Service::msk, _CTS_Control::mtx, _CTX_Service::nim, _CTX_Service::state, and _CTX_Service::tid.
Referenced by CTS_rundown().
unsigned int CTX_startService | ( | TASK_attr * | attr | ) |
Start the CTX service task.
attr | (in) Task attributes |
CTS_CTLSTAT | CTS master control block not in requested state | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success | |
CTS_SVCSTAT | CTX service control block not in requested state |
References checkState(), CTS_ccb, CTS_CTL_INITIALIZED, _CTS_Control::ctx, CTX_SVC_INITIALIZED, CTX_SVC_STARTED, _CTX_Service::itc, _CTS_Control::mtx, and _CTX_Service::state.
Referenced by CTS_configure().
unsigned int CTX_stopService | ( | void | ) |
Stop the task implementing the CTX service layer.
CTS_CTLSTAT | CTS master control block not in requested state | |
CTS_NOTINIT | CTS master control block does not exist | |
CTS_SUCCESS | Success | |
CTS_SVCSTAT | CTX service control block not in requested state |
References checkState(), CTS_ccb, CTS_CTL_INITIALIZED, _CTS_Control::ctx, CTX_SVC_INITIALIZED, CTX_SVC_STARTED, _CTX_Service::itc, _CTS_Control::mtx, and _CTX_Service::state.
Referenced by CTS_rundown().