#include <rmp_ftd2xx.h>
Public Member Functions | |
void | configureUSBByDescription (std::string description, int baudrate) |
void | configureUSBByIndex (unsigned int device_index, int baudrate) |
void | configureUSBBySerial (std::string serial_number, int baudrate) |
void | connect () |
void | disconnect () |
FTD2XXRMPIO () | |
int | read (unsigned char *buffer, int size) |
int | write (unsigned char *buffer, int size) |
~FTD2XXRMPIO () | |
Private Member Functions | |
void | connectByDescription () |
void | connectByIndex () |
void | connectBySerial () |
std::vector < FT_DEVICE_LIST_INFO_NODE > | enumerateUSBDevices_ () |
Private Attributes | |
int | baudrate |
ConfigurationType | config_type |
bool | configured |
bool | is_open |
std::string | port_description |
unsigned int | port_index |
std::string | port_serial_number |
FT_HANDLE | usb_port_handle |
Definition at line 59 of file rmp_ftd2xx.h.
Constructs the FTD2XXRMPIO object.
Definition at line 145 of file rmp_ftd2xx.cc.
Definition at line 155 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::configureUSBByDescription | ( | std::string | description, |
int | baudrate | ||
) |
Configures the usb port using the devices Description.
description | The description of the RMP device, something like 'Robotic Mobile Platform'. |
baudrate | The speed of the usb communication. |
Definition at line 324 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::configureUSBByIndex | ( | unsigned int | device_index, |
int | baudrate | ||
) |
Configures the usb port using the devices index.
device_index | The index of the FTDI, something like 0. This is its index amoung all FTD2XX devices on the system. |
baudrate | The speed of the usb communication. |
Definition at line 351 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::configureUSBBySerial | ( | std::string | serial_number, |
int | baudrate | ||
) |
Configures the usb port using the devices Serial Number.
serial_number | The serial number of the RMP device, something like '00000056'. |
baudrate | The speed of the usb communication. |
Definition at line 296 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::connect | ( | ) | [virtual] |
Connects to the usb port if it has been configured. Can throw ConnectionFailedException.
Implements segwayrmp::RMPIO.
Definition at line 159 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::connectByDescription | ( | ) | [private] |
Definition at line 332 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::connectByIndex | ( | ) | [private] |
Definition at line 359 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::connectBySerial | ( | ) | [private] |
Definition at line 304 of file rmp_ftd2xx.cc.
void FTD2XXRMPIO::disconnect | ( | ) | [virtual] |
Disconnects from the usb port if it is open.
Implements segwayrmp::RMPIO.
Definition at line 248 of file rmp_ftd2xx.cc.
std::vector< FT_DEVICE_LIST_INFO_NODE > FTD2XXRMPIO::enumerateUSBDevices_ | ( | ) | [private] |
Definition at line 291 of file rmp_ftd2xx.cc.
int FTD2XXRMPIO::read | ( | unsigned char * | buffer, |
int | size | ||
) | [virtual] |
Read Function, reads from the usb port.
buffer | An unsigned char array for data to be read into. |
size | The amount of data to be read. |
Implements segwayrmp::RMPIO.
Definition at line 257 of file rmp_ftd2xx.cc.
int FTD2XXRMPIO::write | ( | unsigned char * | buffer, |
int | size | ||
) | [virtual] |
Write Function, writes to the usb port.
buffer | An unsigned char array of data to be written. |
size | The amount of data to be written. |
Implements segwayrmp::RMPIO.
Definition at line 274 of file rmp_ftd2xx.cc.
int segwayrmp::FTD2XXRMPIO::baudrate [private] |
Definition at line 136 of file rmp_ftd2xx.h.
Definition at line 130 of file rmp_ftd2xx.h.
bool segwayrmp::FTD2XXRMPIO::configured [private] |
Definition at line 126 of file rmp_ftd2xx.h.
bool segwayrmp::FTD2XXRMPIO::is_open [private] |
Definition at line 128 of file rmp_ftd2xx.h.
std::string segwayrmp::FTD2XXRMPIO::port_description [private] |
Definition at line 133 of file rmp_ftd2xx.h.
unsigned int segwayrmp::FTD2XXRMPIO::port_index [private] |
Definition at line 134 of file rmp_ftd2xx.h.
std::string segwayrmp::FTD2XXRMPIO::port_serial_number [private] |
Definition at line 132 of file rmp_ftd2xx.h.
Definition at line 138 of file rmp_ftd2xx.h.