21 #ifndef PLUGINS_USBDMX_USBDMXPLUGIN_H_
22 #define PLUGINS_USBDMX_USBDMXPLUGIN_H_
28 #include "ola/plugin_id.h"
29 #include "olad/Plugin.h"
30 #include "ola/io/Descriptor.h"
41 m_anyma_devices_missing_serial_numbers(
false) {
44 std::string Name()
const {
return PLUGIN_NAME; }
45 std::string Description()
const;
46 ola_plugin_id Id()
const {
return OLA_PLUGIN_USBDMX; }
47 std::string PluginPrefix()
const {
return PLUGIN_PREFIX; }
49 bool AddDeviceDescriptor(
int fd);
50 bool RemoveDeviceDescriptor(
int fd);
54 struct USBDeviceInformation {
55 std::string manufacturer;
60 bool m_anyma_devices_missing_serial_numbers;
61 std::vector<class UsbDevice*> m_devices;
62 std::vector<ola::io::DeviceDescriptor*> m_descriptors;
63 std::set<std::pair<uint8_t, uint8_t> > m_registered_devices;
69 bool SetDefaultPreferences();
71 struct libusb_device *usb_device,
72 const struct libusb_device_descriptor &device_descriptor);
75 struct libusb_device_handle *usb_handle,
76 const struct libusb_device_descriptor &device_descriptor,
77 USBDeviceInformation *device_info);
78 bool MatchManufacturer(
const std::string &expected,
79 const std::string &actual);
80 bool MatchProduct(
const std::string &expected,
const std::string &actual);
81 bool GetDescriptorString(libusb_device_handle *usb_handle,
85 static const char PLUGIN_NAME[];
86 static const char PLUGIN_PREFIX[];
87 static const char LIBUSB_DEBUG_LEVEL_KEY[];
88 static int LIBUSB_DEFAULT_DEBUG_LEVEL;
89 static int LIBUSB_MAX_DEBUG_LEVEL;
94 #endif // PLUGINS_USBDMX_USBDMXPLUGIN_H_