libnifalcon::FalconCommFTD2XX Class Reference
[Communications Classes]

#include <FalconCommFTD2XX.h>

Inherits libnifalcon::FalconComm.

Collaboration diagram for libnifalcon::FalconCommFTD2XX:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FalconCommFTD2XX ()
virtual ~FalconCommFTD2XX ()
virtual bool getDeviceCount (unsigned int &count)
virtual void poll ()
virtual bool open (unsigned int index)
virtual bool close ()
virtual bool read (uint8_t *str, unsigned int size)
virtual bool write (uint8_t *str, unsigned int size)
virtual bool readBlocking (uint8_t *str, unsigned int size)
virtual bool writeBlocking (uint8_t *str, unsigned int size)
virtual bool setFirmwareMode ()
virtual bool setNormalMode ()

Protected Member Functions

int8_t openDeviceFTD2XX (unsigned int index, bool should_open)

Protected Attributes

void * m_falconDevice

Static Protected Attributes

static const char * FALCON_DESCRIPTION = "FALCON HAPTIC"


Detailed Description

FalconCommFTD2XX is the FTD2XX implementation of the falcon communications core. This core is meant to be used on Windows, where the FTD2XX driver is the factory standard driver for the falcon. This means that libnifalcon code can work alongside the regular HDAL drivers.

FalconCommFTD2XX is built directly into the libnifalcon core library, as is chosen for the user by default by the FalconDevice constructor, so it is usually not needed. However, it is left here for code compatibility for code that already used comm behavior setting, which was required before libnifalcon v1.0


Constructor & Destructor Documentation

libnifalcon::FalconCommFTD2XX::FalconCommFTD2XX (  )  [inline]

Constructor

libnifalcon::FalconCommFTD2XX::~FalconCommFTD2XX (  )  [virtual]

Destructor


Member Function Documentation

bool libnifalcon::FalconCommFTD2XX::close (  )  [virtual]

Closes the device, if open

Returns:
True if device is closed successfully, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

bool libnifalcon::FalconCommFTD2XX::getDeviceCount ( unsigned int &  count  )  [virtual]

Returns the number of devices connected to the system

Parameters:
[out] count The number of devices available
Returns:
True if count was retreived correctly, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

bool libnifalcon::FalconCommFTD2XX::open ( unsigned int  index  )  [virtual]

Opens the device at the specified index

Parameters:
[in] index Index of the device to open
Returns:
True if device is opened successfully, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

int8_t libnifalcon::FalconCommFTD2XX::openDeviceFTD2XX ( unsigned int  index,
bool  should_open 
) [protected]

Internal device opening function

Parameters:
[in] index Index of device to open
[in] should_open If true, open. If false, return count
Returns:
If should_open is true, non-zero if device opened. If should_open is false, device count or -1 if can't get count.

void libnifalcon::FalconCommFTD2XX::poll (  )  [virtual]

Polls the object for confirmation of write/read return

Reimplemented from libnifalcon::FalconComm.

bool libnifalcon::FalconCommFTD2XX::read ( uint8_t *  str,
unsigned int  size 
) [virtual]

Read a specified number of bytes from the device

Parameters:
[out] str Buffer to read data into
[in] size Amount of bytes to read
Returns:
True if (size) amount of bytes is read successfully, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

bool libnifalcon::FalconCommFTD2XX::readBlocking ( uint8_t *  str,
unsigned int  size 
) [virtual]

Read a specified number of bytes from the device

Parameters:
[out] str Buffer to read data into
[in] size Amount of bytes to read
Returns:
True if (size) amount of bytes is read successfully, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

bool libnifalcon::FalconCommFTD2XX::setFirmwareMode (  )  [virtual]

Sets the communications mode and initializes the device to load firmware

Returns:
True if device is successfully set to load firwmare, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

bool libnifalcon::FalconCommFTD2XX::setNormalMode (  )  [virtual]

Sets the communications mode and initializes the device to run in normal operation

Returns:
True if device is successfully set to normal operation, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

bool libnifalcon::FalconCommFTD2XX::write ( uint8_t *  str,
unsigned int  size 
) [virtual]

Write a specified number of bytes to the device

Parameters:
[in] str Buffer to write data from
[in] size Amount of bytes to write
Returns:
True if (size) amount of bytes is written successfully, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.

virtual bool libnifalcon::FalconCommFTD2XX::writeBlocking ( uint8_t *  str,
unsigned int  size 
) [inline, virtual]

Write a specified number of bytes to the device

Parameters:
[in] str Buffer to write data from
[in] size Amount of bytes to write
Returns:
True if (size) amount of bytes is written successfully, false otherwise. Error code set if false.

Implements libnifalcon::FalconComm.


Member Data Documentation

const char * libnifalcon::FalconCommFTD2XX::FALCON_DESCRIPTION = "FALCON HAPTIC" [static, protected]

String describing the falcon (used for identification)

Internal pointer to ftdi device struct

This would usually be a FT_HANDLE, but FT_HANDLE is just a void*, so this saves us having to deal with the include at this level.


The documentation for this class was generated from the following files:

Generated on Sun Sep 20 12:24:28 2009 for libnifalcon by  doxygen 1.5.9