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 <ITC/ITC_pubdefs.h>
#include <CTS/CTS_pubdefs.h>
#include <CTS/CTS_msgs.h>
#include <CTS_prvdefs.h>
Functions | |
static unsigned int | checkState (CTS_ControlState creq, CTS_DeviceState dreq, const char *func) |
Check the state of master and task control blocks. | |
unsigned int | CTS_createDevice (void *addr) |
Create and initialize a CTDB (1553) device. | |
unsigned int | CTS_deleteDevice () |
Delete a CTDB (1553) device. | |
void * | CTS_getDevice () |
Return the CTDB (1553) device handle. | |
unsigned int | CTS_initialize () |
Initialize the CTS master control block. | |
unsigned int | CTS_shutdown () |
Shut down the CTS master control block and release resources. | |
unsigned int | CTS_startDevice () |
Start a CTDB (1553) device. | |
unsigned int | CTS_stopDevice () |
Stop a CTDB (1553) device. | |
Variables | |
const char * | CTS_dev_states [CTS_L_DEV_STATES] |
String constants for CTDB (1553) device. | |
CTS_Control * | CTS_ccb |
Master control block for the CTS system. | |
const char * | CTS_ctl_states [CTS_L_CTL_STATES] |
String constants for CTS control block states. |
CVS $Id: CTS_control.c,v 1.6 2011/03/28 23:55:14 apw Exp $
static unsigned int checkState | ( | CTS_ControlState | creq, | |
CTS_DeviceState | dreq, | |||
const char * | func | |||
) | [inline, static] |
Check the state of master and task control blocks.
creq | (in) State the CTS master control block must be in | |
dreq | (in) State the CTS service control block must be in | |
func | (in) Name of function calling this routine |
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 _CTS_Device::chk, CRX_svc_states, _CTS_Control::dev, _CTS_Control::mtx, _CTS_Device::state, and _CTS_Control::state.
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(), and CTX_sendTlm().
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_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().
Master control block for the CTS system.
Master control block for the CTS system. This is global, so care must be taken when writing elements of this block that the code is properly protected.
Referenced by checkState(), CRX_createService(), CRX_deleteService(), CRX_recvCmd(), CRX_startService(), CRX_stopService(), CTX_createService(), CTX_deleteService(), CTX_setCmdCallback(), CTX_setTlmCallback(), CTX_startService(), and CTX_stopService().
const char* CTS_ctl_states[CTS_L_CTL_STATES] |
Initial value:
{ "uninitialized", "initialized" }
Referenced by checkState(), CRX_createService(), and CTX_createService().
const char* CTS_dev_states[CTS_L_DEV_STATES] |
Initial value:
{ "uninitialized", "initialized", "started" }