GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / V6-0-0 > lci / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

cue.h File Reference

Definitions for the routines that act upon the cue structure. More...


Typedefs

typedef struct _LCI_cue LCI_cue
 Declaration of the opaque cue structure.

Enumerations

enum  LCI_CUE_END {
  LCI_CUE_FAILED = -1,
  LCI_CUE_UNSET = 0,
  LCI_CUE_SIGNALED = 1,
  LCI_CUE_TIMEDOUT = 2
}
 State information returned from LCI_wait indicating how the cue was terminated. More...

Functions

void LCI_clearCue (LCI_cue *cue)
 Clear a cue.
void LCI_clearCueCounts (LCI_cue *cue)
 Clear cue counters.
unsigned LCI_deleteCue (LCI_cue *cue)
 Delete a cue.
void LCI_getCueCounts (LCI_cue *cue, unsigned int *nWait, unsigned int *nSignal, unsigned int *nTimeout)
 Get cue counters.
LCI_cueLCI_newCue (void)
 Create a new cue.
void LCI_signalCue (LCI_cue *cue)
 Signal cue completion.
unsigned LCI_waitCue (LCI_cue *cue, unsigned timeout)
 Wait for a cue to complete or time out.


Detailed Description

Definitions for the routines that act upon the cue structure.

Author:
James Swain & Owen Saxton
Id

Enumeration Type Documentation

enum LCI_CUE_END

State information returned from LCI_wait indicating how the cue was terminated.

Enumerator:
LCI_CUE_FAILED  The wake-up timer failed to start.
LCI_CUE_UNSET  No end state to report (the cue has never been used or is currently waiting).
LCI_CUE_SIGNALED  The cue was signalled.
LCI_CUE_TIMEDOUT  The wake-up timer went off.


Function Documentation

void LCI_clearCue ( LCI_cue cue  ) 

Clear a cue.

This routine puts the cue into a known cleared state, ready for the next wait.

Parameters:
cue Pointer to an allocated, initialised cue structure (from LCI_newCue)

void LCI_clearCueCounts ( LCI_cue cue  ) 

Clear cue counters.

This routine zeroes the counts of waits, signals and timeouts.

Parameters:
cue Pointer to a cue being used.

unsigned LCI_deleteCue ( LCI_cue cue  ) 

Delete a cue.

This routine destroys the semaphore and wake-up timer and then frees the memory associated with the cue structure

Parameters:
cue Pointer to an initialised cue structure (make sure that it is not currently running!)
Return values:
LCI_SUCCESS if all goes well
LCI_WUTDFAIL if the wake-up timer could not be destroyed, because it was in a bad state

void LCI_getCueCounts ( LCI_cue cue,
unsigned int *  nWait,
unsigned int *  nSignal,
unsigned int *  nTimeout 
)

Get cue counters.

This routine obtains the counts of waits, signals and timeouts since the last time the cue was cleared.

Parameters:
cue Pointer to a cue being used.
nWait Address of an integer to receive the number of wait calls, or NULL if not needed.
nSignal Address of an integer to receive the number of signal calls, or NULL if not needed.
nTimeout Address of an integer to receive the number of timeouts, or NULL if not needed.

LCI_cue* LCI_newCue ( void   ) 

Create a new cue.

This routine allocates memory for the cue structure then creates the timer and semaphore to be held by the structure

Returns:
Pointer to an allocated and initialised cue structure, or NULL if there is an error.

void LCI_signalCue ( LCI_cue cue  ) 

Signal cue completion.

This routine signals completion by setting the end state to LCI_CUE_SIGNALED and giving the semaphore

Parameters:
cue Pointer to a cue that is being waited upon

unsigned LCI_waitCue ( LCI_cue cue,
unsigned  timeout 
)

Wait for a cue to complete or time out.

This routine starts the wake-up timer and takes the semaphore

Parameters:
cue Pointer to an allocated, initialised cue structure (from LCI_newCue)
timeout Time, in microseconds, until the call times out.
Return values:
LCI_CUE_SIGNALED Another task called signal
LCI_CUE_TIMEDOUT If the timer expired before the cue was signalled.
LCI_CUE_FAILED Timer failed to start (because of incorrect state)


Generated on Thu Aug 20 14:53:31 2009 by  doxygen 1.5.3