uart

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: LGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrameValidationResult

type FrameValidationResult struct {
	Err      error // 8 bytes (interface)
	NewOff   int   // 8 bytes (on 64-bit)
	FrameLen int   // 8 bytes (on 64-bit)
	Retry    bool  // 1 byte
}

FrameValidationResult represents the result of frame length validation

type Transport

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

Transport implements the pn532.Transport interface for UART communication.

func New

func New(portName string) (*Transport, error)

New creates a new UART transport.

func (*Transport) Close

func (t *Transport) Close() error

Close closes the transport connection

func (*Transport) HasCapability

func (*Transport) HasCapability(capability pn532.TransportCapability) bool

HasCapability implements the TransportCapabilityChecker interface UART transport supports native InAutoPoll for reduced CPU usage

func (*Transport) IsConnected

func (t *Transport) IsConnected() bool

IsConnected returns true if the transport is connected

func (*Transport) SendCommand

func (t *Transport) SendCommand(cmd byte, args []byte) ([]byte, error)

SendCommand sends a command to the PN532 and waits for response.

func (*Transport) SendCommandWithContext added in v0.5.0

func (t *Transport) SendCommandWithContext(ctx context.Context, cmd byte, args []byte) ([]byte, error)

SendCommandWithContext sends a command to the PN532 with context support

func (*Transport) SetTimeout

func (t *Transport) SetTimeout(timeout time.Duration) error

SetTimeout sets the read timeout for the transport

func (*Transport) Type

func (*Transport) Type() pn532.TransportType

Type returns the transport type

Jump to

Keyboard shortcuts

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