uart

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package uart provides UART transport implementation for PN532 communication

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) 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