mirror of
https://github.com/luxfi/hid.git
synced 2026-07-26 23:57:43 +00:00
chore: sync dependencies and format code
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
// This file is released under the 3-clause BSD license. Note however that Linux
|
||||
// support depends on libusb, released under GNU LGPL 2.1 or later.
|
||||
|
||||
//go:build (!linux && !darwin && !windows) || ios || !cgo
|
||||
// +build !linux,!darwin,!windows ios !cgo
|
||||
|
||||
package hid
|
||||
|
||||
+7
-5
@@ -4,6 +4,7 @@
|
||||
// This file is released under the 3-clause BSD license. Note however that Linux
|
||||
// support depends on libusb, released under LGNU GPL 2.1 or later.
|
||||
|
||||
//go:build (linux && cgo) || (darwin && !ios && cgo) || (windows && cgo)
|
||||
// +build linux,cgo darwin,!ios,cgo windows,cgo
|
||||
|
||||
package hid
|
||||
@@ -54,8 +55,9 @@ import (
|
||||
// for enumeration, causing crashes if called concurrently.
|
||||
//
|
||||
// For more details, see:
|
||||
// https://developer.apple.com/documentation/iokit/1438371-iohidmanagersetdevicematching
|
||||
// > "subsequent calls will cause the hid manager to release previously enumerated devices"
|
||||
//
|
||||
// https://developer.apple.com/documentation/iokit/1438371-iohidmanagersetdevicematching
|
||||
// > "subsequent calls will cause the hid manager to release previously enumerated devices"
|
||||
var enumerateLock sync.Mutex
|
||||
|
||||
// Supported returns whether this platform is supported by the HID library or not.
|
||||
@@ -67,9 +69,9 @@ func Supported() bool {
|
||||
|
||||
// Enumerate returns a list of all the HID devices attached to the system which
|
||||
// match the vendor and product id:
|
||||
// - If the vendor id is set to 0 then any vendor matches.
|
||||
// - If the product id is set to 0 then any product matches.
|
||||
// - If the vendor and product id are both 0, all HID devices are returned.
|
||||
// - If the vendor id is set to 0 then any vendor matches.
|
||||
// - If the product id is set to 0 then any product matches.
|
||||
// - If the vendor and product id are both 0, all HID devices are returned.
|
||||
func Enumerate(vendorID uint16, productID uint16) []DeviceInfo {
|
||||
enumerateLock.Lock()
|
||||
defer enumerateLock.Unlock()
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// The vendored file is licensed under the 3-clause BSD license, according to:
|
||||
// https://github.com/orofarne/gowchar/blob/master/LICENSE
|
||||
|
||||
//go:build !ios && (linux || darwin || windows)
|
||||
// +build !ios
|
||||
// +build linux darwin windows
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// The vendored file is licensed under the 3-clause BSD license, according to:
|
||||
// https://github.com/orofarne/gowchar/blob/master/LICENSE
|
||||
|
||||
//go:build !ios && (linux || darwin || windows)
|
||||
// +build !ios
|
||||
// +build linux darwin windows
|
||||
|
||||
|
||||
Reference in New Issue
Block a user