BHand Class Reference

There should be one instance of this class created for each BarrettHand. More...

#include <BHand.h>

Inherits BHandSupervisoryRealtime.

Public Member Functions

 BHand ()
 Constructor for the BarrettHand object.
virtual ~BHand ()
 Deconstructor for the BarrettHand object.
int setDeviceDriver (BHandDriver *driver)
 Sets the device driver for this instance of the BarrettHand.
BHandDrivergetDeviceDriver ()
 Gets the device driver for this instance of the BarrettHand.
int setHardwareDesc (unsigned int hwIndex)
 Sets a Hardware Description for the BarrettHand.
BHandHardware * getHardwareDesc ()
 Gets a Hardware Description of the BarrettHand.

Static Public Member Functions

static unsigned int getHardwareNumModels ()
 Gets the number of available BarrettHand model numbers.
static BHandHardware * getHardwareDesc (unsigned int hwIndex)
 Gets a Hardware Description of the given BarrettHand.
static void SetDefaultBaud (unsigned int baud)
 Sets the default serial communication baud rate used by all new BHand instances.
static const char * ErrorMessage (int err)
 Get an error message for a BHand error code.

Detailed Description

There should be one instance of this class created for each BarrettHand.

This class allows access to different BarrettHand Hardware Descriptions. It also contains the device driver for communication with the hand and inherits BHandSupervisoryRealtime. This inheritance means that all high-level supervisory and RealTime control/feedback methods will be callable.

Definition at line 92 of file BHand.h.


Constructor & Destructor Documentation

BHand::BHand (  ) 

Constructor for the BarrettHand object.

There should be one BHand instance created for each BarrettHand being controlled. This constructor initializes the BHand instance as required before any communication with the hardware takes place.

Definition at line 79 of file BHand.cpp.

Here is the call graph for this function:

BHand::~BHand (  )  [virtual]

Deconstructor for the BarrettHand object.

Stops the thread for serial communication and closes the serial communications port for a BHand instance.

Definition at line 122 of file BHand.cpp.


Member Function Documentation

BHandDriver * BHand::getDeviceDriver (  ) 

Gets the device driver for this instance of the BarrettHand.

Parameters:
driver Device driver used for communication with the BarrettHand
Return values:
int Pointer to instance of the Device Driver use by this instance

Definition at line 167 of file BHand.cpp.

unsigned int BHand::getHardwareNumModels (  )  [static]

Gets the number of available BarrettHand model numbers.

Return values:
unsigned int Number of available BarrettHand model numbers

Definition at line 180 of file BHand.cpp.

Referenced by setHardwareDesc().

BHandHardware * BHand::getHardwareDesc ( unsigned int  hwIndex  )  [static]

Gets a Hardware Description of the given BarrettHand.

Parameters:
hwIndex Device driver used for communication with the BarrettHand
Return values:
BHandHardware Pointer to the BarrettHand Hardware Description

Definition at line 190 of file BHand.cpp.

Referenced by BHandSupervisoryRealtime::Command().

int BHand::setHardwareDesc ( unsigned int  hwIndex  ) 

Sets a Hardware Description for the BarrettHand.

Parameters:
hwIndex Hardware Description for the BarrettHand
Return values:
int Error code that is returned will be zero if successful

Definition at line 200 of file BHand.cpp.

Referenced by BHand(), and BHandSupervisoryRealtime::InitSoftware().

Here is the call graph for this function:

BHandHardware * BHand::getHardwareDesc (  ) 

Gets a Hardware Description of the BarrettHand.

Return values:
BHandHardware Pointer to the BarrettHand Hardware Description

Definition at line 214 of file BHand.cpp.

Referenced by setHardwareDesc().

void BHand::SetDefaultBaud ( unsigned int  baud  )  [static]

Sets the default serial communication baud rate used by all new BHand instances.

Although users may desire setting higher baud rates for better RealTime performance, most users will not need to do this. If the global BAUD property is permanently set to a value other than 96 (96 => 9600 bps) then SetDefaultBaud must be called to communicate with the hand at the correct baud rate.

Beware of permanently changing the BAUD property. The GUI is capable of being configured to connect to the hand with baud rates other than 9600 bps. The examples and demos will NOT work unless hand BAUD property is 9600 baud at startup. So it is better to connect to the hand and then increase the baud rate using the Baud method. Note that not all hands are capable of higher baud rates.

Parameters:
baud Only pass in values of 9600, 19200, or 38400

Definition at line 242 of file BHand.cpp.

const char * BHand::ErrorMessage ( int  err  )  [static]

Get an error message for a BHand error code.

Gives a brief error message that describes a BHand error code.

Parameters:
err An error code
Return values:
const char* Pointer to a character array describing error code.

Definition at line 257 of file BHand.cpp.


Generated on Tue Dec 28 20:59:19 2010 for Barrett Hand API by  doxygen 1.6.1