@@ -35,7 +35,7 @@ use crate::windows_native::types::{Handle, Overlapped};
3535use crate :: { DeviceInfo , HidDeviceBackendBase , HidDeviceBackendWindows , HidError , HidResult } ;
3636use windows_sys:: core:: GUID ;
3737use windows_sys:: Win32 :: Devices :: HumanInterfaceDevice :: {
38- HidD_GetIndexedString , HidD_SetFeature , HidD_SetNumInputBuffers ,
38+ HidD_GetIndexedString , HidD_SetFeature , HidD_SetNumInputBuffers , HidD_SetOutputReport ,
3939} ;
4040use windows_sys:: Win32 :: Devices :: Properties :: {
4141 DEVPKEY_Device_ContainerId , DEVPKEY_Device_InstanceId ,
@@ -276,6 +276,22 @@ impl HidDeviceBackendBase for HidDevice {
276276 Ok ( bytes_returned as usize )
277277 }
278278
279+ fn send_output_report ( & self , data : & [ u8 ] ) -> HidResult < ( ) > {
280+ ensure ! ( !data. is_empty( ) , Err ( HidError :: InvalidZeroSizeData ) ) ;
281+ let mut state = self . feature_state . borrow_mut ( ) ;
282+ state. fill_buffer ( data) ;
283+
284+ check_boolean ( unsafe {
285+ HidD_SetOutputReport (
286+ self . device_handle . as_raw ( ) ,
287+ state. buffer_ptr ( ) as _ ,
288+ state. buffer_len ( ) as u32 ,
289+ )
290+ } ) ?;
291+
292+ Ok ( ( ) )
293+ }
294+
279295 fn set_blocking_mode ( & self , blocking : bool ) -> HidResult < ( ) > {
280296 self . blocking . set ( blocking) ;
281297 Ok ( ( ) )
0 commit comments