libnfc

package
v2.7.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: GPL-3.0 Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 NewLegacyI2CReader added in v2.7.0

func NewLegacyI2CReader(cfg *config.Instance) *Reader

NewLegacyI2CReader creates a reader for legacy PN532 I2C devices. This provides a fallback option for users experiencing issues with the new go-pn532 driver. Auto-detect is disabled by default.

func NewLegacyUARTReader added in v2.7.0

func NewLegacyUARTReader(cfg *config.Instance) *Reader

NewLegacyUARTReader creates a reader for legacy PN532 UART devices. This provides a fallback option for users experiencing issues with the new go-pn532 driver. Auto-detect is disabled by default.

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