Documentation ¶
Index ¶
Constants ¶
const (
APDUStatusOk = 0x9000
)
Well known APDU status codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APDUCommand ¶
type APDUCommand struct { Cla uint8 Ins uint8 P1 uint8 P2 uint8 Data []byte Raw []byte ForceLc bool // Some applications (i.e. Tezos) might require Lc byte even if the data length is zero }
APDUCommand represents parsed APDU (doesn't fully conform to ISO7816-4)
type APDUResponse ¶
APDUResponse represents APDU response
type App ¶
type App struct {
Exchanger
}
App implements global commands available regardless of the running application
func (*App) GetAppVersion ¶
GetAppVersion returns running app version
type BluetoothSpec ¶
BluetoothSpec represents BLE services
type DeviceInfo ¶
type DeviceInfo struct { Path string DeviceInfo *LedgerDeviceInfo }
DeviceInfo contains device enumeration result
type Exchanger ¶
type Exchanger interface { Exchange(req *APDUCommand) (*APDUResponse, error) Close() error }
Exchanger is an interface implemented by an transport's abstract device
type LedgerDeviceInfo ¶
type LedgerDeviceInfo struct { ID string ProductName string ProductIDMM uint8 LegacyUSBProductID uint16 USBOnly bool MemorySize int }
LedgerDeviceInfo contains some hardcoded device information picked by the product ID https://github.com/LedgerHQ/ledgerjs/blob/master/packages/devices/src/index.js
type TCPTransport ¶
func (*TCPTransport) Enumerate ¶
func (t *TCPTransport) Enumerate() ([]*DeviceInfo, error)
type Transport ¶
type Transport interface { Enumerate() ([]*DeviceInfo, error) Open(path string) (Exchanger, error) }
Transport represents transport backend such as USB HID or BLE
type USBHIDTransport ¶
type USBHIDTransport struct{}
USBHIDTransport is a USB HID transport backend
func (*USBHIDTransport) Enumerate ¶
func (u *USBHIDTransport) Enumerate() ([]*DeviceInfo, error)
Enumerate returns a list os attached Ledger devices