aprs

package module
v0.0.0-...-3a569c7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: MIT Imports: 8 Imported by: 0

README

go-aprs

Automatic Packet Reporting System implementation in Golang

Acknowledgements

Initial version based on dustin/go-aprs.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAddressInvalid = errors.New(`aprs: invalid address`)
)
View Source
var (
	ErrBase91Decode = errors.New(`aprs: invalid base-91 encoding`)
)
View Source
var (
	ErrInvalidPacket = errors.New(`aprs: invalid packet`)
)
View Source
var (
	ErrInvalidPosition = errors.New(`aprs: invalid position`)
)
View Source
var (
	ErrInvalidTime = errors.New(`aprs: invalid time`)
)

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) (a *Address, err 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
	Comment  string
	// contains filtered or unexported fields
}

func ParsePacket

func ParsePacket(raw string) (p Packet, err error)

type Path

type Path []*Address

func ParsePath

func ParsePath(p string) (as Path, err 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) (pos Position, txt string, err error)

func ParsePosition

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

func ParsePositionBoth

func ParsePositionBoth(s string) (pos Position, txt string, err error)

func ParsePositionGrid

func ParsePositionGrid(s string) (pos Position, txt string, err error)

func ParseUncompressedPosition

func ParseUncompressedPosition(s string) (pos Position, txt string, err 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) IsPrimaryTable

func (s Symbol) IsPrimaryTable() bool

func (Symbol) String

func (s Symbol) String() 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
cmd

Jump to

Keyboard shortcuts

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