hidapi library

Cross-platform Dart bindings for hidapi.

Provides idiomatic Dart access to USB HID devices via the proven hidapi C library, compiled from vendored source at build time.

Classes

HidDevice
Handle to an open HID device.
HidDeviceInfo
Information about a discovered HID device.

Enums

HidBusType
Bus type for a HID device.

Functions

hidDarwinGetOpenExclusive() bool
Get the current macOS exclusive device open mode.
hidDarwinSetOpenExclusive(bool exclusive) → void
Set the macOS exclusive device open mode.
hidEnumerate({int vendorId = 0, int productId = 0}) List<HidDeviceInfo>
Enumerate connected HID devices.
hidExit() → void
Finalize the hidapi library and free static data.
hidInit() → void
Initialize the hidapi library.
hidOpen(int vendorId, int productId, {String? serialNumber}) HidDevice
Open a HID device by vendor/product ID.
hidOpenPath(String path) HidDevice
Open a HID device by its platform-specific path.
hidVersion() → ({int major, int minor, int patch})
Get the hidapi library version.
hidVersionStr() String
Get the hidapi library version as a string.

Exceptions / Errors

HidException
Exception thrown when a hidapi operation fails.