karalabe / hid

Gopher Interface Devices (USB HID)
Other
263 stars 131 forks source link

use libusb 1.0.27 as backend on linux #50

Closed holiman closed 7 months ago

holiman commented 7 months ago

This PR adds back libusb (version 1.0.27 at commit https://github.com/libusb/libusb/commit/d52e355daa09f17ce64819122cb067b8a2ee0d4b) for linux, to avoid the requirement of libudev being present on the target.

Todo:

Geth with this PR:

INFO [02-09|11:03:13.477] New wallet appeared                      url=ledger://1-1:1.0 status="Ethereum app v1.9.19 online"
holiman commented 7 months ago

With this PR:

[user@work hid]$ go run ./demo.go 
hid.Supported() true
--------------------------------------------------------------------------------------------------------------------------------
HID #0
  OS Path:      1-1:1.0
  Vendor ID:    0x2c97
  Product ID:   0x5015
  Release:      513
  Serial:       
  Manufacturer: 
  Product:      
  Usage Page:   0x0000
  Usage:        0
  Interface:    0
--------------------------------------------------------------------------------------------------------------------------------
HID #1
  OS Path:      1-1:1.1
  Vendor ID:    0x2c97
  Product ID:   0x5015
  Release:      513
  Serial:       
  Manufacturer: 
  Product:      
  Usage Page:   0x0000
  Usage:        0
  Interface:    1
================================================================================================================================

With master

[user@work hid]$ go run ./demo.go 
hid.Supported() true
--------------------------------------------------------------------------------------------------------------------------------
HID #0
  OS Path:      /dev/hidraw0
  Vendor ID:    0x2c97
  Product ID:   0x5015
  Release:      513
  Serial:       0001
  Manufacturer: Ledger
  Product:      Nano S Plus
  Usage Page:   0xffa0
  Usage:        1
  Interface:    0
--------------------------------------------------------------------------------------------------------------------------------
HID #1
  OS Path:      /dev/hidraw1
  Vendor ID:    0x2c97
  Product ID:   0x5015
  Release:      513
  Serial:       0001
  Manufacturer: Ledger
  Product:      Nano S Plus
  Usage Page:   0xf1d0
  Usage:        1
  Interface:    1
================================================================================================================================