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 ¶
const (
// DefaultSerialBaud is the default serial_baud value of the serial-tnc scheme.
DefaultSerialBaud = 9600
)
Variables ¶
var DefaultDialer = &Dialer{Timeout: 45 * time.Second}
var ErrNoLibax25 = errors.New("AX.25 support not included in this build")
Functions ¶
Types ¶
type Address ¶
func AddressFromString ¶
type Beacon ¶
type Beacon interface { Now() error Every(d time.Duration) error LocalAddr() net.Addr RemoteAddr() net.Addr Message() string }
func NewAX25Beacon ¶
type Config ¶
type Config struct { HBaud HBaud // Baudrate for packet channel [1200/9600]. SerialBaud int // Baudrate for the serial port. 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]. }
type Conn ¶
type Conn struct { io.ReadWriteCloser // contains filtered or unexported fields }
func DialAX25Timeout ¶
func (*Conn) RemoteAddr ¶
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