hid

package
v0.0.0-...-159bc53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CMD_APDU uint8 = 0x03
View Source
const CMD_INIT uint8 = 0x06
View Source
const CMD_WINK uint8 = 0x08
View Source
const HID_RPT_SIZE uint16 = 64
View Source
const STAT_ERR uint8 = 0xbf
View Source
const TYPE_INIT uint8 = 0x80

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device interface {
	Open() error
	Close()
	SendAPDU(instruction, p1, p2 uint8, data []byte) (uint16, []byte, error)
}

* Interfaces *

type HidDevice

type HidDevice struct {
	// contains filtered or unexported fields
}

func Devices

func Devices() []*HidDevice

Returns an array of available HID devices.

func (*HidDevice) Close

func (dev *HidDevice) Close()

func (*HidDevice) Open

func (dev *HidDevice) Open() error

func (*HidDevice) SendAPDU

func (dev *HidDevice) SendAPDU(instruction, p1, p2 uint8, data []byte) (uint16, []byte, error)

type RawHidDevice

type RawHidDevice struct {
	Device *hid.DeviceInfo
	Handle *hid.Device
}

func (*RawHidDevice) Close

func (dev *RawHidDevice) Close()

func (*RawHidDevice) Open

func (dev *RawHidDevice) Open() error

func (*RawHidDevice) Read

func (dev *RawHidDevice) Read(response []byte) (int, error)

func (*RawHidDevice) Write

func (dev *RawHidDevice) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL