clrc633

package
v0.0.0-...-89eb2bc Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HIALERTIRQ = 0x40
	LOALERTIRQ = 0x20
	IDLEIRQ    = 0x01
	TXIRQ      = 0x08
	RXIRQ      = 0x04
	ERRIRQ     = 0x02
	RXSOFIRQ   = 0x01
	GLOBALIRQ  = 0x40
	LPCD_IRQ   = 0x20
	TIME4IRQ   = 0x10
	TIME3IRQ   = 0x08
	TIME2IRQ   = 0x04
	TIME1IRQ   = 0x02
	TIME0IRQ   = 0x01
)

Variables

View Source
var ErrorAuth = errors.New("auth failed")
View Source
var ErrorCollDet = errors.New("a collision has occurred. The position of the first collision is shown in the register RxColl")
View Source
var ErrorEEPROM = errors.New("error appeared during the last EEPROM command")
View Source
var ErrorFIFOOvl = errors.New("data is written into the FIFO when it is already full")
View Source
var ErrorFIFOWr = errors.New(`data was written into the FIFO, during a transmission of a possible CRC, during "RxWait", "Wait for data" or "Receiving" state, or during an authentication command`)
View Source
var ErrorIRQ = errors.New("the one of the following errors is set: FifoWrErr, FiFoOvl, ProtErr, NoDataErr, IntegErr")
View Source
var ErrorInteg = errors.New("a data integrity error has been detected. Possible cause can be a wrong parity or a wrong CRC")
View Source
var ErrorMinFrame = errors.New("a valid SOF was received, but afterwards less than 4 bits of data were received")
View Source
var ErrorNoData = errors.New("data should be sent, but no data is in FIFO")
View Source
var ErrorProt = errors.New("a protocol error has occurred")
View Source
var ErrorReadTimeout = errors.New("timeout reading")
View Source
var ErrorUnsupported = errors.New("unsupport")

Functions

func ReadFifo

func ReadFifo(c spi.Conn, data []byte) error

Types

type Card

type Card struct {
	smartcard.ICard
	// contains filtered or unexported fields
}

func (*Card) ATR

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

func (*Card) ATS

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

func (*Card) Apdu

func (c *Card) Apdu(apdu []byte) ([]byte, error)

func (*Card) ApduWithoutResponse

func (c *Card) ApduWithoutResponse(apdu []byte) ([]byte, error)

func (*Card) DisconnectCard

func (c *Card) DisconnectCard() error

func (*Card) DisconnectResetCard

func (c *Card) DisconnectResetCard() error

func (*Card) EndTransactionResetCard

func (c *Card) EndTransactionResetCard() error

func (*Card) GetData

func (c *Card) GetData(data byte) ([]byte, error)

Get Data 0x00

func (*Card) MFAuthent

func (c *Card) MFAuthent(keyType, block int) error

func (*Card) MFLoadKey

func (c *Card) MFLoadKey(key []byte) error

func (*Card) SAK

func (c *Card) SAK() byte

func (*Card) UID

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

type Device

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

func NewDevice

func NewDevice(path string) (*Device, error)

func (*Device) Anticoll

func (d *Device) Anticoll(timeout time.Duration) ([]byte, error)

func (*Device) Anticoll2

func (d *Device) Anticoll2(timeout time.Duration) ([]byte, error)

func (*Device) Auth

func (d *Device) Auth(keyType int, block int, uid []byte, timeout time.Duration) error

func (*Device) Close

func (d *Device) Close() error

func (*Device) LoadKey

func (d *Device) LoadKey(key []byte, timeout time.Duration) error

func (*Device) Request

func (d *Device) Request(tagType byte, timeout time.Duration) (byte, error)

func (*Device) Select

func (d *Device) Select(data []byte, timeout time.Duration) (byte, error)

func (*Device) Select2

func (d *Device) Select2(data []byte, timeout time.Duration) (byte, error)

func (*Device) Transceive

func (d *Device) Transceive(data []byte, timeout time.Duration) ([]byte, error)

type Reader

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

func NewReader

func NewReader(dev *Device, readerName string) *Reader

NewReader Create New Reader interface

func (*Reader) Anticoll

func (r *Reader) Anticoll() ([]byte, error)

func (*Reader) Anticoll2

func (r *Reader) Anticoll2() ([]byte, error)

func (*Reader) Auth

func (r *Reader) Auth(keyType, block int, uid []byte) error

func (*Reader) ConnectCard

func (r *Reader) ConnectCard() (smartcard.ICard, error)

ConnectCard ConnectCard connect card with protocol T=1.

func (*Reader) ConnectCardB

func (r *Reader) ConnectCardB() (smartcard.ICard, error)

Create New Card typeB interface

func (*Reader) ConnectLegacyCard

func (r *Reader) ConnectLegacyCard() (*Card, error)

Create New Card typeA interface

func (*Reader) ConnectMifareClassic

func (r *Reader) ConnectMifareClassic() (mifare.Classic, error)

func (*Reader) ConnectSamCard

func (r *Reader) ConnectSamCard() (smartcard.ICard, error)

ConnectSamCard ConnectSamCard connect card with protocol T=1.

func (*Reader) ConnectSamCard_T0

func (r *Reader) ConnectSamCard_T0() (smartcard.ICard, error)

ConnectSamCard_T0 ConnectCard connect card with protocol T=1.

func (*Reader) ConnectSamCard_Tany

func (r *Reader) ConnectSamCard_Tany() (smartcard.ICard, error)

ConnectSamCard_Tany ConnectCard connect card with protocol T=any.

func (*Reader) LoadKey

func (r *Reader) LoadKey(key []byte) error

func (*Reader) RATS

func (r *Reader) RATS() ([]byte, error)

func (*Reader) Request

func (r *Reader) Request() (byte, error)

func (*Reader) Select

func (r *Reader) Select(data []byte) (byte, error)

func (*Reader) Select2

func (r *Reader) Select2(data []byte) (byte, error)

func (*Reader) Transceive

func (r *Reader) Transceive(apdu []byte) ([]byte, error)

func (*Reader) Transmit

func (r *Reader) Transmit(apdu []byte) ([]byte, error)

type StatusIRQ

type StatusIRQ struct {
	HiAlertIRQ bool
	LoAlertIRQ bool
	IdleIRQ    bool
	TxIRQ      bool
	RxIRQ      bool
	ErrIRQ     bool
	RxSOFIrq   bool
	GlobalIRQ  bool
	LPCD_IRQ   bool
	Time4IRQ   bool
	Time3IRQ   bool
	Time2IRQ   bool
	Time1IRQ   bool
	Time0IRQ   bool
}

type TagType

type TagType int
const (
	TAG_TYPEA TagType = iota
	TAG_TYPEB
	SAM_T1
	TAG_TCL
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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