ccid

package
v2.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Package ccid is the reader driver for USB CCID contactless readers.

It reaches a reader through the system's PC/SC service where there is one, and by talking CCID over USB itself where there is not. Either way it uses only the standard PC/SC storage card commands, which the reader's firmware carries out, so it needs no knowledge of any particular reader.

Index

Constants

View Source
const (
	// DriverID is the driver's config and API name.
	DriverID = "ccid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader is one CCID reader, or a probe for one during auto-detect.

func NewReader

func NewReader(_ *config.Instance) *Reader

NewReader returns the driver for the current platform.

func (*Reader) CancelWrite

func (r *Reader) CancelWrite()

func (*Reader) Capabilities

func (*Reader) Capabilities() []readers.Capability

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Connected

func (r *Reader) Connected() bool

func (*Reader) Detect

func (r *Reader) Detect(connected []string) string

Detect returns a reader to attach, or an empty string.

A known contactless reader is returned as soon as it is plugged in. Any other smart card reader is returned only while it holds a card, and Open then decides from the card whether it is an NFC reader at all. A laptop's card slot or a security key is never attached.

func (*Reader) IDs

func (*Reader) IDs() []string

IDs includes the names of the PC/SC ACR122 driver this one replaced, so connection entries written for it keep working.

func (*Reader) Info

func (r *Reader) Info() string

func (*Reader) Metadata

func (*Reader) Metadata() readers.DriverMetadata

func (*Reader) OnMediaChange

func (*Reader) OnMediaChange(*models.ActiveMedia) error

func (*Reader) Open

func (r *Reader) Open(device config.ReadersConnect, iq chan<- readers.Scan, opts readers.OpenOpts) error

func (*Reader) Path

func (r *Reader) Path() string

func (*Reader) ReaderID

func (r *Reader) ReaderID() string

func (*Reader) Write

func (r *Reader) Write(text string) (*tokens.Token, error)

func (*Reader) WriteTarget

func (r *Reader) WriteTarget(ctx context.Context, text string, opts readers.WriteOptions) (*tokens.Token, error)

WriteTarget waits for a tag and writes text to it.

Directories

Path Synopsis
Package proto speaks the USB CCID message protocol to one card slot.
Package proto speaks the USB CCID message protocol to one card slot.

Jump to

Keyboard shortcuts

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