class mrpt::comms::CInterfaceFTDI

A definition of a CStream actually representing a USB connection to a FTDI chip.

This class implements the communication with FT245BM / FT245RL chips. Using this class makes a program to depend on:

  • Windows: “FT2XX.DLL” and the device drivers (see FTDI website).

  • Linux: “libusb.so” (quite standard!), and “libftdi.so” only if linking against the dynamic library.

If there is any error during the communications (or loading the Windows DLL), a std::exception will be raised.

To write bulk data, use CStream::ReadBuffer and CStream::WriteBuffer.

Warning: Avoid defining an object of this class in a global scope if you want to catch all potential exceptions during the constructors (like DLL not found, etc…)

VERSIONS:

  • 11/APR/2005: Initial development. JLBC

  • 16/FEB/2007: Integration into the MRPT framework. Support for device serial numbers. JLBC

  • 15/APR/2008: Implemented for Linux using libftdi. JLBC

See also:

CStream

#include <mrpt/comms/CInterfaceFTDI.h>

class CInterfaceFTDI: public mrpt::io::CStream
{
public:
    // construction

    CInterfaceFTDI();
    CInterfaceFTDI(const CInterfaceFTDI& o);

    //
methods

    CInterfaceFTDI& operator = (const CInterfaceFTDI& o);
};

// direct descendants

class CBoardSonars;
class CServoeNeck;

Inherited Members

public:
    //
methods

    virtual size_t Read(void* Buffer, size_t Count) = 0;
    virtual size_t Write(const void* Buffer, size_t Count) = 0;
    virtual uint64_t getTotalBytesCount() const = 0;
    virtual uint64_t getPosition() const = 0;

Construction

CInterfaceFTDI()

Constructor, which loads driver interface (the DLL under Windows).

CInterfaceFTDI(const CInterfaceFTDI& o)

This object cannot be copied.

Methods

CInterfaceFTDI& operator = (const CInterfaceFTDI& o)

This object cannot be copied.