26 [[nodiscard]]
bool matches(uint16_t vid, uint16_t pid,
27 uint16_t upage = 0, uint16_t usg = 0)
const
29 if (vendor_id && *vendor_id != vid)
31 if (product_id && *product_id != pid)
33 if (usage_page && *usage_page != upage)
36 return !usage || *usage == usg;
51 .product_id = std::nullopt,
62 .product_id = std::nullopt,
73 .product_id = std::nullopt,
84 .product_id = std::nullopt,
96 .usage_page = std::nullopt,
109 size_t read_buffer_size { 64 };
110 int poll_timeout_ms { 10 };
111 bool auto_reconnect {
true };
112 uint32_t reconnect_interval_ms { 1000 };
123 bool enabled {
false };
124 bool auto_open_inputs {
true };
125 bool auto_open_outputs {
false };
128 bool enable_virtual_port {
false };
129 std::string virtual_port_name {
"MayaFlux" };
140 bool enabled {
false };
141 uint16_t receive_port { 8000 };
142 uint16_t send_port { 9000 };
143 std::string send_address {
"127.0.0.1" };
144 bool enable_multicast {
false };
146 size_t receive_buffer_size { 65536 };
158 uint32_t baud_rate { 9600 };
159 uint8_t data_bits { 8 };
160 uint8_t stop_bits { 1 };
162 bool flow_control {
false };
169 bool enabled {
false };
170 std::vector<SerialPortConfig>
ports;
171 bool auto_detect_arduino {
false };
172 uint32_t default_baud_rate { 115200 };
218 config.
hid.
filters.push_back(HIDDeviceFilter::controller());
219 config.
hid.
filters.push_back(HIDDeviceFilter::specialized());
bool enabled
Enable HID backend.
std::vector< HIDDeviceFilter > filters
Device filters (empty = all devices)
HID backend configuration.
std::optional< uint16_t > usage
HID usage (nullopt = any)
static HIDDeviceFilter controller()
Match gamepads (Usage Page 0x01, Usage 0x05)
static HIDDeviceFilter device(uint16_t vid, uint16_t pid)
Match specific device by VID/PID.
static HIDDeviceFilter mouse()
Match mice (Usage Page 0x01, Usage 0x02)
std::optional< uint16_t > vendor_id
USB Vendor ID (nullopt = any)
std::optional< uint16_t > product_id
USB Product ID (nullopt = any)
std::optional< uint16_t > usage_page
HID usage page (nullopt = any)
static HIDDeviceFilter any()
Match any HID device.
static HIDDeviceFilter specialized()
Match joysticks (Usage Page 0x01, Usage 0x04)
bool matches(uint16_t vid, uint16_t pid, uint16_t upage=0, uint16_t usg=0) const
Check if a device matches this filter.
static HIDDeviceFilter keyboard()
Match keyboards (Usage Page 0x01, Usage 0x06)
Filter for HID device enumeration.
bool enabled
Enable MIDI backend.
std::vector< std::string > input_port_filters
Filter input ports by name substring.
std::vector< std::string > output_port_filters
Filter output ports by name substring.
MIDI backend configuration.
std::string multicast_group
Multicast group address.
uint16_t receive_port
UDP port to listen on.
bool enabled
Enable OSC backend.
OSC backend configuration.
bool enabled
Enable Serial backend.
std::vector< SerialPortConfig > ports
Ports to open.
Serial backend configuration.
std::string port_name
e.g., "/dev/ttyUSB0" or "COM3"
Serial port configuration.