Documentation
¶
Overview ¶
Package aftn implements the Aeronautical Fixed Telecommunication Network message envelope: the network air traffic services talk over, and Type B's cousin -- the same telegraph heritage, a different address plan.
The format is specified, not inferred: ICAO Annex 10 Volume II chapter 4 is public. A message is a heading (the start-of-message signal ZCZC and a transmission identification), an address line (a two-letter priority indicator and up to twenty-one eight-letter addressee indicators), an origin line (a six-figure filing time and the eight-letter originator indicator), the text, and the end-of-message signal NNNN. Annex 10's own page-copy example is the fixture this package is tested against:
ZCZC LPA183 GG LGGGZRZX LGATKLMW 201838 EGLLKLMW (text) NNNN
An addressee indicator is an ICAO location indicator (four letters), a three-letter designator for the organisation or unit, and a filler or department letter. Priorities are SS distress, DD urgency, FF flight safety, GG meteorological, flight regularity and aeronautical information, KK administrative. A message may not exceed 2 100 characters from ZCZC to NNNN inclusive.
Index ¶
Constants ¶
const MaxAddressees = 21
MaxAddressees is the most addressee indicators one transmission carries.
const MaxLength = 2100
MaxLength is the character limit from ZCZC to NNNN inclusive.
Variables ¶
This section is empty.
Functions ¶
func Looks ¶
Looks reports whether raw bytes carry an AFTN message: an address line in the AFTN form within the first lines, after an optional ZCZC heading.
func ValidIndicator ¶
ValidIndicator reports whether s is a well-formed addressee or originator indicator.
Types ¶
type EncodeOptions ¶
type EncodeOptions struct {
// CRLF ends lines with carriage return and line feed, as a teleprinter
// circuit expects; the default is a bare line feed.
CRLF bool
}
EncodeOptions control rendering.
type Message ¶
type Message struct {
// TransmissionID is the circuit identification and channel sequence
// number from the heading, e.g. LPA183. Empty when the heading carried
// none, which a message handed straight to a terminal may.
TransmissionID string
Priority Priority
Addressees []string
// FilingTime is the six-figure date-time group DDHHMM.
FilingTime string
Originator string
// Text is the message text with line endings normalised to "\n".
Text string
}
Message is one AFTN message.