uatparse

package
v0.0.0-...-df7d647 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCK_WIDTH      = float64(48.0 / 60.0)
	WIDE_BLOCK_WIDTH = float64(96.0 / 60.0)
	BLOCK_HEIGHT     = float64(4.0 / 60.0)
	BLOCK_THRESHOLD  = 405000
	BLOCKS_PER_RING  = 450
)
View Source
const (
	UATMSG_TEXT   = 1
	UATMSG_NEXRAD = 2
	UATMSG_AIRMET = 3 // AIRMET. Decoded.

	// How the coordinates should be used in a graphical AIRMET.
	AIRMET_POLYGON = 1
	AIRMET_ELLIPSE = 2
	AIRMET_PRISM   = 3
	AIRMET_3D      = 4
)
View Source
const (
	UPLINK_BLOCK_DATA_BITS  = 576
	UPLINK_BLOCK_BITS       = (UPLINK_BLOCK_DATA_BITS + 160)
	UPLINK_BLOCK_DATA_BYTES = (UPLINK_BLOCK_DATA_BITS / 8)
	UPLINK_BLOCK_BYTES      = (UPLINK_BLOCK_BITS / 8)

	UPLINK_FRAME_BLOCKS     = 6
	UPLINK_FRAME_DATA_BITS  = (UPLINK_FRAME_BLOCKS * UPLINK_BLOCK_DATA_BITS)
	UPLINK_FRAME_BITS       = (UPLINK_FRAME_BLOCKS * UPLINK_BLOCK_BITS)
	UPLINK_FRAME_DATA_BYTES = (UPLINK_FRAME_DATA_BITS / 8)
	UPLINK_FRAME_BYTES      = (UPLINK_FRAME_BITS / 8)

	// assume 6 byte frames: 2 header bytes, 4 byte payload
	// (TIS-B heartbeat with one address, or empty FIS-B APDU)
	UPLINK_MAX_INFO_FRAMES = (424 / 6)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoPoint

type GeoPoint struct {
	Lat float64
	Lon float64
	Alt int32
}

Points can be in 3D - take care that altitude is used correctly.

type NEXRADBlock

type NEXRADBlock struct {
	Radar_Type uint32
	Scale      int
	LatNorth   float64
	LonWest    float64
	Height     float64
	Width      float64
	Intensity  []uint16 // Really only 4-bit values, but using this as a hack for the JSON encoding.
}

type UATAirmet

type UATAirmet struct {
	Points []GeoPoint // Points
}

type UATFrame

type UATFrame struct {
	Raw_data     []byte
	FISB_data    []byte
	FISB_month   uint32
	FISB_day     uint32
	FISB_hours   uint32
	FISB_minutes uint32
	FISB_seconds uint32

	FISB_length uint32

	Frame_type uint32

	Product_id uint32
	// Text data, if applicable.
	Text_data []string

	// For AIRMET/NOTAM.
	//FIXME: Temporary.
	Points             []GeoPoint
	ReportNumber       uint16
	ReportYear         uint16
	LocationIdentifier string
	RecordFormat       uint8
	ReportStart        string
	ReportEnd          string

	// For NEXRAD.
	NEXRAD []NEXRADBlock
	// contains filtered or unexported fields
}

type UATMsg

type UATMsg struct {
	// Metadata from demodulation.
	RS_Err         int
	SignalStrength int

	// Station location for uplink frames, aircraft position for downlink frames.
	Lat    float64
	Lon    float64
	Frames []*UATFrame
	// contains filtered or unexported fields
}

func New

func New(buf string) (*UATMsg, error)
func (u *UATMsg) DecodeUplink() error

func (*UATMsg) GetTextReports

func (u *UATMsg) GetTextReports() ([]string, error)

type UATMsgDecoded

type UATMsgDecoded struct {
	Type int
}

Jump to

Keyboard shortcuts

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