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

◆ send_feature_report()

int MayaFlux::Core::HIDBackend::send_feature_report ( uint32_t  device_id,
std::span< const uint8_t >  data 
)

Send a feature report to a device.

Parameters
device_idTarget device
dataReport data (first byte is report ID)
Returns
Number of bytes sent, or -1 on error

Definition at line 349 of file HIDBackend.cpp.

350{
351 std::lock_guard lock(m_devices_mutex);
352 auto it = m_open_devices.find(device_id);
353 if (it == m_open_devices.end() || !it->second->handle) {
354 return -1;
355 }
356 return hid_send_feature_report(it->second->handle, data.data(), data.size());
357}
std::unordered_map< uint32_t, std::shared_ptr< HIDDeviceState > > m_open_devices

References m_devices_mutex, and m_open_devices.