MayaFlux 0.2.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 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 return hid_send_feature_report(it->second->handle, data.data(), data.size());
367}
std::unordered_map< uint32_t, std::shared_ptr< HIDDeviceState > > m_open_devices

References m_devices_mutex, and m_open_devices.