cat62

package
v0.0.0-...-38c4600 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package cat62 implements ASTERIX Category 062 - SDPS Track Messages.

Index

Constants

View Source
const Category = 62

Category is the ASTERIX category number for SDPS Track Messages.

Variables

View Source
var (
	ErrDataTooShort = errors.New("data too short")
	ErrInvalidData  = errors.New("invalid data")
)

Common errors

View Source
var ItemSizes = map[int]int{
	10:  2,
	15:  1,
	40:  2,
	60:  2,
	70:  3,
	100: 6,
	105: 8,
	120: 2,
	130: 2,
	135: 2,
	136: 2,
	185: 4,
	200: 1,
	210: 2,
	220: 2,
	245: 7,
	300: 1,
}

ItemSizes defines the size of each fixed-length data item. Variable-length items are handled specially in the decoder.

View Source
var UAP = map[int]int{
	1:  10,
	2:  0,
	3:  15,
	4:  70,
	5:  105,
	6:  100,
	7:  185,
	8:  210,
	9:  60,
	10: 245,

	12: 40,
	13: 80,
	14: 290,
	15: 200,

	17: 136,
	18: 130,
	19: 135,
	20: 220,

	22: 270,
	23: 300,

	25: 120,
	26: 510,
	27: 500,
}

UAP defines the User Application Profile for CAT 062. Maps FRN (Field Reference Number) to data item numbers.

Functions

func EncodeBlock

func EncodeBlock(tracks []*Track) ([]byte, error)

EncodeBlock encodes a slice of Tracks into a complete ASTERIX block.

func EncodeRecords

func EncodeRecords(tracks []*Track) []block.Record

EncodeRecords encodes a slice of Tracks into Records.

Types

type AltitudeSource

type AltitudeSource uint8

AltitudeSource indicates the source of calculated track altitude.

const (
	SRCNoSource        AltitudeSource = 0 // No source
	SRCGNSS            AltitudeSource = 1 // GNSS
	SRC3DRadar         AltitudeSource = 2 // 3D radar
	SRCTriangulation   AltitudeSource = 3 // Triangulation
	SRCHeightCoverage  AltitudeSource = 4 // Height from coverage
	SRCSpeedLookup     AltitudeSource = 5 // Speed look-up table
	SRCDefaultHeight   AltitudeSource = 6 // Default height
	SRCMultilateration AltitudeSource = 7 // Multilateration
)

type CalculatedAccelerationCartesian

type CalculatedAccelerationCartesian struct {
	Ax int8 // X component of acceleration in 0.25 m/s² units
	Ay int8 // Y component of acceleration in 0.25 m/s² units
}

CalculatedAccelerationCartesian represents I062/210 - Calculated Acceleration (Cartesian). Calculated Acceleration of the target expressed in Cartesian co-ordinates. Format: 2-octet fixed length LSB = 0.25 m/s²

func DecodeCalculatedAccelerationCartesian

func DecodeCalculatedAccelerationCartesian(data []byte) (*CalculatedAccelerationCartesian, error)

DecodeCalculatedAccelerationCartesian decodes I062/210 from bytes.

func (*CalculatedAccelerationCartesian) AxMetersPerSecondSquared

func (c *CalculatedAccelerationCartesian) AxMetersPerSecondSquared() float64

AxMetersPerSecondSquared returns the X acceleration in m/s².

func (*CalculatedAccelerationCartesian) AyMetersPerSecondSquared

func (c *CalculatedAccelerationCartesian) AyMetersPerSecondSquared() float64

AyMetersPerSecondSquared returns the Y acceleration in m/s².

func (*CalculatedAccelerationCartesian) Encode

func (c *CalculatedAccelerationCartesian) Encode() []byte

Encode encodes I062/210 to bytes.

func (*CalculatedAccelerationCartesian) Len

Len returns the encoded length.

func (*CalculatedAccelerationCartesian) SetFromMetersPerSecondSquared

func (c *CalculatedAccelerationCartesian) SetFromMetersPerSecondSquared(ax, ay float64)

SetFromMetersPerSecondSquared sets the acceleration from m/s².

type CalculatedPositionCartesian

type CalculatedPositionCartesian struct {
	X int32 // X coordinate in 0.5m units (signed 24-bit, range ±4194 km)
	Y int32 // Y coordinate in 0.5m units (signed 24-bit, range ±4194 km)
}

CalculatedPositionCartesian represents I062/100 - Calculated Track Position (Cartesian). Calculated position in Cartesian co-ordinates with a resolution of 0.5m. Format: 6-octet fixed length X and Y are signed 24-bit integers, LSB = 0.5 m

func DecodeCalculatedPositionCartesian

func DecodeCalculatedPositionCartesian(data []byte) (*CalculatedPositionCartesian, error)

DecodeCalculatedPositionCartesian decodes I062/100 from bytes.

func (*CalculatedPositionCartesian) Encode

func (c *CalculatedPositionCartesian) Encode() []byte

Encode encodes I062/100 to bytes.

func (*CalculatedPositionCartesian) Len

Len returns the encoded length.

func (*CalculatedPositionCartesian) SetFromMeters

func (c *CalculatedPositionCartesian) SetFromMeters(x, y float64)

SetFromMeters sets the position from meters.

func (*CalculatedPositionCartesian) XMeters

func (c *CalculatedPositionCartesian) XMeters() float64

XMeters returns the X coordinate in meters.

func (*CalculatedPositionCartesian) YMeters

func (c *CalculatedPositionCartesian) YMeters() float64

YMeters returns the Y coordinate in meters.

type CalculatedPositionWGS84

type CalculatedPositionWGS84 struct {
	Latitude  int32 // Latitude in WGS-84, LSB = 180/2^25 degrees
	Longitude int32 // Longitude in WGS-84, LSB = 180/2^25 degrees
}

CalculatedPositionWGS84 represents I062/105 - Calculated Position In WGS-84 Co-ordinates. Calculated Position in WGS-84 Co-ordinates with a resolution of 180/2^25 degrees. Format: 8-octet fixed length

func DecodeCalculatedPositionWGS84

func DecodeCalculatedPositionWGS84(data []byte) (*CalculatedPositionWGS84, error)

DecodeCalculatedPositionWGS84 decodes I062/105 from bytes.

func (*CalculatedPositionWGS84) Encode

func (c *CalculatedPositionWGS84) Encode() []byte

Encode encodes I062/105 to bytes.

func (*CalculatedPositionWGS84) LatitudeDegrees

func (c *CalculatedPositionWGS84) LatitudeDegrees() float64

LatitudeDegrees returns the latitude in degrees.

func (*CalculatedPositionWGS84) Len

func (c *CalculatedPositionWGS84) Len() int

Len returns the encoded length.

func (*CalculatedPositionWGS84) LongitudeDegrees

func (c *CalculatedPositionWGS84) LongitudeDegrees() float64

LongitudeDegrees returns the longitude in degrees.

func (*CalculatedPositionWGS84) SetFromDegrees

func (c *CalculatedPositionWGS84) SetFromDegrees(lat, lon float64)

SetFromDegrees sets the position from degrees.

type CalculatedRateOfClimbDescent

type CalculatedRateOfClimbDescent struct {
	Rate int16 // Rate in 6.25 ft/min units
}

CalculatedRateOfClimbDescent represents I062/220 - Calculated Rate Of Climb/Descent. Calculated rate of Climb/Descent of an aircraft. Format: 2-octet fixed length LSB = 6.25 feet/minute Positive = climb, Negative = descent

func DecodeCalculatedRateOfClimbDescent

func DecodeCalculatedRateOfClimbDescent(data []byte) (*CalculatedRateOfClimbDescent, error)

DecodeCalculatedRateOfClimbDescent decodes I062/220 from bytes.

func (*CalculatedRateOfClimbDescent) Encode

func (c *CalculatedRateOfClimbDescent) Encode() []byte

Encode encodes I062/220 to bytes.

func (*CalculatedRateOfClimbDescent) FeetPerMinute

func (c *CalculatedRateOfClimbDescent) FeetPerMinute() float64

FeetPerMinute returns the rate in feet per minute.

func (*CalculatedRateOfClimbDescent) Len

Len returns the encoded length.

func (*CalculatedRateOfClimbDescent) SetFromFeetPerMinute

func (c *CalculatedRateOfClimbDescent) SetFromFeetPerMinute(fpm float64)

SetFromFeetPerMinute sets the rate from feet per minute.

type CalculatedTrackBarometricAltitude

type CalculatedTrackBarometricAltitude struct {
	QNH      bool  // QNH correction applied
	Altitude int16 // Altitude in 1/4 FL (25 ft) units (15 bits, signed)
}

CalculatedTrackBarometricAltitude represents I062/135 - Calculated Track Barometric Altitude. Calculated Barometric Altitude of the track. Format: 2-octet fixed length LSB = 1/4 FL = 25 ft, Range: -15 FL to 1500 FL

func DecodeCalculatedTrackBarometricAltitude

func DecodeCalculatedTrackBarometricAltitude(data []byte) (*CalculatedTrackBarometricAltitude, error)

DecodeCalculatedTrackBarometricAltitude decodes I062/135 from bytes.

func (*CalculatedTrackBarometricAltitude) AltitudeFeet

func (c *CalculatedTrackBarometricAltitude) AltitudeFeet() float64

AltitudeFeet returns the altitude in feet.

func (*CalculatedTrackBarometricAltitude) Encode

Encode encodes I062/135 to bytes.

func (*CalculatedTrackBarometricAltitude) FlightLevel

func (c *CalculatedTrackBarometricAltitude) FlightLevel() float64

FlightLevel returns the altitude as a flight level.

func (*CalculatedTrackBarometricAltitude) Len

Len returns the encoded length.

func (*CalculatedTrackBarometricAltitude) SetFromFlightLevel

func (c *CalculatedTrackBarometricAltitude) SetFromFlightLevel(fl float64)

SetFromFlightLevel sets the altitude from a flight level.

type CalculatedTrackGeometricAltitude

type CalculatedTrackGeometricAltitude struct {
	Altitude int16 // Altitude in 6.25 ft units
}

CalculatedTrackGeometricAltitude represents I062/130 - Calculated Track Geometric Altitude. Vertical distance between the target and the projection of its position on the earth's ellipsoid, as defined by WGS84. Format: 2-octet fixed length LSB = 6.25 ft, Range: -1500 ft to 150000 ft

func DecodeCalculatedTrackGeometricAltitude

func DecodeCalculatedTrackGeometricAltitude(data []byte) (*CalculatedTrackGeometricAltitude, error)

DecodeCalculatedTrackGeometricAltitude decodes I062/130 from bytes.

func (*CalculatedTrackGeometricAltitude) AltitudeFeet

func (c *CalculatedTrackGeometricAltitude) AltitudeFeet() float64

AltitudeFeet returns the altitude in feet.

func (*CalculatedTrackGeometricAltitude) Encode

func (c *CalculatedTrackGeometricAltitude) Encode() []byte

Encode encodes I062/130 to bytes.

func (*CalculatedTrackGeometricAltitude) Len

Len returns the encoded length.

func (*CalculatedTrackGeometricAltitude) SetFromFeet

func (c *CalculatedTrackGeometricAltitude) SetFromFeet(feet float64)

SetFromFeet sets the altitude from feet.

type CalculatedVelocityCartesian

type CalculatedVelocityCartesian struct {
	Vx int16 // X component of velocity in 0.25 m/s units
	Vy int16 // Y component of velocity in 0.25 m/s units
}

CalculatedVelocityCartesian represents I062/185 - Calculated Track Velocity (Cartesian). Calculated track velocity expressed in Cartesian co-ordinates. Format: 4-octet fixed length LSB = 0.25 m/s, Range: -8192 m/s to 8191.75 m/s

func DecodeCalculatedVelocityCartesian

func DecodeCalculatedVelocityCartesian(data []byte) (*CalculatedVelocityCartesian, error)

DecodeCalculatedVelocityCartesian decodes I062/185 from bytes.

func (*CalculatedVelocityCartesian) Encode

func (c *CalculatedVelocityCartesian) Encode() []byte

Encode encodes I062/185 to bytes.

func (*CalculatedVelocityCartesian) Len

Len returns the encoded length.

func (*CalculatedVelocityCartesian) SetFromMetersPerSecond

func (c *CalculatedVelocityCartesian) SetFromMetersPerSecond(vx, vy float64)

SetFromMetersPerSecond sets the velocity from m/s.

func (*CalculatedVelocityCartesian) VxMetersPerSecond

func (c *CalculatedVelocityCartesian) VxMetersPerSecond() float64

VxMetersPerSecond returns the X velocity in m/s.

func (*CalculatedVelocityCartesian) VyMetersPerSecond

func (c *CalculatedVelocityCartesian) VyMetersPerSecond() float64

VyMetersPerSecond returns the Y velocity in m/s.

type ComposedTrackEntry

type ComposedTrackEntry struct {
	SystemUnitID uint8  // System Unit Identification
	TrackNumber  uint16 // System Track Number (15 bits)
}

ComposedTrackEntry represents a single entry in the composed track number.

type ComposedTrackNumber

type ComposedTrackNumber struct {
	MasterTrack ComposedTrackEntry   // Master track number
	SlaveTracks []ComposedTrackEntry // Slave track numbers (optional)
}

ComposedTrackNumber represents I062/510 - Composed Track Number. Identification of a system track from multiple cooperating units. Format: Extendible data item, comprising 3-octet parts with FX extension. First part is the Master Track Number, followed by Slave Track Numbers.

func DecodeComposedTrackNumber

func DecodeComposedTrackNumber(data []byte) (*ComposedTrackNumber, int, error)

DecodeComposedTrackNumber decodes I062/510 from bytes. Returns the ComposedTrackNumber and the number of bytes consumed.

func (*ComposedTrackNumber) Encode

func (t *ComposedTrackNumber) Encode() []byte

Encode encodes I062/510 to bytes.

func (*ComposedTrackNumber) Len

func (t *ComposedTrackNumber) Len() int

Len returns the encoded length.

type DataSourceIdentifier

type DataSourceIdentifier struct {
	SAC uint8 // System Area Code
	SIC uint8 // System Identification Code
}

DataSourceIdentifier represents I062/010 - Data Source Identifier. Identification of the system sending the data. Format: 2-octet fixed length

func DecodeDataSourceIdentifier

func DecodeDataSourceIdentifier(data []byte) (*DataSourceIdentifier, error)

DecodeDataSourceIdentifier decodes I062/010 from bytes.

func (*DataSourceIdentifier) Encode

func (d *DataSourceIdentifier) Encode() []byte

Encode encodes I062/010 to bytes.

func (*DataSourceIdentifier) Len

func (d *DataSourceIdentifier) Len() int

Len returns the encoded length.

type EstimatedAccuracies

type EstimatedAccuracies struct {
	// SF1: Estimated Accuracy Of Track Position (Cartesian)
	// X and Y components, LSB = 0.5m
	APC *struct {
		X uint16
		Y uint16
	}

	// SF2: XY Covariance Component (signed, LSB = 0.5m)
	COV *int16

	// SF3: Estimated Accuracy Of Track Position (WGS-84)
	// Latitude and Longitude components, LSB = 180/2^25 degrees
	APW *struct {
		Lat uint16
		Lon uint16
	}

	// SF4: Estimated Accuracy Of Calculated Track Geometric Altitude
	// LSB = 6.25 ft
	AGA *uint8

	// SF5: Estimated Accuracy Of Calculated Track Barometric Altitude
	// LSB = 1/4 FL
	ABA *uint8

	// SF6: Estimated Accuracy Of Track Velocity (Cartesian)
	// X and Y components, LSB = 0.25 m/s
	ATV *struct {
		X uint8
		Y uint8
	}

	// SF7: Estimated Accuracy Of Acceleration (Cartesian)
	// X and Y components, LSB = 0.25 m/s²
	AA *struct {
		X uint8
		Y uint8
	}

	// SF8: Estimated Accuracy Of Rate Of Climb/Descent
	// LSB = 6.25 feet/minute
	ARC *uint8
}

EstimatedAccuracies represents I062/500 - Estimated Accuracies. Overview of all important accuracies (standard deviations). Format: Compound Data Item with FX-extended primary subfield

func DecodeEstimatedAccuracies

func DecodeEstimatedAccuracies(data []byte) (*EstimatedAccuracies, int, error)

DecodeEstimatedAccuracies decodes I062/500 from bytes. Returns the EstimatedAccuracies and the number of bytes consumed.

func (*EstimatedAccuracies) ABAFlightLevel

func (e *EstimatedAccuracies) ABAFlightLevel() *float64

ABAFlightLevel returns the barometric altitude accuracy in flight levels.

func (*EstimatedAccuracies) AGAFeet

func (e *EstimatedAccuracies) AGAFeet() *float64

AGAFeet returns the geometric altitude accuracy in feet.

func (*EstimatedAccuracies) APCMeters

func (e *EstimatedAccuracies) APCMeters() (x, y *float64)

APCMeters returns the position accuracy (Cartesian) in meters.

func (*EstimatedAccuracies) Encode

func (e *EstimatedAccuracies) Encode() []byte

Encode encodes I062/500 to bytes.

func (*EstimatedAccuracies) Len

func (e *EstimatedAccuracies) Len() int

Len returns the encoded length.

type LongitudinalAcceleration

type LongitudinalAcceleration uint8

LongitudinalAcceleration indicates the longitudinal acceleration state.

const (
	LongConstantSpeed   LongitudinalAcceleration = 0 // Constant Groundspeed
	LongIncreasingSpeed LongitudinalAcceleration = 1 // Increasing Groundspeed
	LongDecreasingSpeed LongitudinalAcceleration = 2 // Decreasing Groundspeed
	LongUndetermined    LongitudinalAcceleration = 3 // Undetermined
)

type MeasuredFlightLevel

type MeasuredFlightLevel struct {
	FlightLevel int16 // Flight level in 1/4 FL units
}

MeasuredFlightLevel represents I062/136 - Measured Flight Level. Last valid and credible flight level used to update the track. Format: 2-octet fixed length LSB = 1/4 FL, Range: -15 FL to 1500 FL

func DecodeMeasuredFlightLevel

func DecodeMeasuredFlightLevel(data []byte) (*MeasuredFlightLevel, error)

DecodeMeasuredFlightLevel decodes I062/136 from bytes.

func (*MeasuredFlightLevel) AltitudeFeet

func (m *MeasuredFlightLevel) AltitudeFeet() float64

AltitudeFeet returns the altitude in feet.

func (*MeasuredFlightLevel) Encode

func (m *MeasuredFlightLevel) Encode() []byte

Encode encodes I062/136 to bytes.

func (*MeasuredFlightLevel) FL

func (m *MeasuredFlightLevel) FL() float64

FL returns the flight level as a float.

func (*MeasuredFlightLevel) Len

func (m *MeasuredFlightLevel) Len() int

Len returns the encoded length.

func (*MeasuredFlightLevel) SetFromFL

func (m *MeasuredFlightLevel) SetFromFL(fl float64)

SetFromFL sets the flight level from a float.

type Mode4Status

type Mode4Status uint8

Mode4Status indicates the Mode 4 interrogation status.

const (
	MD4NoInterrogation Mode4Status = 0 // No Mode 4 interrogation
	MD4Friendly        Mode4Status = 1 // Friendly target
	MD4Unknown         Mode4Status = 2 // Unknown target
	MD4NoReply         Mode4Status = 3 // No reply
)

type Mode5Status

type Mode5Status uint8

Mode5Status indicates the Mode 5 interrogation status.

const (
	MD5NoInterrogation Mode5Status = 0 // No Mode 5 interrogation
	MD5Friendly        Mode5Status = 1 // Friendly target
	MD5Unknown         Mode5Status = 2 // Unknown target
	MD5NoReply         Mode5Status = 3 // No reply
)

type ModeOfMovement

type ModeOfMovement struct {
	Transversal  TransversalAcceleration  // Transversal Acceleration (bits 8-7)
	Longitudinal LongitudinalAcceleration // Longitudinal Acceleration (bits 6-5)
	Vertical     VerticalRate             // Vertical Rate (bits 4-3)
	ADF          bool                     // Altitude Discrepancy Flag (bit 2)
}

ModeOfMovement represents I062/200 - Mode of Movement. Calculated Mode of Movement of a target. Format: 1-octet fixed length

func DecodeModeOfMovement

func DecodeModeOfMovement(data []byte) (*ModeOfMovement, error)

DecodeModeOfMovement decodes I062/200 from bytes.

func (*ModeOfMovement) Encode

func (m *ModeOfMovement) Encode() []byte

Encode encodes I062/200 to bytes.

func (*ModeOfMovement) Len

func (m *ModeOfMovement) Len() int

Len returns the encoded length.

type ServiceIdentification

type ServiceIdentification struct {
	ServiceID uint8
}

ServiceIdentification represents I062/015 - Service Identification. Identification of the service provided to one or more users. Format: 1-octet fixed length

func DecodeServiceIdentification

func DecodeServiceIdentification(data []byte) (*ServiceIdentification, error)

DecodeServiceIdentification decodes I062/015 from bytes.

func (*ServiceIdentification) Encode

func (s *ServiceIdentification) Encode() []byte

Encode encodes I062/015 to bytes.

func (*ServiceIdentification) Len

func (s *ServiceIdentification) Len() int

Len returns the encoded length.

type SourceOfTargetIdentification

type SourceOfTargetIdentification uint8

SourceOfTargetIdentification indicates the source of target identification.

const (
	STICallsignDownlinked        SourceOfTargetIdentification = 0 // Callsign or registration downlinked from target
	STICallsignNotDownlinked     SourceOfTargetIdentification = 1 // Callsign not downlinked from target
	STIRegistrationNotDownlinked SourceOfTargetIdentification = 2 // Registration not downlinked from target
	STIInvalid                   SourceOfTargetIdentification = 3 // Invalid
)

type SystemTrackUpdateAges

type SystemTrackUpdateAges struct {
	TrackAge *uint8  // SF1: Track age (LSB = 1/4 s, max 63.75s)
	PSRAge   *uint8  // SF2: PSR age (LSB = 1/4 s, max 63.75s)
	SSRAge   *uint8  // SF3: SSR age (LSB = 1/4 s, max 63.75s)
	MDSAge   *uint8  // SF4: Mode S age (LSB = 1/4 s, max 63.75s)
	ADSAge   *uint16 // SF5: ADS-C age (LSB = 1/4 s, max 16383.75s) - 2 bytes!
	ESAge    *uint8  // SF6: ADS-B Extended Squitter age (LSB = 1/4 s)
	VDLAge   *uint8  // SF7: ADS-B VDL Mode 4 age (LSB = 1/4 s)
	UATAge   *uint8  // SF8: ADS-B UAT age (LSB = 1/4 s)
	LOPAge   *uint8  // SF9: Loop age (LSB = 1/4 s)
	MLTAge   *uint8  // SF10: Multilateration age (LSB = 1/4 s)
}

SystemTrackUpdateAges represents I062/290 - System Track Update Ages. Ages of the last plot/local track/target report update for each sensor type. Format: Compound Data Item with FX-extended primary subfield

func DecodeSystemTrackUpdateAges

func DecodeSystemTrackUpdateAges(data []byte) (*SystemTrackUpdateAges, int, error)

DecodeSystemTrackUpdateAges decodes I062/290 from bytes. Returns the SystemTrackUpdateAges and the number of bytes consumed.

func (*SystemTrackUpdateAges) ADSAgeSeconds

func (t *SystemTrackUpdateAges) ADSAgeSeconds() *float64

ADSAgeSeconds returns the ADS-C age in seconds.

func (*SystemTrackUpdateAges) Encode

func (t *SystemTrackUpdateAges) Encode() []byte

Encode encodes I062/290 to bytes.

func (*SystemTrackUpdateAges) Len

func (t *SystemTrackUpdateAges) Len() int

Len returns the encoded length.

func (*SystemTrackUpdateAges) MDSAgeSeconds

func (t *SystemTrackUpdateAges) MDSAgeSeconds() *float64

MDSAgeSeconds returns the Mode S age in seconds.

func (*SystemTrackUpdateAges) PSRAgeSeconds

func (t *SystemTrackUpdateAges) PSRAgeSeconds() *float64

PSRAgeSeconds returns the PSR age in seconds.

func (*SystemTrackUpdateAges) SSRAgeSeconds

func (t *SystemTrackUpdateAges) SSRAgeSeconds() *float64

SSRAgeSeconds returns the SSR age in seconds.

func (*SystemTrackUpdateAges) TrackAgeSeconds

func (t *SystemTrackUpdateAges) TrackAgeSeconds() *float64

TrackAgeSeconds returns the track age in seconds.

type TargetIdentification

type TargetIdentification struct {
	STI      SourceOfTargetIdentification // Source of Target Identification
	Callsign string                       // 8-character callsign
}

TargetIdentification represents I062/245 - Target Identification. Target (aircraft or vehicle) identification in 8 characters. Format: 7-octet fixed length Characters are encoded using ICAO 6-bit encoding.

func DecodeTargetIdentification

func DecodeTargetIdentification(data []byte) (*TargetIdentification, error)

DecodeTargetIdentification decodes I062/245 from bytes.

func (*TargetIdentification) Encode

func (t *TargetIdentification) Encode() []byte

Encode encodes I062/245 to bytes.

func (*TargetIdentification) Len

func (t *TargetIdentification) Len() int

Len returns the encoded length.

type TargetSizeOrientation

type TargetSizeOrientation struct {
	Length      *uint8 // Target length in meters (7 bits, optional)
	Orientation *uint8 // Orientation in 360/128 degree units (7 bits, optional)
	Width       *uint8 // Target width in meters (7 bits, optional)
}

TargetSizeOrientation represents I062/270 - Target Size & Orientation. Target size defined as length and width of the detected target, and orientation. Format: Variable length Data Item with FX extensions (1-3 octets)

func DecodeTargetSizeOrientation

func DecodeTargetSizeOrientation(data []byte) (*TargetSizeOrientation, int, error)

DecodeTargetSizeOrientation decodes I062/270 from bytes. Returns the TargetSizeOrientation and the number of bytes consumed.

func (*TargetSizeOrientation) Encode

func (t *TargetSizeOrientation) Encode() []byte

Encode encodes I062/270 to bytes.

func (*TargetSizeOrientation) Len

func (t *TargetSizeOrientation) Len() int

Len returns the encoded length.

func (*TargetSizeOrientation) LengthMeters

func (t *TargetSizeOrientation) LengthMeters() *float64

LengthMeters returns the length in meters.

func (*TargetSizeOrientation) OrientationDegrees

func (t *TargetSizeOrientation) OrientationDegrees() *float64

OrientationDegrees returns the orientation in degrees.

func (*TargetSizeOrientation) WidthMeters

func (t *TargetSizeOrientation) WidthMeters() *float64

WidthMeters returns the width in meters.

type TimeOfTrackInformation

type TimeOfTrackInformation struct {
	Time uint32 // Time in 1/128 second units (only 24 bits used)
}

TimeOfTrackInformation represents I062/070 - Time Of Track Information. Absolute time stamping of the information provided in the track message, in the form of elapsed time since last midnight, expressed as UTC. Format: 3-octet fixed length LSB = 1/128 s

func DecodeTimeOfTrackInformation

func DecodeTimeOfTrackInformation(data []byte) (*TimeOfTrackInformation, error)

DecodeTimeOfTrackInformation decodes I062/070 from bytes.

func (*TimeOfTrackInformation) Duration

func (t *TimeOfTrackInformation) Duration() time.Duration

Duration returns the time as a time.Duration since midnight.

func (*TimeOfTrackInformation) Encode

func (t *TimeOfTrackInformation) Encode() []byte

Encode encodes I062/070 to bytes.

func (*TimeOfTrackInformation) Len

func (t *TimeOfTrackInformation) Len() int

Len returns the encoded length.

func (*TimeOfTrackInformation) Seconds

func (t *TimeOfTrackInformation) Seconds() float64

Seconds returns the time as seconds since midnight.

func (*TimeOfTrackInformation) SetFromSeconds

func (t *TimeOfTrackInformation) SetFromSeconds(seconds float64)

SetFromSeconds sets the time from seconds since midnight.

type Track

type Track struct {
	// FRN 1: I062/010 - Data Source Identifier (mandatory)
	DataSourceIdentifier *DataSourceIdentifier

	// FRN 3: I062/015 - Service Identification
	ServiceIdentification *ServiceIdentification

	// FRN 4: I062/070 - Time Of Track Information (mandatory)
	TimeOfTrackInformation *TimeOfTrackInformation

	// FRN 5: I062/105 - Calculated Track Position (WGS-84)
	CalculatedPositionWGS84 *CalculatedPositionWGS84

	// FRN 6: I062/100 - Calculated Track Position (Cartesian)
	CalculatedPositionCartesian *CalculatedPositionCartesian

	// FRN 7: I062/185 - Calculated Track Velocity (Cartesian)
	CalculatedVelocityCartesian *CalculatedVelocityCartesian

	// FRN 8: I062/210 - Calculated Acceleration (Cartesian)
	CalculatedAccelerationCartesian *CalculatedAccelerationCartesian

	// FRN 9: I062/060 - Track Mode 3/A Code
	TrackMode3ACode *TrackMode3ACode

	// FRN 10: I062/245 - Target Identification
	TargetIdentification *TargetIdentification

	// FRN 12: I062/040 - Track Number (mandatory)
	TrackNumber *TrackNumber

	// FRN 13: I062/080 - Track Status (mandatory)
	TrackStatus *TrackStatus

	// FRN 14: I062/290 - System Track Update Ages
	SystemTrackUpdateAges *SystemTrackUpdateAges

	// FRN 15: I062/200 - Mode of Movement
	ModeOfMovement *ModeOfMovement

	// FRN 17: I062/136 - Measured Flight Level
	MeasuredFlightLevel *MeasuredFlightLevel

	// FRN 18: I062/130 - Calculated Track Geometric Altitude
	CalculatedTrackGeometricAltitude *CalculatedTrackGeometricAltitude

	// FRN 19: I062/135 - Calculated Track Barometric Altitude
	CalculatedTrackBarometricAltitude *CalculatedTrackBarometricAltitude

	// FRN 20: I062/220 - Calculated Rate Of Climb/Descent
	CalculatedRateOfClimbDescent *CalculatedRateOfClimbDescent

	// FRN 22: I062/270 - Target Size & Orientation
	TargetSizeOrientation *TargetSizeOrientation

	// FRN 23: I062/300 - Vehicle Fleet Identification
	VehicleFleetIdentification *VehicleFleetIdentification

	// FRN 25: I062/120 - Track Mode 2 Code
	TrackMode2Code *TrackMode2Code

	// FRN 26: I062/510 - Composed Track Number
	ComposedTrackNumber *ComposedTrackNumber

	// FRN 27: I062/500 - Estimated Accuracies
	EstimatedAccuracies *EstimatedAccuracies
}

Track represents a decoded CAT 062 track message.

func Decode

func Decode(rec *block.Record) (*Track, error)

Decode decodes an ASTERIX CAT 062 record into a Track struct. The record must have FSPEC and Data already parsed.

func DecodeBlock

func DecodeBlock(blk *block.RawBlock) ([]*Track, error)

DecodeBlock decodes all CAT 062 records from a RawBlock.

func DecodeRecords

func DecodeRecords(data []byte) ([]*Track, error)

DecodeRecords decodes all CAT 062 records from raw bytes. This is the main entry point for parsing CAT 062 data from a block.

func (*Track) Encode

func (t *Track) Encode() *block.Record

Encode encodes a Track into an ASTERIX record (FSPEC + Data).

type TrackMode2Code

type TrackMode2Code struct {
	Code uint16 // Mode-2 reply in octal (12 bits)
}

TrackMode2Code represents I062/120 - Track Mode 2 Code. Mode-2 code in octal representation. Format: 2-octet fixed length

func DecodeTrackMode2Code

func DecodeTrackMode2Code(data []byte) (*TrackMode2Code, error)

DecodeTrackMode2Code decodes I062/120 from bytes.

func (*TrackMode2Code) Encode

func (t *TrackMode2Code) Encode() []byte

Encode encodes I062/120 to bytes.

func (*TrackMode2Code) Len

func (t *TrackMode2Code) Len() int

Len returns the encoded length.

func (*TrackMode2Code) OctalString

func (t *TrackMode2Code) OctalString() string

OctalString returns the Mode 2 code as an octal string (e.g., "7700").

type TrackMode3ACode

type TrackMode3ACode struct {
	V    bool   // Code validated (false=validated, true=not validated)
	G    bool   // Garbled code
	CH   bool   // Change in Mode 3/A (true=changed)
	Code uint16 // Mode-3/A reply in octal (12 bits: A4A2A1 B4B2B1 C4C2C1 D4D2D1)
}

TrackMode3ACode represents I062/060 - Track Mode 3/A Code. Mode-3/A code converted into octal representation. Format: 2-octet fixed length

func DecodeTrackMode3ACode

func DecodeTrackMode3ACode(data []byte) (*TrackMode3ACode, error)

DecodeTrackMode3ACode decodes I062/060 from bytes.

func (*TrackMode3ACode) Encode

func (t *TrackMode3ACode) Encode() []byte

Encode encodes I062/060 to bytes.

func (*TrackMode3ACode) Len

func (t *TrackMode3ACode) Len() int

Len returns the encoded length.

func (*TrackMode3ACode) OctalString

func (t *TrackMode3ACode) OctalString() string

OctalString returns the Mode 3/A code as an octal string (e.g., "7700").

type TrackNumber

type TrackNumber struct {
	Number uint16
}

TrackNumber represents I062/040 - Track Number. Identification of a track. Format: 2-octet fixed length

func DecodeTrackNumber

func DecodeTrackNumber(data []byte) (*TrackNumber, error)

DecodeTrackNumber decodes I062/040 from bytes.

func (*TrackNumber) Encode

func (t *TrackNumber) Encode() []byte

Encode encodes I062/040 to bytes.

func (*TrackNumber) Len

func (t *TrackNumber) Len() int

Len returns the encoded length.

type TrackStatus

type TrackStatus struct {
	// Octet 1 (mandatory)
	MON bool           // Monosensor track (false=multisensor)
	SPI bool           // SPI present
	MRH bool           // Most Reliable Height: true=geometric, false=barometric
	SRC AltitudeSource // Source of calculated track altitude
	CNF bool           // Confirmed track (false=confirmed, true=tentative)

	// First Extension
	SIM bool // Simulated track
	TSE bool // Last message transmitted to user for the track
	TSB bool // First message transmitted to user for the track
	FPC bool // Flight plan correlated
	AFF bool // ADS-B data inconsistent with other surveillance
	STP bool // Slave Track Promotion
	KOS bool // Background service used (false=complementary)

	// Second Extension
	AMA bool        // Track resulting from amalgamation
	MD4 Mode4Status // Mode 4 interrogation status
	ME  bool        // Military Emergency present
	MI  bool        // Military Identification present
	MD5 Mode5Status // Mode 5 interrogation status

	// Third Extension
	CST bool // Coasting (age of last update > threshold)
	PSR bool // Age of last PSR update > threshold
	SSR bool // Age of last SSR update > threshold
	MDS bool // Age of last Mode S update > threshold
	ADS bool // Age of last ADS-B update > threshold
	SUC bool // Special Used Code
	AAC bool // Assigned Mode A Code Conflict

	// Fourth Extension
	SDS  uint8 // Surveillance Data Status (2 bits)
	EMS  uint8 // Emergency Status (3 bits)
	PFT  bool  // Potential False Track
	FPLT bool  // Flight plan track

	// Fifth Extension
	DUPT bool // Duplicate Mode 3/A Code
	DUPF bool // Duplicate Flight Plan
	DUPM bool // Duplicate Flight Plan due to manual correlation
	SFC  bool // Surface target
	IDD  bool // Duplicate Flight-ID
	IEC  bool // Inconsistent Emergency Code
	MLAT bool // Age of last MLAT update > threshold

	// Sixth Extension
	M5I bool // Age of last Mode 5 interrogation update > threshold
	// contains filtered or unexported fields
}

TrackStatus represents I062/080 - Track Status. Status of a track. Format: Variable length data item with FX extensions (1-7 octets)

func DecodeTrackStatus

func DecodeTrackStatus(data []byte) (*TrackStatus, int, error)

DecodeTrackStatus decodes I062/080 from bytes. Returns the TrackStatus and the number of bytes consumed.

func (*TrackStatus) Encode

func (t *TrackStatus) Encode() []byte

Encode encodes I062/080 to bytes.

func (*TrackStatus) Len

func (t *TrackStatus) Len() int

Len returns the encoded length.

type TransversalAcceleration

type TransversalAcceleration uint8

TransversalAcceleration indicates the transversal acceleration state.

const (
	TransConstantCourse TransversalAcceleration = 0 // Constant Course
	TransRightTurn      TransversalAcceleration = 1 // Right Turn
	TransLeftTurn       TransversalAcceleration = 2 // Left Turn
	TransUndetermined   TransversalAcceleration = 3 // Undetermined
)

type VehicleFleetIdentification

type VehicleFleetIdentification struct {
	VFI VehicleFleetType
}

VehicleFleetIdentification represents I062/300 - Vehicle Fleet Identification. Vehicle fleet/type identification. Format: 1-octet fixed length

func DecodeVehicleFleetIdentification

func DecodeVehicleFleetIdentification(data []byte) (*VehicleFleetIdentification, error)

DecodeVehicleFleetIdentification decodes I062/300 from bytes.

func (*VehicleFleetIdentification) Encode

func (v *VehicleFleetIdentification) Encode() []byte

Encode encodes I062/300 to bytes.

func (*VehicleFleetIdentification) Len

Len returns the encoded length.

type VehicleFleetType

type VehicleFleetType uint8

VehicleFleetType represents the vehicle fleet/type identification.

const (
	VFIUnknown             VehicleFleetType = 0  // Unknown type of vehicle
	VFIATCMaintenance      VehicleFleetType = 1  // ATC equipment maintenance
	VFIAirportMaintenance  VehicleFleetType = 2  // Airport maintenance
	VFIFire                VehicleFleetType = 3  // Fire
	VFIBirdScarer          VehicleFleetType = 4  // Bird scarer
	VFISnowPlough          VehicleFleetType = 5  // Snow plough
	VFIRunwaySweeper       VehicleFleetType = 6  // Runway sweeper
	VFIEmergency           VehicleFleetType = 7  // Emergency
	VFIPolice              VehicleFleetType = 8  // Police
	VFIBus                 VehicleFleetType = 9  // Bus
	VFITug                 VehicleFleetType = 10 // Tug (push/tow)
	VFIGrassCutter         VehicleFleetType = 11 // Grass cutter
	VFIFuel                VehicleFleetType = 12 // Fuel
	VFIBaggage             VehicleFleetType = 13 // Baggage
	VFICatering            VehicleFleetType = 14 // Catering
	VFIAircraftMaintenance VehicleFleetType = 15 // Aircraft maintenance
	VFIFlyco               VehicleFleetType = 16 // Flyco (follow me)
)

func (VehicleFleetType) String

func (v VehicleFleetType) String() string

String returns a human-readable description of the vehicle type.

type VerticalRate

type VerticalRate uint8

VerticalRate indicates the vertical rate state.

const (
	VertLevel        VerticalRate = 0 // Level
	VertClimb        VerticalRate = 1 // Climb
	VertDescent      VerticalRate = 2 // Descent
	VertUndetermined VerticalRate = 3 // Undetermined
)

Jump to

Keyboard shortcuts

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