Skip to content

Commit

Permalink
hiddevice: add AsRawFd impl
Browse files Browse the repository at this point in the history
This is useful to allow performing custom ioctls/operations on
nonstandard HID devices.
  • Loading branch information
dario23 committed Feb 6, 2024
1 parent 3d2eb50 commit 28b93f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/linux_native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,12 @@ impl HidDevice {
}
}

impl AsRawFd for HidDevice {
fn as_raw_fd(&self) -> RawFd {
self.fd.as_raw_fd()
}
}

impl HidDeviceBackendBase for HidDevice {
fn write(&self, data: &[u8]) -> HidResult<usize> {
if data.is_empty() {
Expand Down

0 comments on commit 28b93f7

Please sign in to comment.