forked from trezor/trezord-go
/
hidapi_shim.go
50 lines (36 loc) · 1.01 KB
/
hidapi_shim.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// +build linux freebsd openbsd
// shim for linux and freebsd so that trezord.go builds
package usb
import (
"github.com/trezor/trezord-go/core"
"github.com/trezor/trezord-go/memorywriter"
)
const HIDUse = false
type HIDAPI struct {
}
func InitHIDAPI(mw *memorywriter.MemoryWriter) (*HIDAPI, error) {
return &HIDAPI{}, nil
}
func (b *HIDAPI) Enumerate() ([]core.USBInfo, error) {
panic("not implemented for linux and freebsd")
}
func (b *HIDAPI) Has(path string) bool {
panic("not implemented for linux and freebsd")
}
func (b *HIDAPI) Connect(path string, debug bool, reset bool) (core.USBDevice, error) {
return &HID{}, nil
}
type HID struct {
}
func (d *HID) Close(disconnected bool) error {
panic("not implemented for linux and freebsd")
}
func (d *HID) Write(buf []byte) (int, error) {
panic("not implemented for linux and freebsd")
}
func (d *HID) Read(buf []byte) (int, error) {
panic("not implemented for linux and freebsd")
}
func (b *HIDAPI) Close() {
panic("not implemented for linux and freebsd")
}