Skip to content

Commit

Permalink
Conditionally enable get_input_report where supported
Browse files Browse the repository at this point in the history
Its supported via hidapi C library or on linux with the native backend.
Not yet implemented on the windows native backend.
  • Loading branch information
ruabmbua committed Dec 22, 2024
1 parent 912f611 commit 6b6bf8f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ trait HidDeviceBackendBase {
fn get_feature_report(&self, buf: &mut [u8]) -> HidResult<usize>;
fn send_output_report(&self, data: &[u8]) -> HidResult<()>;
fn get_input_report(&self, data: &mut [u8]) -> HidResult<usize>;
#[cfg(any(hidapi, target_os = "linux"))]
fn set_blocking_mode(&self, blocking: bool) -> HidResult<()>;
fn get_device_info(&self) -> HidResult<DeviceInfo>;
fn get_manufacturer_string(&self) -> HidResult<Option<String>>;
Expand Down Expand Up @@ -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<usize> {
self.inner.get_input_report(data)
}
Expand Down

0 comments on commit 6b6bf8f

Please sign in to comment.