ax25

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 14 Imported by: 4

Documentation

Overview

Package ax25 provides a net.Conn and net.Listener interfaces for AX.25.

Supported TNCs

This package currently implements interfaces for Linux' AX.25 stack and Tasco-like TNCs (Kenwood transceivers).

Build tags

The Linux AX.25 stack bindings are guarded by some custom build tags:

libax25 // Include support for Linux' AX.25 stack by linking against libax25.
static  // Link against static libraries only.

Index

Constants

This section is empty.

Variables

View Source
var DefaultDialer = &Dialer{Timeout: 45 * time.Second}
View Source
var ErrNoLibax25 = errors.New("AX.25 support not included in this build")

Functions

func Heard

func Heard(axPort string) (map[string]time.Time, error)

func ListenAX25

func ListenAX25(axPort, mycall string) (net.Listener, error)

Types

type AX25Addr

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

func (AX25Addr) Network

func (a AX25Addr) Network() string

func (AX25Addr) String

func (a AX25Addr) String() string

type Address

type Address struct {
	Call string
	SSID uint8
}

func AddressFromString

func AddressFromString(str string) Address

func (Address) String

func (a Address) String() string

type Baudrate

type Baudrate int
const (
	B9600 Baudrate = 9600
	B1200          = 1200
)

type Beacon

type Beacon interface {
	Now() error
	Every(d time.Duration) error

	LocalAddr() net.Addr
	RemoteAddr() net.Addr

	Message() string
}

func NewAX25Beacon

func NewAX25Beacon(axPort, mycall, dest, message string) (Beacon, error)

type Config

type Config struct {
	HBaud        Baudrate      // Baudrate for packet channel [1200/9600].
	TXDelay      time.Duration // Time delay between PTT ON and start of transmission [(0 - 120) * 10ms].
	PacketLength uint8         // Maximum length of the data portion of a packet [0 - 255 bytes].
	Persist      uint8         // Parameter to calculate probability for the PERSIST/SLOTTIME method [0-255].
	SlotTime     time.Duration // Period of random number generation intervals for the PERSIST/SLOTTIME method [0-255 * 10ms].
	MaxFrame     uint8         // Maximum number of packets to be transmitted at one time.
	FRACK        time.Duration // Interval from one transmission until retry of transmission [0-250 * 1s].
	ResponseTime time.Duration // ACK-packet transmission delay [0-255 * 100ms].
}

func NewConfig

func NewConfig(baud Baudrate) Config

type Conn

type Conn struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

func DialAX25

func DialAX25(axPort, mycall, targetcall string) (*Conn, error)

func DialAX25Timeout

func DialAX25Timeout(axPort, mycall, targetcall string, timeout time.Duration) (*Conn, error)

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

type Dialer added in v0.7.0

type Dialer struct {
	Timeout time.Duration
}

func (Dialer) DialURL added in v0.7.0

func (d Dialer) DialURL(url *transport.URL) (net.Conn, error)

type KenwoodConn

type KenwoodConn struct{ Conn }

KenwoodConn implements net.Conn using a Kenwood (or similar) TNC in connected transparent mode.

Tested with Kenwood TH-D72 and TM-D710 in "packet-mode".

TODO: github.com/term/goserial does not support setting the line flow control. Thus, KenwoodConn is not suitable for sending messages > the TNC's internal buffer size.

We should probably be using software flow control (XFLOW), as hardware flow is not supported by many USB->RS232 adapters including the adapter build into TH-D72 (at least, not using the current linux kernel module.

func DialKenwood

func DialKenwood(dev, mycall, targetcall string, config Config, logger *log.Logger) (*KenwoodConn, error)

Dial a packet node using a Kenwood (or similar) radio over serial

func (*KenwoodConn) Close

func (c *KenwoodConn) Close() error

Jump to

Keyboard shortcuts

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