From 6b6bf8f30a2005d696317ac2e72f61fa89e88fd9 Mon Sep 17 00:00:00 2001 From: Roland Ruckerbauer Date: Sun, 22 Dec 2024 12:17:04 +0100 Subject: [PATCH] Conditionally enable get_input_report where supported Its supported via hidapi C library or on linux with the native backend. Not yet implemented on the windows native backend. --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index b68ba69..f2a6f70 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -478,6 +478,7 @@ trait HidDeviceBackendBase { fn get_feature_report(&self, buf: &mut [u8]) -> HidResult; fn send_output_report(&self, data: &[u8]) -> HidResult<()>; fn get_input_report(&self, data: &mut [u8]) -> HidResult; + #[cfg(any(hidapi, target_os = "linux"))] fn set_blocking_mode(&self, blocking: bool) -> HidResult<()>; fn get_device_info(&self) -> HidResult; fn get_manufacturer_string(&self) -> HidResult>; @@ -621,6 +622,7 @@ impl HidDevice { /// /// If successful, returns the number of bytes read plus one for the report ID (which is still /// in the first byte). + #[cfg(any(hidapi, target_os = "linux"))] pub fn get_input_report(&self, data: &mut [u8]) -> HidResult { self.inner.get_input_report(data) }