34 #ifndef PLUGINS_FTDIDMX_FTDIWIDGET_H_
35 #define PLUGINS_FTDIDMX_FTDIWIDGET_H_
55 static const uint16_t FTDI_VID;
56 static const uint16_t FT232_PID;
57 static const uint16_t FT4232_PID;
60 const std::string &serial,
62 const uint16_t vid = FTDI_VID,
63 const uint16_t pid = FT232_PID)
72 : m_name(info.Name()),
73 m_serial(info.Serial()),
81 std::string Name()
const {
return m_name; }
82 std::string Serial()
const {
return m_serial; }
84 unsigned int Id()
const {
return m_id; }
85 uint16_t Vid()
const {
return m_vid; }
86 uint16_t Pid()
const {
return m_pid; }
88 std::string Description()
const {
89 return m_name +
" with serial number : " + m_serial +
" ";
94 m_name = other.Name();
95 m_serial = other.Serial();
105 std::string m_serial;
126 const std::string &name,
128 const uint16_t vid = FtdiWidgetInfo::FTDI_VID,
129 const uint16_t pid = FtdiWidgetInfo::FT232_PID);
135 std::string
Serial()
const {
return m_serial; }
138 std::string
Name()
const {
return m_name; }
140 uint16_t Vid()
const {
return m_vid; }
141 uint16_t Pid()
const {
return m_pid; }
144 uint32_t
Id()
const {
return m_id; }
146 std::string Description()
const {
147 return m_name +
" with serial number : " + m_serial +
" ";
157 static void Widgets(std::vector<FtdiWidgetInfo> *widgets);
161 static const int libftdi_ftdi_usb_get_strings_get_serial_failed = -9;
163 static bool m_missing_serial;
166 std::string m_serial;
169 const uint16_t m_vid;
170 const uint16_t m_pid;
176 const ftdi_interface interface);
180 std::string Description()
const {
181 return m_parent->Description();
221 bool Read(
unsigned char* buff,
int size);
228 struct ftdi_context m_handle;
229 const ftdi_interface m_interface;
234 #endif // PLUGINS_FTDIDMX_FTDIWIDGET_H_