Skip to content

Commit

Permalink
hiddevice: add AsFd 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 f94bb40
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 AsFd for HidDevice {
fn as_fd(&self) -> BorrowedFd {
self.fd.as_fd()
}
}

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

0 comments on commit f94bb40

Please sign in to comment.