35#ifndef PLUGINS_FTDIDMX_FTDIWIDGET_H_
36#define PLUGINS_FTDIDMX_FTDIWIDGET_H_
43#include <libftdi1/ftdi.h>
65 static const uint16_t FTDI_VID;
66 static const uint16_t FT232_PID;
67 static const uint16_t FT4232_PID;
70 const std::string &serial,
72 const uint16_t vid = FTDI_VID,
73 const uint16_t pid = FT232_PID)
82 : m_name(info.Name()),
83 m_serial(info.Serial()),
91 std::string Name()
const {
return m_name; }
92 std::string Serial()
const {
return m_serial; }
94 unsigned int Id()
const {
return m_id; }
95 uint16_t Vid()
const {
return m_vid; }
96 uint16_t Pid()
const {
return m_pid; }
98 std::string Description()
const {
99 return m_name +
" with serial number : " + m_serial +
" ";
103 if (
this != &other) {
104 m_name = other.Name();
105 m_serial = other.Serial();
115 std::string m_serial;
136 const std::string &name,
138 const uint16_t vid = FtdiWidgetInfo::FTDI_VID,
139 const uint16_t pid = FtdiWidgetInfo::FT232_PID);
145 std::string
Serial()
const {
return m_serial; }
148 std::string
Name()
const {
return m_name; }
150 uint16_t Vid()
const {
return m_vid; }
151 uint16_t Pid()
const {
return m_pid; }
154 uint32_t
Id()
const {
return m_id; }
156 std::string Description()
const {
157 return m_name +
" with serial number : " + m_serial +
" ";
167 static void Widgets(std::vector<FtdiWidgetInfo> *widgets);
171 static const int libftdi_ftdi_usb_get_strings_get_serial_failed = -9;
173 static bool m_missing_serial;
176 std::string m_serial;
179 const uint16_t m_vid;
180 const uint16_t m_pid;
186 const ftdi_interface interface);
190 std::string Description()
const {
191 return m_parent->Description();
231 bool Read(
unsigned char* buff,
int size);
238 struct ftdi_context m_handle;
239 const ftdi_interface m_interface;
A class used to hold a single universe of DMX data.
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
Definition FtdiWidget.h:183
bool SetInterface()
Set interface on the widget.
Definition FtdiWidget.cpp:229
bool Open()
Open the widget.
Definition FtdiWidget.cpp:240
bool SetBreak(bool on)
Toggle communications line BREAK condition on/off.
Definition FtdiWidget.cpp:341
bool PurgeBuffers()
Purge TX & RX buffers.
Definition FtdiWidget.cpp:331
bool Close()
Close the widget.
Definition FtdiWidget.cpp:267
bool ClearRts()
Clear the RTS bit.
Definition FtdiWidget.cpp:321
bool IsOpen() const
Check if the widget is open.
Definition FtdiWidget.cpp:277
bool Reset()
Reset the communications line.
Definition FtdiWidget.cpp:281
bool SetFlowControl()
Disable flow control.
Definition FtdiWidget.cpp:311
bool SetupOutput()
Setup device for DMX Output.
Definition FtdiWidget.cpp:379
bool SetBaudRate(int speed=250000)
Set 250kbps baud rate.
Definition FtdiWidget.cpp:301
bool SetLineProperties()
Setup communications line for 8N2 traffic.
Definition FtdiWidget.cpp:291
bool Write(const ola::DmxBuffer &data)
Write data to a previously-opened line.
Definition FtdiWidget.cpp:352
bool Read(unsigned char *buff, int size)
Read data from a previously-opened line.
Definition FtdiWidget.cpp:368
The namespace containing all OLA symbols.
Definition Credentials.cpp:44