MayaFlux 1.0.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 359 of file HIDBackend.cpp.

360{
361 std::lock_guard lock(m_devices_mutex);
362 auto it = m_open_devices.find(device_id);
363 if (it == m_open_devices.end() || !it->second->handle) {
364 return -1;
365 }
366 buffer[0] = report_id;
367 return hid_get_feature_report(it->second->handle, buffer.data(), buffer.size());
368}
std::shared_ptr< NetworkGeometryBuffer > buffer
uint8_t report_id
std::unordered_map< uint32_t, std::shared_ptr< HIDDeviceState > > m_open_devices

References buffer, m_devices_mutex, m_open_devices, and report_id.