Documentation
¶
Overview ¶
Package beast provides objects and methods for decoding and managing raw Mode-S Beast format frames.
Index ¶
- Variables
- type Decoder
- type Frame
- func (f *Frame) Bytes() []byte
- func (f *Frame) MarshalBinary() ([]byte, error)
- func (f *Frame) ModeAC() ([]byte, error)
- func (f *Frame) ModeS() ([]byte, error)
- func (f *Frame) Signal() (uint8, error)
- func (f *Frame) Timestamp() (time.Duration, error)
- func (f *Frame) Type() (byte, error)
- func (f *Frame) UnmarshalBinary(data []byte) error
Constants ¶
This section is empty.
Variables ¶
var ErrNoData beastError = newError(nil, "data not available")
ErrNoData is returned when the frame does not contain the data necessary to return the requested information.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct { // Setting StripEscape to true will remove the extra escape // character from 0x1a values in the data passed to the // BinaryUnmarshaler by Decode. StripEscape bool // contains filtered or unexported fields }
Decoder reads a Beast stream and stores individual frames. It must be created with NewDecoder().
func NewDecoder ¶
NewDecoder returns a Decoder which reads from r.
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame is a Beast format message. A Frame is safe to reuse by calling UnmarshalBinary with new data.
func (*Frame) Bytes ¶ added in v0.1.0
Bytes returns the stored frame data. Escaped 0x1a values in the data are stripped before storing. To obtain the frame in the escaped wire format, use MarshalBinary.
The returned slice remains valid until the next call to UnmarshalBinary. Modifying the returned slice directly may impact future Frame method calls.
func (*Frame) MarshalBinary ¶ added in v0.3.0
MarshalBinary returns a Beast message.
func (*Frame) ModeAC ¶ added in v0.3.0
ModeAC returns the Mode AC data in a type 1 frame.
The returned slice remains valid until the next call to UnmarshalBinary. Modifying the returned slice directly may impact future Frame method calls.
func (*Frame) ModeS ¶ added in v0.4.0
ModeS returns the Mode S data in a type 2 or 3 frame.
The returned slice remains valid until the next call to UnmarshalBinary. Modifying the returned slice directly may impact future Frame method calls.
func (*Frame) UnmarshalBinary ¶
UnmarshalBinary stores a Beast message.