Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sstallion/go-hid
An idiomatic Go interface to HIDAPI, a simple library for communicating with USB and Bluetooth HID devices
https://github.com/sstallion/go-hid
bluetooth golang hid hidapi usb
Last synced: 3 months ago
JSON representation
An idiomatic Go interface to HIDAPI, a simple library for communicating with USB and Bluetooth HID devices
- Host: GitHub
- URL: https://github.com/sstallion/go-hid
- Owner: sstallion
- License: bsd-2-clause
- Created: 2019-06-05T05:34:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T19:49:51.000Z (over 1 year ago)
- Last Synced: 2024-06-18T21:32:28.913Z (7 months ago)
- Topics: bluetooth, golang, hid, hidapi, usb
- Language: C
- Homepage:
- Size: 282 KB
- Stars: 50
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# HIDAPI Bindings for Go
![](.github/images/gopher.png)
[![](https://github.com/sstallion/go-hid/actions/workflows/ci.yml/badge.svg?branch=master)][1]
[![](https://pkg.go.dev/badge/github.com/sstallion/go-hid)][2]
[![](https://goreportcard.com/badge/github.com/sstallion/go-hid)][3]
[![](https://img.shields.io/github/v/release/sstallion/go-hid)][4]
[![](https://img.shields.io/github/license/sstallion/go-hid.svg)][5]Package `hid` provides an idiomatic interface to HIDAPI, a simple library for
communicating with USB and Bluetooth HID devices on FreeBSD, Linux, macOS, and
Windows.See https://github.com/libusb/hidapi for details.
## Installation
To add package `hid` as a dependency or upgrade to its latest version, issue:
$ go get github.com/sstallion/go-hid@latest
>**Note**: Prerequisites for building HIDAPI from source must be installed prior
> to issuing `go get`. See [Prerequisites][6] for details.### libusb Backend Support
On Linux, the hidraw backend is enabled by default. If the libusb backend is
desired, the `libusb` build constraint must be specified:$ go build -tags libusb ./...
### lshid
A command named `lshid` is provided, which lists HID devices attached to the
system. `lshid` may be installed by issuing:$ go install github.com/sstallion/go-hid/cmd/lshid@latest
Once installed, issue `lshid -h` to show usage.
## Documentation
Up-to-date documentation can be found on [pkg.go.dev][2] or by issuing the `go
doc` command after installation:$ go doc -all github.com/sstallion/go-hid
## Contributing
Pull requests are welcome! See [CONTRIBUTING.md][7] for details.
## License
Source code in this repository is licensed under a Simplified BSD License. See
[LICENSE][5] for details.[1]: https://github.com/sstallion/go-hid/actions/workflows/ci.yml
[2]: https://pkg.go.dev/github.com/sstallion/go-hid
[3]: https://goreportcard.com/report/github.com/sstallion/go-hid
[4]: https://github.com/sstallion/go-hid/releases/latest
[5]: https://github.com/sstallion/go-hid/blob/master/LICENSE
[6]: https://github.com/libusb/hidapi/blob/master/BUILD.md#prerequisites
[7]: https://github.com/sstallion/go-hid/blob/master/CONTRIBUTING.md