acr1555ble

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CtlCodePcToRdrEscape uint16 = 3500
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACR1555BLE

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

func New

func New(ctx context.Context, adapter *bluetooth.Adapter, address bluetooth.Address) (_ *ACR1555BLE, err error)

func (*ACR1555BLE) Close

func (b *ACR1555BLE) Close() (err error)

func (*ACR1555BLE) Connect

func (b *ACR1555BLE) Connect(ctx context.Context, protocol Protocol) (_ *Card, err error)

func (*ACR1555BLE) Escape

func (b *ACR1555BLE) Escape(ctx context.Context, sam bool, data []byte) (_ []byte, err error)

func (*ACR1555BLE) GetSlotStatus

func (b *ACR1555BLE) GetSlotStatus(ctx context.Context, sam bool) (_ SlotStatus, err error)

func (*ACR1555BLE) ICCPowerOff

func (b *ACR1555BLE) ICCPowerOff(ctx context.Context, sam bool) (_ SlotStatus, err error)

ICCPowerOff powers off the card and returns the updated slot status

func (*ACR1555BLE) ICCPowerOn

func (b *ACR1555BLE) ICCPowerOn(ctx context.Context, sam bool, powerSelect PowerSelect) (_ []byte, err error)

ICCPowerOn powers on the card and returns the ATR

func (*ACR1555BLE) SetParameters

func (b *ACR1555BLE) SetParameters(ctx context.Context, sam bool, isT1 bool, fiDi, tccks, guardTime, waiting, clockStop, ifsc byte) (err error)

func (*ACR1555BLE) XfrBlock

func (b *ACR1555BLE) XfrBlock(ctx context.Context, sam bool, bwi byte, data []byte) (_ []byte, err error)

type Card

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

func (*Card) ATR

func (c *Card) ATR() ([]byte, error)

func (*Card) Close

func (c *Card) Close() (err error)

func (*Card) Control

func (c *Card) Control(ctx context.Context, code uint16, data []byte) (_ []byte, err error)

func (*Card) DeviceName

func (c *Card) DeviceName() string

func (*Card) Exchange

func (c *Card) Exchange(ctx context.Context, capdu []byte) (_ []byte, err error)

func (*Card) Reconnect

func (c *Card) Reconnect(ctx context.Context) (err error)

type ClockStatus

type ClockStatus byte
const (
	ClockStatusRunning ClockStatus = iota
	ClockStatusStoppedL
	ClockStatusStoppedH
	ClockStatusStoppedUnknown
)

func (ClockStatus) String

func (i ClockStatus) String() string

type ErrorCode

type ErrorCode byte
const (
	ErrorCodeChecksum          ErrorCode = 0x01
	ErrorCodeTimeout           ErrorCode = 0x02
	ErrorCodeCommand           ErrorCode = 0x03
	ErrorCodeUnauthorized      ErrorCode = 0x04
	ErrorCodeUndefined         ErrorCode = 0x05
	ErrorCodeReceiveData       ErrorCode = 0x06
	ErrorCodeReceiveDataLength ErrorCode = 0x07
)

func (ErrorCode) Error

func (e ErrorCode) Error() string

func (ErrorCode) String

func (i ErrorCode) String() string

type ICCStatus

type ICCStatus byte
const (
	ICCStatusRunning ICCStatus = iota
	ICCStatusInactive
	ICCStatusAbsent
)

func (ICCStatus) String

func (i ICCStatus) String() string

type PowerSelect

type PowerSelect byte
const (
	PowerSelectAutomatic PowerSelect = iota
	PowerSelect5v
	PowerSelect3v
)

func (PowerSelect) String

func (i PowerSelect) String() string

type Protocol

type Protocol int
const (
	ProtocolT0 Protocol = iota
	ProtocolT1
	ProtocolPICC
)

type SlotError

type SlotError byte
const (
	SlotErrorCommandAborted        SlotError = 0xFF
	SlotErrorTimeout               SlotError = 0xFE
	SlotErrorParity                SlotError = 0xFD
	SlotErrorOverrun               SlotError = 0xFC
	SlotErrorHardware              SlotError = 0xFB
	SlotErrorBadATRTS              SlotError = 0xF8
	SlotErrorBadATRTCK             SlotError = 0xF7
	SlotErrorProtocolNotSupported  SlotError = 0xF6
	SlotErrorClassNotSupported     SlotError = 0xF5
	SlotErrorProcedureByteConflict SlotError = 0xF4
	SlotErrorDeactivatedProtocol   SlotError = 0xF3
	SlotErrorBusyWithAutoSequence  SlotError = 0xF2
	SlotErrorSlotBusy              SlotError = 0xE0
	SlotErrorInvalidNAD            SlotError = 0x10
	SlotErrorInvalidIFSC           SlotError = 0x0F
	SlotErrorInvalidClockStop      SlotError = 0x0E
	SlotErrorInvalidWI             SlotError = 0x0D
	SlotErrorInvalidGuardTime      SlotError = 0x0C
	SlotErrorInvalidTCCKTS         SlotError = 0x0B
	SlotErrorInvalidFIDI           SlotError = 0x0A
	SlotErrorInvalidLevelParameter SlotError = 0x08
	SlotErrorInvalidPowerSelect    SlotError = 0x07
	SlotErrorInvalidSlot           SlotError = 0x05
	SlotErrorInvalidLength         SlotError = 0x01
	SlotErrorCommandNotSupported   SlotError = 0x00
)

func (SlotError) Error

func (e SlotError) Error() string

func (SlotError) String

func (i SlotError) String() string

type SlotStatus

type SlotStatus struct {
	ICCStatus   ICCStatus
	ClockStatus ClockStatus
}

Jump to

Keyboard shortcuts

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