MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_feature_report()

int MayaFlux::Core::HIDBackend::get_feature_report ( uint32_t  device_id,
uint8_t  report_id,
std::span< uint8_t >  buffer 
)

Get a feature report from a device.

Parameters
device_idTarget device
report_idReport ID to get
bufferBuffer to receive data
Returns
Number of bytes received, or -1 on error

Definition at line 369 of file HIDBackend.cpp.

370{
371 std::lock_guard lock(m_devices_mutex);
372 auto it = m_open_devices.find(device_id);
373 if (it == m_open_devices.end() || !it->second->handle) {
374 return -1;
375 }
376 buffer[0] = report_id;
377 return hid_get_feature_report(it->second->handle, buffer.data(), buffer.size());
378}
std::unordered_map< uint32_t, std::shared_ptr< HIDDeviceState > > m_open_devices

References m_devices_mutex, and m_open_devices.