rmp_ftd2xx.h
Go to the documentation of this file.
1 
38 #ifndef RMP_FTD2XX_H
39 #define RMP_FTD2XX_H
40 
41 #include "segwayrmp/impl/rmp_io.h"
42 
43 #include "segwayrmp/ftd2xx.h"
44 
45 namespace segwayrmp {
46 
50 typedef enum {
53  by_index = 2,
54  by_none = 3
56 
57 std::vector<FT_DEVICE_LIST_INFO_NODE> enumerateUSBDevices();
58 
59 class FTD2XXRMPIO : public RMPIO {
60 public:
64  FTD2XXRMPIO();
65  ~FTD2XXRMPIO();
66 
70  void connect();
71 
75  void disconnect();
76 
84  int read(unsigned char* buffer, int size);
85 
93  int write(unsigned char* buffer, int size);
94 
101  void configureUSBBySerial(std::string serial_number, int baudrate);
102 
109  void configureUSBByDescription(std::string description, int baudrate);
110 
118  void configureUSBByIndex(unsigned int device_index, int baudrate);
119 
120 private:
121  std::vector<FT_DEVICE_LIST_INFO_NODE> enumerateUSBDevices_();
122  void connectBySerial();
123  void connectByDescription();
124  void connectByIndex();
125 
127 
128  bool is_open;
129 
131 
132  std::string port_serial_number;
133  std::string port_description;
134  unsigned int port_index;
135 
136  int baudrate;
137 
139 };
140 
141 }
142 
143 #endif
int read(unsigned char *buffer, int size)
Definition: rmp_ftd2xx.cc:257
void configureUSBByDescription(std::string description, int baudrate)
Definition: rmp_ftd2xx.cc:324
ConfigurationType
Definition: rmp_ftd2xx.h:50
std::vector< FT_DEVICE_LIST_INFO_NODE > enumerateUSBDevices_()
Definition: rmp_ftd2xx.cc:291
ConfigurationType config_type
Definition: rmp_ftd2xx.h:130
int write(unsigned char *buffer, int size)
Definition: rmp_ftd2xx.cc:274
PVOID FT_HANDLE
Definition: ftd2xx.h:73
unsigned int port_index
Definition: rmp_ftd2xx.h:134
FT_HANDLE usb_port_handle
Definition: rmp_ftd2xx.h:138
std::string port_serial_number
Definition: rmp_ftd2xx.h:132
void configureUSBByIndex(unsigned int device_index, int baudrate)
Definition: rmp_ftd2xx.cc:351
void configureUSBBySerial(std::string serial_number, int baudrate)
Definition: rmp_ftd2xx.cc:296
std::string port_description
Definition: rmp_ftd2xx.h:133
std::vector< FT_DEVICE_LIST_INFO_NODE > enumerateUSBDevices()
Definition: rmp_ftd2xx.cc:78


libsegwayrmp
Author(s): William Woodall
autogenerated on Mon Jun 10 2019 13:46:49