Documentation ¶
Index ¶
- Constants
- Variables
- func ReadFifo(c spi.Conn, data []byte) error
- type Card
- func (c *Card) ATR() ([]byte, error)
- func (c *Card) ATS() ([]byte, error)
- func (c *Card) Apdu(apdu []byte) ([]byte, error)
- func (c *Card) ApduWithoutResponse(apdu []byte) ([]byte, error)
- func (c *Card) DisconnectCard() error
- func (c *Card) DisconnectResetCard() error
- func (c *Card) EndTransactionResetCard() error
- func (c *Card) GetData(data byte) ([]byte, error)
- func (c *Card) MFAuthent(keyType, block int) error
- func (c *Card) MFLoadKey(key []byte) error
- func (c *Card) SAK() byte
- func (c *Card) UID() ([]byte, error)
- type Device
- func (d *Device) Anticoll(timeout time.Duration) ([]byte, error)
- func (d *Device) Anticoll2(timeout time.Duration) ([]byte, error)
- func (d *Device) Auth(keyType int, block int, uid []byte, timeout time.Duration) error
- func (d *Device) Close() error
- func (d *Device) LoadKey(key []byte, timeout time.Duration) error
- func (d *Device) Request(tagType byte, timeout time.Duration) (byte, error)
- func (d *Device) Select(data []byte, timeout time.Duration) (byte, error)
- func (d *Device) Select2(data []byte, timeout time.Duration) (byte, error)
- func (d *Device) Transceive(data []byte, timeout time.Duration) ([]byte, error)
- type Reader
- func (r *Reader) Anticoll() ([]byte, error)
- func (r *Reader) Anticoll2() ([]byte, error)
- func (r *Reader) Auth(keyType, block int, uid []byte) error
- func (r *Reader) ConnectCard() (smartcard.ICard, error)
- func (r *Reader) ConnectCardB() (smartcard.ICard, error)
- func (r *Reader) ConnectLegacyCard() (*Card, error)
- func (r *Reader) ConnectMifareClassic() (mifare.Classic, error)
- func (r *Reader) ConnectSamCard() (smartcard.ICard, error)
- func (r *Reader) ConnectSamCard_T0() (smartcard.ICard, error)
- func (r *Reader) ConnectSamCard_Tany() (smartcard.ICard, error)
- func (r *Reader) LoadKey(key []byte) error
- func (r *Reader) RATS() ([]byte, error)
- func (r *Reader) Request() (byte, error)
- func (r *Reader) Select(data []byte) (byte, error)
- func (r *Reader) Select2(data []byte) (byte, error)
- func (r *Reader) Transceive(apdu []byte) ([]byte, error)
- func (r *Reader) Transmit(apdu []byte) ([]byte, error)
- type StatusIRQ
- type TagType
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 ¶
Types ¶
type Card ¶
func (*Card) DisconnectCard ¶
func (*Card) DisconnectResetCard ¶
func (*Card) EndTransactionResetCard ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) ConnectCard ¶
ConnectCard ConnectCard connect card with protocol T=1.
func (*Reader) ConnectCardB ¶
Create New Card typeB interface
func (*Reader) ConnectLegacyCard ¶
Create New Card typeA interface
func (*Reader) ConnectMifareClassic ¶
func (*Reader) ConnectSamCard ¶
ConnectSamCard ConnectSamCard connect card with protocol T=1.
func (*Reader) ConnectSamCard_T0 ¶
ConnectSamCard_T0 ConnectCard connect card with protocol T=1.
func (*Reader) ConnectSamCard_Tany ¶
ConnectSamCard_Tany ConnectCard connect card with protocol T=any.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.