Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceInfo ¶
type DeviceInfo interface { VendorID() int ProductID() int UsagePage() int Interface() int Serial() string Product() string Identifier() string Open() (io.ReadWriteCloser, error) }
DeviceInfo contains the usb descriptor info and a way to open the device for reading and writing.
func DeviceInfos ¶
func DeviceInfos() []DeviceInfo
DeviceInfos returns a slice of all recognized devices.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager listens for devices and notifies when a device has been inserted or removed.
func NewManager ¶
func NewManager( channelConfigDir string, bitbox02ConfigDir string, socksProxy socksproxy.SocksProxy, deviceInfos func() []DeviceInfo, onRegister func(device.Interface) error, onUnregister func(string), onlyOne bool, ) *Manager
NewManager creates a new Manager. onRegister is called when a device has been inserted. onUnregister is called when the device has been removed.
The channelConfigDir argument is passed to each device during initialization, before onRegister is called.
Click to show internal directories.
Click to hide internal directories.