diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-16 21:36:44 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-17 18:04:21 +0800 |
commit | 6ec81352560e3e4268855115eda9d78f6e27875f (patch) | |
tree | c8723bdcdd08608e7cfcbed04f74fdac7de7ffe3 /vendor/github.com/karalabe/hid/hid_disabled.go | |
parent | bdef758d5c6d397584d0c35e53d6f6c318e61351 (diff) | |
download | dexon-6ec81352560e3e4268855115eda9d78f6e27875f.tar.gz dexon-6ec81352560e3e4268855115eda9d78f6e27875f.tar.zst dexon-6ec81352560e3e4268855115eda9d78f6e27875f.zip |
accounts/usbwallet, vendor: use hidapi instead of libusb directly
Diffstat (limited to 'vendor/github.com/karalabe/hid/hid_disabled.go')
-rw-r--r-- | vendor/github.com/karalabe/hid/hid_disabled.go | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/vendor/github.com/karalabe/hid/hid_disabled.go b/vendor/github.com/karalabe/hid/hid_disabled.go new file mode 100644 index 000000000..0798bad1b --- /dev/null +++ b/vendor/github.com/karalabe/hid/hid_disabled.go @@ -0,0 +1,53 @@ +// hid - Gopher Interface Devices (USB HID) +// Copyright (c) 2017 Péter Szilágyi. All rights reserved. +// +// This file is released under the 3-clause BSD license. Note however that Linux +// support depends on libusb, released under GNU GPL 2.1 or later. + +// +build !linux +// +build !darwin ios +// +build !windows + +package hid + +// Supported returns whether this platform is supported by the HID library or not. +// The goal of this method is to allow programatically handling platforms that do +// not support USB HID and not having to fall back to build constraints. +func Supported() bool { + return false +} + +// Enumerate returns a list of all the HID devices attached to the system which +// match the vendor and product id. On platforms that this file implements the +// function is a noop and returns an empty list always. +func Enumerate(vendorID uint16, productID uint16) []DeviceInfo { + return nil +} + +// Device is a live HID USB connected device handle. On platforms that this file +// implements the type lacks the actual HID device and all methods are noop. +type Device struct { + DeviceInfo // Embed the infos for easier access +} + +// Open connects to an HID device by its path name. On platforms that this file +// implements the method just returns an error. +func (info DeviceInfo) Open() (*Device, error) { + return nil, ErrUnsupportedPlatform +} + +// Close releases the HID USB device handle. On platforms that this file implements +// the method is just a noop. +func (dev *Device) Close() {} + +// Write sends an output report to a HID device. On platforms that this file +// implements the method just returns an error. +func (dev *Device) Write(b []byte) (int, error) { + return 0, ErrUnsupportedPlatform +} + +// Read retrieves an input report from a HID device. On platforms that this file +// implements the method just returns an error. +func (dev *Device) Read(b []byte) (int, error) { + return 0, ErrUnsupportedPlatform +} |