Documentation ¶
Overview ¶
Package sbs provides a parser for SBS-1 CSV format data otherwise known as "SBS-1 BaseStation Port 30003" format.
The SBS-1 data format was developed, it seems, by Kinetic Avionics Limited for the BaseStation SDR product. This library, like pretty much every other, takes most of its understanding of the data format from http://woodair.net/SBS/Article/Barebones42_Socket_Data.htm
The dump1090 bits come from code diving dump1090-fa, the actively maintained (but not very well documented imnsho) fork of dump1090 by FlightAware. https://github.com/flightaware/dump1090
This code is copyright Matt Cashner (sungo). Licensed under BSD-3-Clause.
Index ¶
Constants ¶
const ( // SelectionChange is message type "SEL", aka "Selection Change", // "generated when the user changes the selected aircraft". This field is // specific to the BaseStation software and not used by dump1090-fa SelectionChange = iota // NewID is message type "ID", aka "Mew ID Message", "generated when // an aircraft being tracked sets or changes its callsign". Unused by // dump1090-fa NewID // NewAircraft is message type "AIR", aka "New Aircraft Message", // "generated when a signal is picked up for a previously untracked // aircraft". Unused by dump1090-fa NewAircraft // StatusChange is message type "STA", aka "Status Change Message", // "generated when an aircraft's status changes". Unused by dump1090-fa StatusChange // Click is message type "CLK", aka "Click Message", used by // BaseStation to indicate a user clicked on an aircraft. Unused by // dump1090-fa Click // Transmission is message type "MSG", aka "Transmission Message", // generated by the aircraft. Transmission )
These constants correspond to different Message Types
const ( // ESIdentify is TransmissionType "ES Identification and Category" ESIdentify // ESSurfacePosition is TransmissionType "ES Surface Position Message", // "triggered by nose gear squat switch" ESSurfacePosition // ESAirbornePosition is TransmissionType "ES Airborne Position Message" ESAirbornePosition // ESAirborneVelocity is TransmissionType "ES Airborne Velocity Message" ESAirborneVelocity // SurveillanceAlt is TransmissionType "Surveillance Alt Message", // "triggered by ground radar" // Will only be output if the aircraft has previously sent ESIdentify, // ESSurfacePosition, ESAirbornePosition, ESAirborneVelocity, or // AllCallReply SurveillanceAlt // SurveillanceID is TransmissionType "Surveillance ID Message", "triggered // by ground radar", Will only be output if the aircraft has previously // sent ESIdentify, ESSurfacePosition, ESAirbornePosition, // ESAirborneVelocity, or AllCallReply SurveillanceID // AirToAir is TransmissionType "Air to Air Message", "triggered from TCAS" AirToAir // AllCallReply is TransmissionType "All Call Reply", "broadcast but also // triggered by ground radar" AllCallReply )
These constants correspond to different Transmission Types
const Unknown = -1
Unknown indicates an unknown value. Used in both MessageType, and TransmissionType fields
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SBS ¶
type SBS struct { MessageType int TransmissionType int SessionID int // With dump1090, this is always 1 AircraftID int // With dump1090, this is always 1 HexIdent string // Aircraft Mode S hexadecimal code FlightID int // With dump1090, this is always 1 TimeGenerated time.Time // Protocol does not contain timezone data TimeLogged time.Time // Protocol does not contain timezone data CallSign string // Eight digit flight ID. Can be anything at all Altitude int // Mode C altitude. Height relative to 1013.2mb (Flight Level). Not height AMSL. GroundSpeed float64 Track float64 // In dump1090, this is the aircraft's heading. Elsewhere, the track of the craft derived from the velocity E/W and velocity N/S Latitude float64 Longitude float64 VerticalRate int Squawk string // Assigned Mode A Squawk code SquawkChangeAlert Trinary // Flag to indicate the squawk has changed Emergency Trinary // Flag to indicate the emergency code has been set SPI Trinary // Flag to indicate the transponder ident has been activated IsOnGround Trinary // Flag to indicate the ground squat switch is active }
SBS represents a single SBS-1 datagram
func (*SBS) MessageTypeAsString ¶
MessageTypeAsString renders the MessageType field in a human-friendly string
func (*SBS) TransmissionTypeAsString ¶
TransmissionTypeAsString converts the TransmissionType field into a human-friendly string