MRPT  1.9.9
mrpt::comms::CInterfaceFTDI Class Referenceabstract

Detailed Description

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

Definition at line 73 of file CInterfaceFTDI.h.

#include <mrpt/comms/CInterfaceFTDI.h>

Inheritance diagram for mrpt::comms::CInterfaceFTDI:

Public Types

enum  TSeekOrigin { sFromBeginning = 0, sFromCurrent = 1, sFromEnd = 2 }
 Used in CStream::Seek. More...
 

Public Member Functions

 CInterfaceFTDI ()
 Constructor, which loads driver interface (the DLL under Windows). More...
 
 ~CInterfaceFTDI () override
 Destructor, which closes the connection with the chip and unloads the driver interface. More...
 
 CInterfaceFTDI (const CInterfaceFTDI &o)=delete
 This object cannot be copied. More...
 
CInterfaceFTDIoperator= (const CInterfaceFTDI &o)=delete
 This object cannot be copied. More...
 
bool isOpen ()
 Checks whether the chip has been successfully open. More...
 
void OpenBySerialNumber (const std::string &serialNumber)
 Open by device serial number. More...
 
void OpenByDescription (const std::string &description)
 Open by device description. More...
 
void Close ()
 Close the USB device. More...
 
void ResetDevice ()
 Reset the USB device. More...
 
void Purge ()
 Purge the I/O buffers. More...
 
void SetLatencyTimer (unsigned char latency_ms)
 Change the latency timer (in milliseconds) implemented on the FTDI chip: for a few ms, data is not sent to the PC waiting for possible more data, to save USB trafic. More...
 
void SetTimeouts (unsigned long dwReadTimeout_ms, unsigned long dwWriteTimeout_ms)
 Change read & write timeouts, in milliseconds. More...
 
void ListAllDevices (TFTDIDeviceList &outList)
 Generates a list with all FTDI devices connected right now. More...
 
size_t ReadSync (void *Buffer, size_t Count)
 Tries to read, raising no exception if not all the bytes are available, but raising one if there is some communication error. More...
 
size_t WriteSync (const void *Buffer, size_t Count)
 Tries to write, raising no exception if not all the bytes are available, but raising one if there is some communication error. More...
 
size_t ReadBufferImmediate (void *Buffer, size_t Count) override
 Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read, without waiting for more extra bytes to arrive (just those already enqued in the stream). More...
 
size_t Read (void *Buffer, size_t Count) override
 Introduces a pure virtual method responsible for reading from the stream. More...
 
size_t Write (const void *Buffer, size_t Count) override
 Introduces a pure virtual method responsible for writing to the stream. More...
 
uint64_t Seek (int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
 This virtual method does nothing in this class. More...
 
uint64_t getTotalBytesCount () const override
 This virtual method does nothing in this class. More...
 
uint64_t getPosition () const override
 This virtual method does nothing in this class. More...
 
virtual uint64_t Seek (int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning)=0
 Introduces a pure virtual method for moving to a specified position in the streamed resource. More...
 
virtual int printf (const char *fmt,...) MRPT_printf_format_check(2
 Writes a string to the stream in a textual form. More...
 
template<typename CONTAINER_TYPE >
virtual int void printf_vector (const char *fmt, const CONTAINER_TYPE &V, char separator=',')
 Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector element T. More...
 
bool getline (std::string &out_str)
 Reads from the stream until a '
' character is found ('' characters are ignored). More...
 

Protected Member Functions

void ftdi_read (void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytesRead)
 
void ftdi_write (const void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytes)
 

Protected Attributes

mrpt::containers::circular_buffer< uint8_tm_readBuffer
 Used in Read. More...
 

Private Types

enum  FT_STATUS { dummy }
 
typedef FT_STATUS(__stdcall * PtrToOpen) (void *, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToOpenEx) (void *, unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToListDevices) (void *, void *, unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToClose) (unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToRead) (unsigned long, void *, unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToWrite) (unsigned long, const void *, unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToResetDevice) (unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToPurge) (unsigned long, unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToSetTimeouts) (unsigned long, unsigned long, unsigned long)
 
typedef FT_STATUS(__stdcall * PtrToGetQueueStatus) (unsigned long, unsigned long *)
 
typedef FT_STATUS(__stdcall * PtrToSetLatencyTimer) (unsigned long, unsigned char)
 

Private Member Functions

void checkErrorAndRaise (int errorCode)
 
void ftdi_open (void *pvDevice)
 
void ftdi_openEx (void *pArg1, unsigned long dwFlags)
 
void ftdi_listDevices (void *pArg1, void *pArg2, unsigned long dwFlags)
 
void ftdi_getQueueStatus (unsigned long *lpdwAmountInRxQueue)
 
void loadDriver ()
 

Private Attributes

voidm_hmodule
 
unsigned long m_ftHandle
 
PtrToOpen m_pOpen
 
PtrToOpenEx m_pOpenEx
 
PtrToListDevices m_pListDevices
 
PtrToClose m_pClose
 
PtrToRead m_pRead
 
PtrToWrite m_pWrite
 
PtrToResetDevice m_pResetDevice
 
PtrToPurge m_pPurge
 
PtrToSetTimeouts m_pSetTimeouts
 
PtrToGetQueueStatus m_pGetQueueStatus
 
PtrToSetLatencyTimer m_pSetLatencyTimer
 

Member Typedef Documentation

◆ PtrToClose

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToClose) (unsigned long)
private

Definition at line 210 of file CInterfaceFTDI.h.

◆ PtrToGetQueueStatus

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToGetQueueStatus) (unsigned long, unsigned long *)
private

Definition at line 231 of file CInterfaceFTDI.h.

◆ PtrToListDevices

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToListDevices) (void *, void *, unsigned long)
private

Definition at line 207 of file CInterfaceFTDI.h.

◆ PtrToOpen

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToOpen) (void *, unsigned long *)
private

Definition at line 200 of file CInterfaceFTDI.h.

◆ PtrToOpenEx

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToOpenEx) (void *, unsigned long, unsigned long *)
private

Definition at line 203 of file CInterfaceFTDI.h.

◆ PtrToPurge

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToPurge) (unsigned long, unsigned long)
private

Definition at line 224 of file CInterfaceFTDI.h.

◆ PtrToRead

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToRead) (unsigned long, void *, unsigned long, unsigned long *)
private

Definition at line 213 of file CInterfaceFTDI.h.

◆ PtrToResetDevice

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToResetDevice) (unsigned long)
private

Definition at line 221 of file CInterfaceFTDI.h.

◆ PtrToSetLatencyTimer

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToSetLatencyTimer) (unsigned long, unsigned char)
private

Definition at line 235 of file CInterfaceFTDI.h.

◆ PtrToSetTimeouts

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToSetTimeouts) (unsigned long, unsigned long, unsigned long)
private

Definition at line 227 of file CInterfaceFTDI.h.

◆ PtrToWrite

typedef FT_STATUS(__stdcall* mrpt::comms::CInterfaceFTDI::PtrToWrite) (unsigned long, const void *, unsigned long, unsigned long *)
private

Definition at line 217 of file CInterfaceFTDI.h.

Member Enumeration Documentation

◆ FT_STATUS

Enumerator
dummy 

Definition at line 198 of file CInterfaceFTDI.h.

◆ TSeekOrigin

Used in CStream::Seek.

Enumerator
sFromBeginning 
sFromCurrent 
sFromEnd 

Definition at line 32 of file io/CStream.h.

Constructor & Destructor Documentation

◆ CInterfaceFTDI() [1/2]

CInterfaceFTDI::CInterfaceFTDI ( )

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

Definition at line 153 of file CInterfaceFTDI_WIN.cpp.

References loadDriver(), m_ftHandle, MRPT_END, and MRPT_START.

Here is the call graph for this function:

◆ ~CInterfaceFTDI()

CInterfaceFTDI::~CInterfaceFTDI ( )
override

Destructor, which closes the connection with the chip and unloads the driver interface.

Definition at line 166 of file CInterfaceFTDI_WIN.cpp.

References Close(), and m_hmodule.

Here is the call graph for this function:

◆ CInterfaceFTDI() [2/2]

mrpt::comms::CInterfaceFTDI::CInterfaceFTDI ( const CInterfaceFTDI o)
delete

This object cannot be copied.

Member Function Documentation

◆ checkErrorAndRaise()

void CInterfaceFTDI::checkErrorAndRaise ( int  errorCode)
private

Possible responses from the driver enum FT_STATUS { FT_OK = 0, FT_INVALID_HANDLE, FT_DEVICE_NOT_FOUND, FT_DEVICE_NOT_OPENED, FT_IO_ERROR, FT_INSUFFICIENT_RESOURCES, FT_INVALID_PARAMETER };

Definition at line 384 of file CInterfaceFTDI_WIN.cpp.

References Close(), and THROW_EXCEPTION.

Referenced by ftdi_getQueueStatus(), ftdi_listDevices(), ftdi_open(), ftdi_openEx(), ftdi_read(), ftdi_write(), Purge(), ResetDevice(), SetLatencyTimer(), and SetTimeouts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Close()

void CInterfaceFTDI::Close ( )

Close the USB device.

Definition at line 285 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, mrpt::containers::circular_buffer< T >::clear(), m_ftHandle, m_pClose, m_readBuffer, MRPT_END, and MRPT_START.

Referenced by mrpt::hwdrivers::CServoeNeck::checkConnectionAndConnect(), checkErrorAndRaise(), mrpt::hwdrivers::CServoeNeck::disableServo(), mrpt::hwdrivers::CServoeNeck::enableServo(), ftdi_open(), ftdi_openEx(), mrpt::hwdrivers::CServoeNeck::getRegisterValue(), mrpt::hwdrivers::CServoeNeck::queryFirmwareVersion(), mrpt::hwdrivers::CServoeNeck::setRegisterValue(), mrpt::hwdrivers::CServoeNeck::setRegisterValueAndSpeed(), mrpt::hwdrivers::CSickLaserUSB::waitContinuousSampleFrame(), and ~CInterfaceFTDI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ftdi_getQueueStatus()

void CInterfaceFTDI::ftdi_getQueueStatus ( unsigned long *  lpdwAmountInRxQueue)
private

Definition at line 361 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), m_ftHandle, m_pGetQueueStatus, MRPT_END, and MRPT_START.

Here is the call graph for this function:

◆ ftdi_listDevices()

void CInterfaceFTDI::ftdi_listDevices ( void pArg1,
void pArg2,
unsigned long  dwFlags 
)
private

Definition at line 274 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), m_pListDevices, MRPT_END, and MRPT_START.

Referenced by ListAllDevices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ftdi_open()

void CInterfaceFTDI::ftdi_open ( void pvDevice)
private

Definition at line 217 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), Close(), isOpen(), m_ftHandle, m_pOpen, MRPT_END, and MRPT_START.

Here is the call graph for this function:

◆ ftdi_openEx()

void CInterfaceFTDI::ftdi_openEx ( void pArg1,
unsigned long  dwFlags 
)
private

Definition at line 228 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), Close(), isOpen(), m_ftHandle, m_pOpenEx, MRPT_END, and MRPT_START.

Referenced by OpenByDescription(), and OpenBySerialNumber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ftdi_read()

void CInterfaceFTDI::ftdi_read ( void lpvBuffer,
unsigned long  dwBuffSize,
unsigned long *  lpdwBytesRead 
)
protected

Definition at line 301 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), m_ftHandle, m_pRead, MRPT_END, and MRPT_START.

Referenced by Read(), and ReadBufferImmediate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ftdi_write()

void CInterfaceFTDI::ftdi_write ( const void lpvBuffer,
unsigned long  dwBuffSize,
unsigned long *  lpdwBytes 
)
protected

Definition at line 313 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), m_ftHandle, m_pWrite, MRPT_END, and MRPT_START.

Referenced by Write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getline()

bool CStream::getline ( std::string out_str)
inherited

Reads from the stream until a '
' character is found ('' characters are ignored).

Returns
false on EOF or any other read error.

Definition at line 69 of file CStream.cpp.

◆ getPosition()

uint64_t CInterfaceFTDI::getPosition ( ) const
overridevirtual

This virtual method does nothing in this class.

Implements mrpt::io::CStream.

Definition at line 67 of file CInterfaceFTDI_common.cpp.

◆ getTotalBytesCount()

uint64_t CInterfaceFTDI::getTotalBytesCount ( ) const
overridevirtual

This virtual method does nothing in this class.

Implements mrpt::io::CStream.

Definition at line 66 of file CInterfaceFTDI_common.cpp.

◆ isOpen()

bool CInterfaceFTDI::isOpen ( )

◆ ListAllDevices()

void CInterfaceFTDI::ListAllDevices ( TFTDIDeviceList outList)

Generates a list with all FTDI devices connected right now.

Definition at line 242 of file CInterfaceFTDI_WIN.cpp.

References mrpt::comms::TFTDIDevice::ftdi_description, ftdi_listDevices(), mrpt::comms::TFTDIDevice::ftdi_serial, MRPT_END, and MRPT_START.

Here is the call graph for this function:

◆ loadDriver()

void CInterfaceFTDI::loadDriver ( )
private

Definition at line 180 of file CInterfaceFTDI_WIN.cpp.

References m_hmodule, m_pClose, m_pGetQueueStatus, m_pListDevices, m_pOpen, m_pOpenEx, m_pPurge, m_pRead, m_pResetDevice, m_pSetLatencyTimer, m_pSetTimeouts, m_pWrite, MRPT_END, MRPT_START, and THROW_EXCEPTION.

Referenced by CInterfaceFTDI().

Here is the caller graph for this function:

◆ OpenByDescription()

void CInterfaceFTDI::OpenByDescription ( const std::string description)

Open by device description.

Definition at line 437 of file CInterfaceFTDI_WIN.cpp.

References mrpt::containers::circular_buffer< T >::clear(), FT_OPEN_BY_DESCRIPTION, ftdi_openEx(), m_readBuffer, MRPT_END, and MRPT_START.

Here is the call graph for this function:

◆ OpenBySerialNumber()

void CInterfaceFTDI::OpenBySerialNumber ( const std::string serialNumber)

Open by device serial number.

Definition at line 425 of file CInterfaceFTDI_WIN.cpp.

References mrpt::containers::circular_buffer< T >::clear(), FT_OPEN_BY_SERIAL_NUMBER, ftdi_openEx(), m_readBuffer, MRPT_END, and MRPT_START.

Referenced by mrpt::hwdrivers::CServoeNeck::checkConnectionAndConnect(), and mrpt::hwdrivers::CSickLaserUSB::checkControllerIsConnected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

CInterfaceFTDI& mrpt::comms::CInterfaceFTDI::operator= ( const CInterfaceFTDI o)
delete

This object cannot be copied.

◆ printf()

int CStream::printf ( const char *  fmt,
  ... 
)
virtualinherited

Writes a string to the stream in a textual form.

See also
CStdOutStream

Definition at line 30 of file CStream.cpp.

References MRPT_END, MRPT_START, and vsnprintf.

Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel(), and mrpt::io::CStream::printf_vector().

Here is the caller graph for this function:

◆ printf_vector()

template<typename CONTAINER_TYPE >
virtual int void mrpt::io::CStream::printf_vector ( const char *  fmt,
const CONTAINER_TYPE &  V,
char  separator = ',' 
)
inlineinherited

Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector element T.

Template Parameters
CONTAINER_TYPEcan be any vector<T>, deque<T> or alike.

Definition at line 102 of file io/CStream.h.

References mrpt::io::CStream::printf().

Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Purge()

void CInterfaceFTDI::Purge ( )

Purge the I/O buffers.

Definition at line 337 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), mrpt::containers::circular_buffer< T >::clear(), FT_PURGE_RX, FT_PURGE_TX, m_ftHandle, m_pPurge, m_readBuffer, MRPT_END, and MRPT_START.

Referenced by mrpt::hwdrivers::CServoeNeck::checkConnectionAndConnect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read()

size_t CInterfaceFTDI::Read ( void Buffer,
size_t  Count 
)
overridevirtual

Introduces a pure virtual method responsible for reading from the stream.

It integrates a cache buffer to speed-up sequences of many, small readings.

Implements mrpt::io::CStream.

Definition at line 18 of file CInterfaceFTDI_common.cpp.

References mrpt::containers::circular_buffer< T >::available(), ftdi_read(), m_readBuffer, min, mrpt::containers::circular_buffer< T >::pop_many(), mrpt::containers::circular_buffer< T >::push_many(), and mrpt::containers::circular_buffer< T >::size().

Referenced by ReadSync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadBufferImmediate()

size_t CInterfaceFTDI::ReadBufferImmediate ( void Buffer,
size_t  Count 
)
overridevirtual

Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read, without waiting for more extra bytes to arrive (just those already enqued in the stream).

In this class this method actually behaves as expected and does not fallback to ReadBuffer().

Exceptions
std::exceptionOn any error, or if ZERO bytes are read.

Reimplemented from mrpt::io::CStream.

Definition at line 68 of file CInterfaceFTDI_common.cpp.

References ftdi_read().

Here is the call graph for this function:

◆ ReadSync()

size_t mrpt::comms::CInterfaceFTDI::ReadSync ( void Buffer,
size_t  Count 
)
inline

Tries to read, raising no exception if not all the bytes are available, but raising one if there is some communication error.

Definition at line 129 of file CInterfaceFTDI.h.

References Read().

Referenced by mrpt::hwdrivers::CSickLaserUSB::waitContinuousSampleFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetDevice()

void CInterfaceFTDI::ResetDevice ( )

Reset the USB device.

Definition at line 325 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), mrpt::containers::circular_buffer< T >::clear(), m_ftHandle, m_pResetDevice, m_readBuffer, MRPT_END, and MRPT_START.

Referenced by mrpt::hwdrivers::CSickLaserUSB::checkControllerIsConnected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Seek() [1/2]

virtual uint64_t mrpt::io::CStream::Seek ( int64_t  Offset,
CStream::TSeekOrigin  Origin = sFromBeginning 
)
pure virtualinherited

Introduces a pure virtual method for moving to a specified position in the streamed resource.

he Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

  • sFromBeginning (Default) Offset is from the beginning of the resource. Seek moves to the position Offset. Offset must be >= 0.
  • sFromCurrent Offset is from the current position in the resource. Seek moves to Position + Offset.
  • sFromEnd Offset is from the end of the resource. Offset must be <= 0 to indicate a number of bytes before the end of the file.
    Returns
    Seek returns the new value of the Position property.

Implemented in mrpt::io::CPipeBaseEndPoint, mrpt::io::CFileStream, mrpt::io::CFileGZInputStream, mrpt::io::CMemoryStream, mrpt::io::CFileGZOutputStream, mrpt::io::CFileOutputStream, and mrpt::io::CFileInputStream.

◆ Seek() [2/2]

uint64_t CInterfaceFTDI::Seek ( int64_t  Offset,
CStream::TSeekOrigin  Origin = sFromBeginning 
)
override

This virtual method does nothing in this class.

Definition at line 61 of file CInterfaceFTDI_common.cpp.

◆ SetLatencyTimer()

void CInterfaceFTDI::SetLatencyTimer ( unsigned char  latency_ms)

Change the latency timer (in milliseconds) implemented on the FTDI chip: for a few ms, data is not sent to the PC waiting for possible more data, to save USB trafic.

Definition at line 371 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), m_ftHandle, m_pSetLatencyTimer, MRPT_END, and MRPT_START.

Referenced by mrpt::hwdrivers::CServoeNeck::checkConnectionAndConnect(), and mrpt::hwdrivers::CSickLaserUSB::checkControllerIsConnected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetTimeouts()

void CInterfaceFTDI::SetTimeouts ( unsigned long  dwReadTimeout_ms,
unsigned long  dwWriteTimeout_ms 
)

Change read & write timeouts, in milliseconds.

Definition at line 349 of file CInterfaceFTDI_WIN.cpp.

References ASSERT_, checkErrorAndRaise(), m_ftHandle, m_pSetTimeouts, MRPT_END, and MRPT_START.

Referenced by mrpt::hwdrivers::CServoeNeck::checkConnectionAndConnect(), and mrpt::hwdrivers::CSickLaserUSB::checkControllerIsConnected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write()

size_t CInterfaceFTDI::Write ( const void Buffer,
size_t  Count 
)
overridevirtual

Introduces a pure virtual method responsible for writing to the stream.

Write attempts to write up to Count bytes to Buffer, and returns the number of bytes actually written.

Implements mrpt::io::CStream.

Definition at line 54 of file CInterfaceFTDI_common.cpp.

References ftdi_write().

Referenced by WriteSync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteSync()

size_t mrpt::comms::CInterfaceFTDI::WriteSync ( const void Buffer,
size_t  Count 
)
inline

Tries to write, raising no exception if not all the bytes are available, but raising one if there is some communication error.

Definition at line 133 of file CInterfaceFTDI.h.

References Write().

Here is the call graph for this function:

Member Data Documentation

◆ m_ftHandle

unsigned long mrpt::comms::CInterfaceFTDI::m_ftHandle
private

◆ m_hmodule

void* mrpt::comms::CInterfaceFTDI::m_hmodule
private

Definition at line 193 of file CInterfaceFTDI.h.

Referenced by loadDriver(), and ~CInterfaceFTDI().

◆ m_pClose

PtrToClose mrpt::comms::CInterfaceFTDI::m_pClose
private

Definition at line 211 of file CInterfaceFTDI.h.

Referenced by Close(), and loadDriver().

◆ m_pGetQueueStatus

PtrToGetQueueStatus mrpt::comms::CInterfaceFTDI::m_pGetQueueStatus
private

Definition at line 233 of file CInterfaceFTDI.h.

Referenced by ftdi_getQueueStatus(), and loadDriver().

◆ m_pListDevices

PtrToListDevices mrpt::comms::CInterfaceFTDI::m_pListDevices
private

Definition at line 208 of file CInterfaceFTDI.h.

Referenced by ftdi_listDevices(), and loadDriver().

◆ m_pOpen

PtrToOpen mrpt::comms::CInterfaceFTDI::m_pOpen
private

Definition at line 201 of file CInterfaceFTDI.h.

Referenced by ftdi_open(), and loadDriver().

◆ m_pOpenEx

PtrToOpenEx mrpt::comms::CInterfaceFTDI::m_pOpenEx
private

Definition at line 205 of file CInterfaceFTDI.h.

Referenced by ftdi_openEx(), and loadDriver().

◆ m_pPurge

PtrToPurge mrpt::comms::CInterfaceFTDI::m_pPurge
private

Definition at line 225 of file CInterfaceFTDI.h.

Referenced by loadDriver(), and Purge().

◆ m_pRead

PtrToRead mrpt::comms::CInterfaceFTDI::m_pRead
private

Definition at line 215 of file CInterfaceFTDI.h.

Referenced by ftdi_read(), and loadDriver().

◆ m_pResetDevice

PtrToResetDevice mrpt::comms::CInterfaceFTDI::m_pResetDevice
private

Definition at line 222 of file CInterfaceFTDI.h.

Referenced by loadDriver(), and ResetDevice().

◆ m_pSetLatencyTimer

PtrToSetLatencyTimer mrpt::comms::CInterfaceFTDI::m_pSetLatencyTimer
private

Definition at line 237 of file CInterfaceFTDI.h.

Referenced by loadDriver(), and SetLatencyTimer().

◆ m_pSetTimeouts

PtrToSetTimeouts mrpt::comms::CInterfaceFTDI::m_pSetTimeouts
private

Definition at line 229 of file CInterfaceFTDI.h.

Referenced by loadDriver(), and SetTimeouts().

◆ m_pWrite

PtrToWrite mrpt::comms::CInterfaceFTDI::m_pWrite
private

Definition at line 219 of file CInterfaceFTDI.h.

Referenced by ftdi_write(), and loadDriver().

◆ m_readBuffer

mrpt::containers::circular_buffer<uint8_t> mrpt::comms::CInterfaceFTDI::m_readBuffer
protected

Used in Read.

Definition at line 175 of file CInterfaceFTDI.h.

Referenced by Close(), OpenByDescription(), OpenBySerialNumber(), Purge(), Read(), and ResetDevice().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019