libnfc

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWriteCancelled = errors.New("write operation was cancelled")

Functions

func GetSerialBlockListCount

func GetSerialBlockListCount() int

func IsRetryableError

func IsRetryableError(err error) bool

Types

type DataCorruptedError

type DataCorruptedError struct {
	Err    error
	Device string
}

func (*DataCorruptedError) Error

func (e *DataCorruptedError) Error() string

func (*DataCorruptedError) IsRetryable

func (*DataCorruptedError) IsRetryable() bool

func (*DataCorruptedError) Unwrap

func (e *DataCorruptedError) Unwrap() error

type Reader

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

func NewACR122Reader

func NewACR122Reader(cfg *config.Instance) *Reader

NewACR122Reader creates a reader that only works with ACR122 USB devices and ignores PN532 UART/I2C devices. This is useful when a separate PN532 library handles UART/I2C devices and we want to prevent conflicts.

func NewReader

func NewReader(cfg *config.Instance) *Reader

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

func (*Reader) Device

func (r *Reader) Device() string

func (*Reader) IDs

func (r *Reader) IDs() []string

func (*Reader) Info

func (r *Reader) Info() string

func (*Reader) Metadata

func (r *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) error

func (*Reader) Write

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

func (*Reader) WriteWithContext

func (r *Reader) WriteWithContext(ctx context.Context, text string) (*tokens.Token, error)

type TagNotFoundError

type TagNotFoundError struct {
	Err    error
	Device string
}

func (*TagNotFoundError) Error

func (e *TagNotFoundError) Error() string

func (*TagNotFoundError) IsRetryable

func (*TagNotFoundError) IsRetryable() bool

func (*TagNotFoundError) Unwrap

func (e *TagNotFoundError) Unwrap() error

type TransportTimeoutError

type TransportTimeoutError struct {
	Err    error
	Device string
}

func (*TransportTimeoutError) Error

func (e *TransportTimeoutError) Error() string

func (*TransportTimeoutError) IsRetryable

func (*TransportTimeoutError) IsRetryable() bool

func (*TransportTimeoutError) Unwrap

func (e *TransportTimeoutError) Unwrap() error

type WriteRequest

type WriteRequest struct {
	Ctx    context.Context
	Result chan WriteRequestResult
	Cancel chan bool
	Text   string
}

type WriteRequestResult

type WriteRequestResult struct {
	Token     *tokens.Token
	Err       error
	Cancelled bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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