OCameraInputs Class Reference

#include <OCamera.h>

List of all members.


Detailed Description

Basic class for access to the digital inputs of the camera.

Example Usage
  1. create interface with poCreateInterface()
  2. open it with iOpen()
  3. work with the inputs using
  1. after work close interface with iClose()
  2. if interface is no longer needed call Destroy()


Public Types

enum  t_enCameraInput {
  INPUT_I0 = 1, INPUT_I1 = 2, INPUT_I0_RE = 4, INPUT_I0_FE = 8,
  INPUT_I1_RE = 16, INPUT_I1_FE = 32, OVERLOAD = 64, INPUT_ALL = INPUT_I0 | INPUT_I1
}
 digital camera inputs More...

Public Member Functions

virtual void Destroy ()=0
 Removes completely the inputs interface object created with poCreateInterface().
virtual int GetDriverFileDescriptor ()=0
 Retrive a file descriptor to perform select/poll on the input interface (e.g.
virtual int iClearEdges (int iMask)=0
 Edge detection bits are sticky, they remain in their state unless they are cleared by this method.
virtual int iClose ()=0
 Defined cleanup after the work with the digital inputs has been finished.
virtual int iGetInput (t_enCameraInput enIn)=0
 Returns the state (0 or 1) of one digital input.
virtual int iGetInputs ()=0
 Returns the state of all digital inputs and the state of the output overload signal.
virtual int iOpen ()=0
 Grants the access to the camera's digital inputs.
virtual int iSetTimeout (int iTimeout)=0
 Set the timeout to wait during an iWaitForInputxxx() operation.
virtual int iWaitForInput (t_enCameraInput enIn, int iState)=0
 Wait until the digital input pattern reaches a given state.
virtual int iWaitForInputChange (t_enCameraInput enIn)=0
 Wait until the specified digital input changes it's logic level.
virtual int iWaitForInputs (int iMask, int iState)=0
 Wait until one, several or all inputs reach a given state.
virtual int iWaitForInputsChange (int iMask)=0
 Wait until one, several or all inputs change their logic levels.

Static Public Member Functions

static OCameraInputspoCreateInterface ()
 Call this method to obtain a pointer to the inputs interface.


Member Enumeration Documentation

enum OCameraInputs::t_enCameraInput

digital camera inputs

Enumerator:
INPUT_I0  digital input nr 0
INPUT_I1  digital input nr 1
INPUT_I0_RE  digital input nr 0 rising edge detect
INPUT_I0_FE  digital input nr 0 falling edge detect
INPUT_I1_RE  digital input nr 1 rising edge detect
INPUT_I1_FE  digital input nr 1 falling edge detect
OVERLOAD  output overload signal (1=overload)
INPUT_ALL  digital input 0 and 1


Member Function Documentation

virtual void OCameraInputs::Destroy (  )  [pure virtual]

Removes completely the inputs interface object created with poCreateInterface().

This should happen after iClose() was called and the interface is no longer needed.
Be careful to DO NOT USE THE INTERFACE POINTER any longer after having called this method!!

virtual int OCameraInputs::GetDriverFileDescriptor (  )  [pure virtual]

Retrive a file descriptor to perform select/poll on the input interface (e.g.

wait until input has changed).

Returns:
> 0 ... valid file descriptor

virtual int OCameraInputs::iClearEdges ( int  iMask  )  [pure virtual]

Edge detection bits are sticky, they remain in their state unless they are cleared by this method.

To clear the state of an edge detection bit set the corresponding bit in iMask when calling iClearEdges.

Parameters:
iMask all input's bitposition, that equal "1" will be cleared (only in case of edge detection inputs)
Returns:
0 ... function completed successfully
-errno ... always negative (see errno.h) if error or timeout occured

virtual int OCameraInputs::iClose (  )  [pure virtual]

Defined cleanup after the work with the digital inputs has been finished.

virtual int OCameraInputs::iGetInput ( t_enCameraInput  enIn  )  [pure virtual]

Returns the state (0 or 1) of one digital input.

This call never blocks.

Parameters:
enIn bitmask for one digital input
Returns:
0 ... digital input is logic low
1 ... digital input is logic high
-errno ... on failure always negative (see errno.h)

virtual int OCameraInputs::iGetInputs (  )  [pure virtual]

Returns the state of all digital inputs and the state of the output overload signal.

The overload is logic high whenever the total sum of output current on all digital outputs exceeds 1.8A.
Use the OCameraInputs::t_enCameraInput bitmasks to ask for the sate of individual digital inputs.
This call never blocks.

Returns:
>= 0 ... value of all digital inputs acc. to bitmask OCameraInputs::t_enCameraInput
-errno ... on failure always negative (see errno.h)

virtual int OCameraInputs::iOpen (  )  [pure virtual]

Grants the access to the camera's digital inputs.

Has to be called PRIOR to use any subsequent call to the OCameraInputs interface.
When work with digital inputs is finished, the user should call iClose() for cleanup.

Returns:
< 0 ... on failure, usage of digital inputs is not available

virtual int OCameraInputs::iSetTimeout ( int  iTimeout  )  [pure virtual]

Set the timeout to wait during an iWaitForInputxxx() operation.

This may prevent from hanging if the input doesn't change.
By default no timeout is used.

Parameters:
iTimeout timeout value in milliseconds (1E-3)
-1 ... no timeout is desired (infinite wait)
Returns:
-errno ... on failure always negative (see errno.h)

virtual int OCameraInputs::iWaitForInput ( t_enCameraInput  enIn,
int  iState 
) [pure virtual]

Wait until the digital input pattern reaches a given state.

The default behaviour is infinite blocking. To specify a defined timeout call iSetTimeout() before the first use of this function.

Parameters:
enIn digital input values, that should be observed
iState state of digital inputs to stop waiting
Returns:
-errno ... always negative (see errno.h) if error or timeout occured
-ETIME ... timeout ocurred (timer expired)

virtual int OCameraInputs::iWaitForInputChange ( t_enCameraInput  enIn  )  [pure virtual]

Wait until the specified digital input changes it's logic level.

The default behaviour is infinite blocking. To specify a defined timeout call iSetTimeout().

Parameters:
enIn digital input value acc. to OCameraInputs::t_enCameraInput, that should be observed
Returns:
-errno ... always negative (see errno.h) if error or timeout occured

virtual int OCameraInputs::iWaitForInputs ( int  iMask,
int  iState 
) [pure virtual]

Wait until one, several or all inputs reach a given state.

The program execution stops at this function until

The default behaviour is infinite blocking. To specify a defined timeout call iSetTimeout().

Parameters:
iMask set of OCameraInputs::t_enCameraInput values ORed together.
For each input set in iMask the corresponding bit in iState denotes the desired state for this input to wait for.
iState state of digital inputs to stop waiting
Returns:
>= 0 ... given condition is met for all inputs
-errno ... always negative (see errno.h) if error or timeout occured

virtual int OCameraInputs::iWaitForInputsChange ( int  iMask  )  [pure virtual]

Wait until one, several or all inputs change their logic levels.

The call returns if one of the selected inputs change. The default behaviour is infinite blocking. To specify a defined timeout call iSetTimeout().

Parameters:
iMask set of OCameraInputs::t_enCameraInput values ORed together
Returns:
>= 0 ... one of the selected inputs changed
-errno ... always negative (see errno.h) if error or timeout occured

static OCameraInputs* OCameraInputs::poCreateInterface (  )  [static]

Call this method to obtain a pointer to the inputs interface.


The documentation for this class was generated from the following file:
Generated on Fri Oct 12 10:31:11 2007 for Festo SBOx-C API by  doxygen 1.5.1-4