aprs

package module
v0.0.0-...-453a651 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 9 Imported by: 3

README

go-aprs

Read-only Automatic Packet Reporting System library in Go.

See hb9tf/statusupdater as an example how to use it.

Acknowledgements

Initial version based on dustin/go-aprs.

Contributions by:

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidPacket signals a corrupted/unknown APRS packet.
	ErrInvalidPacket = errors.New("aprs: invalid packet")

	// ErrInvalidPosition signals a corrupted APRS position report.
	ErrInvalidPosition = errors.New("aprs: invalid position")
)
View Source
var (
	ErrAddressInvalid = errors.New(`aprs: invalid address`)
)
View Source
var (
	ErrBase91Decode = errors.New("aprs: invalid base-91 encoding")
)

Functions

func IsValidCompressedSymTable

func IsValidCompressedSymTable(c byte) bool

func IsValidUncompressedSymTable

func IsValidUncompressedSymTable(c byte) bool

func ParseTime

func ParseTime(s string) (time.Time, error)

Types

type Address

type Address struct {
	Call     string
	SSID     int
	Repeated bool
}

func MustParseAddress

func MustParseAddress(s string) *Address

func ParseAddress

func ParseAddress(s string) (*Address, error)

func (Address) EqualTo

func (a Address) EqualTo(b *Address) bool

func (Address) Secret

func (a Address) Secret() int16

func (Address) String

func (a Address) String() string

type DataType

type DataType byte

func (DataType) String

func (t DataType) String() string

type OmniDFStrength

type OmniDFStrength struct {
	StrengthCode    byte
	HeightCode      byte
	GainCode        byte
	DirectivityCode byte
}

func (OmniDFStrength) Directivity

func (o OmniDFStrength) Directivity() float64

func (OmniDFStrength) Gain

func (o OmniDFStrength) Gain() int

func (OmniDFStrength) Height

func (o OmniDFStrength) Height() float64

func (OmniDFStrength) Strength

func (o OmniDFStrength) Strength() int

type Packet

type Packet struct {
	Raw       string
	Src       *Address
	Dst       *Address
	Path      Path
	Payload   Payload
	Position  *Position
	Time      *time.Time
	Altitude  float64 // Feet
	Velocity  Velocity
	Wind      Wind
	PHG       PowerHeightGain
	DFS       OmniDFStrength
	Range     float64 // Miles
	Symbol    Symbol
	Comment   string
	Message   string
	MessageTo *Address
	// contains filtered or unexported fields
}

func ParsePacket

func ParsePacket(raw string) (Packet, error)

func (*Packet) AckNumber

func (p *Packet) AckNumber() (int, error)

func (*Packet) Hash

func (p *Packet) Hash() string

func (*Packet) IsAck

func (p *Packet) IsAck() bool

type Path

type Path []*Address

func ParsePath

func ParsePath(p string) (Path, error)

func (Path) String

func (p Path) String() string

type Payload

type Payload string

func (Payload) Len

func (p Payload) Len() int

func (Payload) Time

func (p Payload) Time() (time.Time, error)

func (Payload) Type

func (p Payload) Type() DataType

type Position

type Position struct {
	Latitude   float64 // Degrees
	Longitude  float64 // Degrees
	Ambiguity  int
	Symbol     Symbol
	Compressed bool
}

func ParseCompressedPosition

func ParseCompressedPosition(s string) (Position, string, error)

func ParseMicE

func ParseMicE(s, dest string) (Position, error)

func ParsePosition

func ParsePosition(s string, compressed bool) (Position, string, error)

func ParsePositionBoth

func ParsePositionBoth(s string) (Position, string, error)

func ParsePositionGrid

func ParsePositionGrid(s string) (Position, string, error)

func ParseUncompressedPosition

func ParseUncompressedPosition(s string) (Position, string, error)

func (*Position) String

func (pos *Position) String() string

type PowerHeightGain

type PowerHeightGain struct {
	PowerCode       byte
	HeightCode      byte
	GainCode        byte
	DirectivityCode byte
}

func (PowerHeightGain) Directivity

func (p PowerHeightGain) Directivity() float64

func (PowerHeightGain) Gain

func (p PowerHeightGain) Gain() int

func (PowerHeightGain) Height

func (p PowerHeightGain) Height() float64

func (PowerHeightGain) Power

func (p PowerHeightGain) Power() int

type Symbol

type Symbol [2]byte

func (Symbol) Emoji

func (s Symbol) Emoji() (string, error)

func (Symbol) IsPrimaryTable

func (s Symbol) IsPrimaryTable() bool

func (Symbol) SSID

func (s Symbol) SSID() (string, error)

func (Symbol) String

func (s Symbol) String() string

type TimeFormatError

type TimeFormatError struct {
	Time string
}

func (TimeFormatError) Error

func (err TimeFormatError) Error() string

type Velocity

type Velocity struct {
	Course float64 // Degrees
	Speed  float64 // Knots
}

type Wind

type Wind struct {
	Direction float64 // Degrees
	Speed     float64 // Knots
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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