async-hid
A Rust library for asynchronously interacting with HID devices.
This crate aims to be a replacement for hidapi-rs without the baggage that comes from being a wrapper around a C library.
This crate generally offers a simpler and more streamlined api while also supporting async as best as possible.
Example
use ;
use SimpleLogger;
use StreamExt;
async
Platform Support
Operating System | Underlying API |
---|---|
Windows | Win32 (Windows.Win32.Devices ) |
Windows | WinRT (Windows.Devices.HumanInterfaceDevice ) |
Linux | hidraw |
MacOs | IOHIDManager |
Under Windows this crate uses either win32
(default) or winrt
feature for backend.
Async
The amount of asynchronicity that each OS provides varies. The following table gives a rough overview which calls utilize async under the hood.
enumerate |
open |
read_input_report |
write_output_report |
|
---|---|---|---|---|
Windows (Win32) | ❌️ | ️️ ❌️ | ✔️ | ✔️ |
Windows (WinRT) | ✔️ | ✔️ | ✔️ | ✔️ |
Linux | ❌ | ❌ | ✔️ | ✔️ |
MacOS | ❌ | ✔️ | ✔️ | ❌ |
Under Linux this crate uses either async-io
(default) or tokio
feature for the async functionality.
Planned Features
- Reading / Writing feature reports
License
MIT License