@@ -476,6 +476,7 @@ trait HidDeviceBackendBase {
476476 fn read_timeout ( & self , buf : & mut [ u8 ] , timeout : i32 ) -> HidResult < usize > ;
477477 fn send_feature_report ( & self , data : & [ u8 ] ) -> HidResult < ( ) > ;
478478 fn get_feature_report ( & self , buf : & mut [ u8 ] ) -> HidResult < usize > ;
479+ fn send_output_report ( & self , data : & [ u8 ] ) -> HidResult < ( ) > ;
479480 fn set_blocking_mode ( & self , blocking : bool ) -> HidResult < ( ) > ;
480481 fn get_device_info ( & self ) -> HidResult < DeviceInfo > ;
481482 fn get_manufacturer_string ( & self ) -> HidResult < Option < String > > ;
@@ -594,6 +595,23 @@ impl HidDevice {
594595 self . inner . get_feature_report ( buf)
595596 }
596597
598+ // Send a Output report to the device.
599+ //
600+ // Output reports are sent over the Control endpoint as a Set_Report
601+ // transfer. The first byte of data[] must contain the Report ID.
602+ // For devices which only support a single report, this must be set
603+ // to 0x0. The remaining bytes contain the report data. Since the
604+ // Report ID is mandatory, calls to hid_send_output_report() will
605+ // always contain one more byte than the report contains. For example,
606+ // if a hid report is 16 bytes long, 17 bytes must be passed to
607+ // hid_send_output_report(): the Report ID (or 0x0, for devices
608+ // which do not use numbered reports), followed by the report
609+ // data (16 bytes). In this example, the length passed in
610+ // would be 17.
611+ pub fn send_output_report ( & self , data : & [ u8 ] ) -> HidResult < ( ) > {
612+ self . inner . send_output_report ( data)
613+ }
614+
597615 /// Set the device handle to be in blocking or in non-blocking mode. In
598616 /// non-blocking mode calls to `read()` will return immediately with an empty
599617 /// slice if there is no data to be read. In blocking mode, `read()` will
0 commit comments