GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > CTS / V2-2-1

Constituent: cts_scp_sumt     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

CTS_control.c File Reference

Management of the CTS master control block. More...

#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"

Include dependency graph for CTS_control.c:

Include dependency graph

Functions

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_ControlCTS_ccb
 Master control block for the CTS system.

const char * CTS_ctl_states [CTS_L_CTL_STATES]
 String constants for CTS control block states.


Detailed Description

Management of the CTS master control block.

CVS $Id: CTS_control.c,v 1.5 2005/08/05 01:27:28 apw Exp $
Author:
A.P.Waite

Function Documentation

unsigned int checkState CTS_ControlState  creq,
CTS_DeviceState  dreq,
const char *  func
[inline, static]
 

Check the state of master and task control blocks.

Parameters:
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
Return values:
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
checkState() is a state integrity checker. It demands that the master control exists and be in state creq, it also demands that the service control block exists and be in state sreq. If these conditions are met, the routine returns CTS_SUCCESS, otherwise it generates a message and returns with a non-CTS_SUCCESS message.

Warning:
If successful, the master control block will be returned with the mutex locked. Any failure and the mutex is returned unlocked.

unsigned int CTS_createDevice void *  addr  ) 
 

Create and initialize a CTDB (1553) device.

Parameters:
addr (in) Address of remote terminal
Return values:
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
CTS_createDevice() creates and initializes a CTDB (1553) device

Here is the call graph for this function:

unsigned int CTS_deleteDevice void   ) 
 

Delete a CTDB (1553) device.

Return values:
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
CTS_deleteDevice() deletes a CTDB (1553) device

Here is the call graph for this function:

void* CTS_getDevice void   ) 
 

Return the CTDB (1553) device handle.

Returns:
The CTDB device handle

unsigned int CTS_initialize void   ) 
 

Initialize the CTS master control block.

Return values:
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
CTS_initialize() initializes the CTS master control block.

unsigned int CTS_shutdown void   ) 
 

Shut down the CTS master control block and release resources.

Return values:
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
CTS_shutdown() shuts down the CTS master control block and releases assocoated resources

unsigned int CTS_startDevice void   ) 
 

Start a CTDB (1553) device.

Return values:
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
CTS_startDevice() starts a CTDB (1553) device

Here is the call graph for this function:

unsigned int CTS_stopDevice void   ) 
 

Stop a CTDB (1553) device.

Return values:
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
CTS_stopDevice() stops a CTDB (1553) device

Here is the call graph for this function:


Variable Documentation

CTS_Control* CTS_ccb
 

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.

const char* CTS_ctl_states[CTS_L_CTL_STATES]
 

Initial value:

{
    "uninitialized",
    "initialized"
}
String constants for CTS control block states.

const char* CTS_dev_states[CTS_L_DEV_STATES]
 

Initial value:

{
    "uninitialized",
    "initialized",
    "started"
}
String constants for CTDB (1553) device.


Generated on Thu Aug 4 20:29:38 2005 by doxygen 1.3.3