CroatiaControlLtd / asterix

Asterix is utility used to read and parse EUROCONTROL ASTERIX protocol data from stdin, file or network multicast stream and print it to standard output in text, XML or JSON format. Source can be used to generate Wireshark dissector for ASTERIX protocol. All ASTERIX categories are defined through XML definition file.
GNU General Public License v2.0
169 stars 90 forks source link

Problems with Cat 011 binary data items #112

Closed georglysen closed 4 years ago

georglysen commented 4 years ago

Some data items in the Cat 011 spec are defined as binary data (e.g. '00b'), which does not seem to be supported. I've changed them all to unsigned integers instead.

I also made a small fix in data item 430 that is using the wrong number of bits. All changes included in the xml below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Category SYSTEM "asterix.dtd">

<!--

    Asterix Category 011 v1.2 definition

    Author:   N.Lagesson
    Created:  2019-10-15
    Modified: 16.10.2019. (dsalantic) Added BDS register definition in I380

-->

<Category id="11" name="Transmission of A-SMGCS Data" ver="1.2">
    <DataItem id="000" rule="mandatory">
        <DataItemName>Message Type</DataItemName>
        <DataItemDefinition>This data item allows for a more convenient handling of the messages at the receiver side by further defining the type of transaction.</DataItemDefinition>
        <DataItemFormat desc="One-octet fixed length Data Item.">
            <Fixed length="1">
                <Bits from="8" to="1">
                    <BitsShortName>MsgTyp</BitsShortName>
                    <BitsName>Type of msg.</BitsName>
                    <BitsValue val="1">Target reports, flight plan data and basic alerts</BitsValue>
                    <BitsValue val="2">Manual attachment of flight plan to track</BitsValue>
                    <BitsValue val="3">Manual detachment of flight plan to track</BitsValue>
                    <BitsValue val="4">Insertion of flight plan data</BitsValue>
                    <BitsValue val="5">Suppression of flight plan data</BitsValue>
                    <BitsValue val="6">Modification of flight plan data</BitsValue>
                    <BitsValue val="7">Holdbar status</BitsValue>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>
    <DataItem id="010" rule="mandatory">
        <DataItemName>Data Source Identifier</DataItemName>
        <DataItemDefinition>Identification of the system from which the data are received.</DataItemDefinition>
        <DataItemFormat desc="Two-octet fixed length Data Item.">
            <Fixed length="2">
                <Bits from="16" to="9">
                    <BitsShortName>SAC</BitsShortName>
                    <BitsName>System Area Code fixed to zero</BitsName>
                </Bits>
                <Bits from="8" to="1">
                    <BitsShortName>SIC</BitsShortName>
                    <BitsName>System Identification Code</BitsName>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>
    <DataItem id="015" rule="mandatory">
        <DataItemName>Data Source Identifier</DataItemName>
        <DataItemDefinition>Identification of the system from which the data are received.</DataItemDefinition>
        <DataItemFormat desc="One-octet fixed length Data Item.">
            <Fixed length="1">
                <Bits from="8" to="1">
                    <BitsShortName>SI</BitsShortName>
                    <BitsName>the service identification is allocated by the A-SMGCS</BitsName>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="041" rule="mandatory">
        <DataItemName>Position in WGS-84 Coordinates</DataItemName>
        <DataItemDefinition>Position of a target in WGS-84 Coordinates.</DataItemDefinition>
        <DataItemFormat desc="Eight-octet fixed length Data Item">
            <Fixed length="8">
                <Bits from="64" to="33" encode="signed">
                    <BitsShortName>Lat</BitsShortName>
                    <BitsName>Latitude in WGS-84 in twos complement.</BitsName>
                    <BitsUnit scale="0.00000008381903171539306640625" min="-90" max="90">deg</BitsUnit>
                </Bits>
                <Bits from="32" to="1" encode="signed">
                    <BitsShortName>Lon</BitsShortName>
                    <BitsName>Longitude in WGS-84 in twos complement.</BitsName>
                    <BitsUnit scale="0.00000008381903171539306640625" min="-180" max="180">deg</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="042" rule="optional">
        <DataItemName>Calculated Position in Cartesian Co-ordinates</DataItemName>
        <DataItemDefinition>Position of a target in Cartesian co-ordinates (two’s complement form)</DataItemDefinition>
        <DataItemFormat desc="Four-octet fixed length Data Item.">
            <Fixed length="4">
                <Bits from="32" to="17" encode="signed">
                    <BitsShortName>X</BitsShortName>
                    <BitsName>X</BitsName>
                    <BitsUnit scale="1" min="-32768" max="32768">m</BitsUnit>
                </Bits>
                <Bits from="16" to="1" encode="signed">
                    <BitsShortName>Y</BitsShortName>
                    <BitsName>Y</BitsName>
                    <BitsUnit scale="1" min="-32768" max="32768">m</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="060" rule="optional">
        <DataItemName>Mode-3/A Code in Octal Representation</DataItemName>
        <DataItemDefinition>Mode-3/A code converted into octal representation.</DataItemDefinition>
        <DataItemFormat desc="Two-octet fixed length Data Item.">
            <Fixed length="2">
                <Bits from="16" to="13">
                    <BitsShortName>spare</BitsShortName>
                    <BitsName>Spare bit set to 0</BitsName>
                    <BitsConst>0</BitsConst>
                </Bits>
                <Bits from="12" to="1" encode="octal">
                    <BitsShortName>Mod3A</BitsShortName>
                    <BitsName>Mode-3/A reply in octal representation</BitsName>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="090">
        <DataItemName>Measured Flight Level</DataItemName>
        <DataItemDefinition>Last valid and credible flight level used to update the track, in two’s complement representation.</DataItemDefinition>
        <DataItemFormat desc="Two-octet fixed length Data Item.">
            <Fixed length="2">
                <Bits from="16" to="1" encode="signed">
                    <BitsShortName>MFL</BitsShortName>
                    <BitsName>Measured Flight Level</BitsName>
                    <BitsUnit scale="0.25">FL</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="092" rule="optional">
        <DataItemName>Calculated Track Geometric Altitude</DataItemName>
        <DataItemDefinition>Calculated Track Geometric Altitude Calculated geometric vertical distance above mean sea level, not related to barometric pressure.</DataItemDefinition>
        <DataItemFormat desc="Two-octet fixed length Data Item.">
            <Fixed length="2">
                <Bits from="16" to="1" encode="signed">
                    <BitsShortName>CTGA</BitsShortName>
                    <BitsName>Calculated Track Geometric Altitude</BitsName>
                    <BitsUnit scale="6.25" min="-1500" max="150000">ft</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="093" rule="optional">
        <DataItemName>Calculated Track Barometric Altitude</DataItemName>
        <DataItemDefinition>Calculated Barometric Altitude of the track.</DataItemDefinition>
        <DataItemFormat desc="One-Octet fixed length data item.">
            <Fixed length="2">
                <Bits bit="16">
                    <BitsShortName>QNH</BitsShortName>
                    <BitsName>Primary Plot Amplitude</BitsName>
                    <BitsValue val="0">No QNH correction applied</BitsValue>
                    <BitsValue val="1">QNH correction applied</BitsValue>
                </Bits>
                <Bits from="15" to="1">
                    <BitsShortName>CalcQNH</BitsShortName>
                    <BitsName>Calculated Track Barometric Altitude</BitsName>
                    <BitsUnit scale="0.25" min="-15" max="1500">ft</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="140" rule="mandatory">
        <DataItemName>Time of Track Information</DataItemName>
        <DataItemDefinition>Absolute time stamping expressed as UTC.</DataItemDefinition>
        <DataItemFormat desc="Three-octet fixed length Data Item.">
            <Fixed length="3">
                <Bits from="24" to="1">
                    <BitsShortName>ToTI</BitsShortName>
                    <BitsName>Time of Track Information</BitsName>
                    <BitsUnit scale="0.0078125">s</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="161" rule="optional">
        <DataItemName>Track Number</DataItemName>
        <DataItemDefinition>Identification of a fusion track (single track number)</DataItemDefinition>
        <DataItemFormat desc="Two-octet fixed length Data Item.">
            <Fixed length="2">
                <Bits bit="16">
                    <BitsShortName>spare</BitsShortName>
                    <BitsName>Spare bits set to zero</BitsName>
                    <BitsConst>0</BitsConst>
                </Bits>
                <Bits from="15" to="1">
                    <BitsShortName>FTN</BitsShortName>
                    <BitsName>Fusion Track Number</BitsName>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="170" rule="optional">
        <DataItemName>Track Status</DataItemName>
        <DataItemDefinition>Status of track.</DataItemDefinition>
        <DataItemFormat desc="Variable length Data Item comprising a first part of one-octet, followed by one-octet extents as necessary.">
            <Variable>
                <Fixed length="1">
                    <Bits bit="8">
                        <BitsShortName>MON</BitsShortName>
                        <BitsValue val="0">Multisensor Track</BitsValue>
                        <BitsValue val="1">Monosensor Track</BitsValue>
                    </Bits>
                    <Bits bit="7">
                        <BitsShortName>GBS</BitsShortName>
                        <BitsValue val="0">Transponder Ground bit not set or unknown</BitsValue>
                        <BitsValue val="1">Transponder Ground bit set</BitsValue>
                    </Bits>
                    <Bits bit="6">
                        <BitsShortName>MRH</BitsShortName>
                        <BitsValue val="0">Barometric altitude (Mode C) more reliable</BitsValue>
                        <BitsValue val="1">Geometric altitude more reliable</BitsValue>
                    </Bits>
                    <Bits from="5" to="3" encode="unsigned">
                        <BitsShortName>SRC</BitsShortName>
                        <BitsValue val="0">no source</BitsValue>
                        <BitsValue val="1">GPS</BitsValue>
                        <BitsValue val="2">3d radar</BitsValue>
                        <BitsValue val="3">triangulation</BitsValue>
                        <BitsValue val="4">height from coverage</BitsValue>
                        <BitsValue val="5">speed look-up table</BitsValue>
                        <BitsValue val="6">default height</BitsValue>
                        <BitsValue val="7">multilateration</BitsValue>
                    </Bits>
                    <Bits bit="2">
                        <BitsShortName>CNF</BitsShortName>
                        <BitsValue val="0">Confirmed track</BitsValue>
                        <BitsValue val="1">Tentative track</BitsValue>
                    </Bits>
                    <Bits bit="1" fx="1">
                        <BitsShortName>FX</BitsShortName>
                        <BitsValue val="0">End of Data Item</BitsValue>
                        <BitsValue val="1">Extension into first extent</BitsValue>
                    </Bits>
                </Fixed>
                <Fixed length="1">
                    <Bits bit="8">
                        <BitsShortName>SIM</BitsShortName>
                        <BitsValue val="0">Actual Track</BitsValue>
                        <BitsValue val="1">Simulated track</BitsValue>
                    </Bits>
                    <Bits bit="7">
                        <BitsShortName>TSE</BitsShortName>
                        <BitsValue val="0">default value</BitsValue>
                        <BitsValue val="1">track service end (i.e. last message transmitted to the user for the track).</BitsValue>
                    </Bits>
                    <Bits bit="6">
                        <BitsShortName>TSB</BitsShortName>
                        <BitsValue val="0">default value</BitsValue>
                        <BitsValue val="1">track service begin (i.e. first message transmitted to the user for the track)</BitsValue>
                    </Bits>
                    <Bits from="5" to="4" encode="unsigned">
                        <BitsShortName>FRI/FOE</BitsShortName>
                        <BitsValue val="0">No Mode 4 interrogationt</BitsValue>
                        <BitsValue val="1">Friendly target</BitsValue>
                        <BitsValue val="2">Unknown target</BitsValue>
                        <BitsValue val="3">No reply</BitsValue>

                    </Bits>
                    <Bits bit="3">
                        <BitsShortName>ME</BitsShortName>
                        <BitsValue val="0">default value</BitsValue>
                        <BitsValue val="1">Military Emergency present in the last report received from a sensor capable of decoding this data</BitsValue>
                    </Bits>
                    <Bits bit="2">
                        <BitsShortName>MI</BitsShortName>
                        <BitsValue val="0">End of Data Item</BitsValue>
                        <BitsValue val="1">Military Identification present in the last report received from a sensor capable of decoding this data</BitsValue>
                    </Bits>
                    <Bits bit="1" fx="1">
                        <BitsShortName>FX</BitsShortName>
                        <BitsValue val="0">End of Data Item</BitsValue>
                        <BitsValue val="1">Extension into second extent</BitsValue>
                    </Bits>
                </Fixed>
                <Fixed length="1">
                    <Bits bit="8">
                        <BitsShortName>AMA</BitsShortName>
                        <BitsValue val="0">track not resulting from amalgamation process</BitsValue>
                        <BitsValue val="1">track resulting from amalgamation process</BitsValue>
                    </Bits>
                    <Bits bit="7">
                        <BitsShortName>SPI</BitsShortName>
                        <BitsValue val="0">default value</BitsValue>
                        <BitsValue val="1">SPI present in the last report received from a sensor capable of decoding this data</BitsValue>
                    </Bits>
                    <Bits bit="6">
                        <BitsShortName>CST</BitsShortName>
                        <BitsValue val="0">default value</BitsValue>
                        <BitsValue val="1">Age of the last received track update is higher than system dependent threshold (coasting)</BitsValue>
                    </Bits>
                    <Bits bit="5">
                        <BitsShortName>FPC</BitsShortName>
                        <BitsValue val="0">Not flight-plan correlated</BitsValue>
                        <BitsValue val="1">Flight plan correlated</BitsValue>
                    </Bits>
                    <Bits bit="4">
                        <BitsShortName>AFF</BitsShortName>
                        <BitsValue val="0">default value</BitsValue>
                        <BitsValue val="1">ADS-B data inconsistent with other surveillance information</BitsValue>
                    </Bits>
                    <Bits from="3" to="2">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to zero</BitsName>
                        <BitsConst>0</BitsConst>
                    </Bits>
                    <Bits bit="1" fx="1">
                        <BitsShortName>FX</BitsShortName>
                        <BitsValue val="0">End of Data Item</BitsValue>
                        <BitsValue val="1">Extension into second extent</BitsValue>
                    </Bits>
                </Fixed>
            </Variable>
        </DataItemFormat>
    </DataItem>

    <DataItem id="202" rule="optional">
        <DataItemName>Calculated Track Velocity in Cartesian Coordinates</DataItemName>
        <DataItemDefinition>Calculated track velocity expressed in Cartesian co-ordinates.</DataItemDefinition>
        <DataItemFormat desc="Four-octet fixed length Data Item.">
            <Fixed length="4">
                <Bits from="32" to="17" encode="signed">
                    <BitsShortName>Vx</BitsShortName>
                    <BitsName>Vx</BitsName>
                    <BitsUnit scale="0.25" min="-8192" max="8192">m/s</BitsUnit>
                </Bits>
                <Bits from="16" to="1" encode="signed">
                    <BitsShortName>Vy</BitsShortName>
                    <BitsName>Vy</BitsName>
                    <BitsUnit scale="0.25" min="-8192" max="8192">m/s</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="210" rule="optional">
        <DataItemName>Calculated Acceleration</DataItemName>
        <DataItemDefinition>Calculated Acceleration of the target, in two’s complement form.</DataItemDefinition>
        <DataItemFormat desc="Two-Octet fixed length data item.">
            <Fixed length="2">
                <Bits from="16" to="9" encode="signed">
                    <BitsShortName>Ax</BitsShortName>
                    <BitsName>Ax</BitsName>
                    <BitsUnit scale="0.25" min="-31" max="31">m/s²</BitsUnit>
                </Bits>
                <Bits from="8" to="1" encode="signed">
                    <BitsShortName>Ay</BitsShortName>
                    <BitsName>Ay</BitsName>
                    <BitsUnit scale="0.25" min="-31" max="31">m/s²</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="215" rule="optional">
        <DataItemName>Calculated Rate Of Climb/Descent</DataItemName>
        <DataItemDefinition>Calculated rate of Climb/Descent of an aircraft, in two's complement form.</DataItemDefinition>
        <DataItemFormat desc="Two-octet fixed length Data Item.">
            <Fixed length="2">
                <Bits from="16" to="1">
                    <BitsShortName>RoCD</BitsShortName>
                    <BitsName>Rate of Climb/Descent</BitsName>
                    <BitsUnit scale="6.25">ft/min</BitsUnit>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="245" rule="optional">
        <DataItemName>Target Identification</DataItemName>
        <DataItemDefinition>Target (aircraft or vehicle) identification in 8 characters.</DataItemDefinition>
        <DataItemFormat desc="Seven-octet fixed length Data Item.">
            <Fixed length="7">
                <Bits from="56" to="55" encode="unsigned">
                    <BitsShortName>STI</BitsShortName>
                    <BitsValue val="0">Callsign or registration downlinked from transponde</BitsValue>
                    <BitsValue val="1">Callsign not downlinked from transponder</BitsValue>
                    <BitsValue val="2">Registration not downlinked from transponder</BitsValue>
                </Bits>
                <Bits from="54" to="49">
                    <BitsShortName>spare</BitsShortName>
                    <BitsName>Spare bits set to zero</BitsName>
                    <BitsConst>0</BitsConst>
                </Bits>
                <Bits from="48" to="1" encode="6bitschar">
                    <BitsShortName>TId</BitsShortName>
                    <BitsName>Characters 1-8 (coded on 6 bits each) defining target identification</BitsName>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

     <DataItem id="270" rule="optional">
        <DataItemName>Target Size and Orientation</DataItemName>
        <DataItemDefinition>Target size defined as length and with of the detected target, and orientation.</DataItemDefinition>
        <DataItemFormat desc="Variable Data Item, comprising a first part of one octet, followed by one-octed as necessary.">
            <Variable>
                <Fixed length="1">
                    <Bits from="8" to="2">
                        <BitsShortName>Length</BitsShortName>
                        <BitsName>Length</BitsName>
                        <BitsUnit scale="1">m</BitsUnit>
                    </Bits>
                    <Bits bit="1" fx="1">
                        <BitsShortName>FX</BitsShortName>
                        <BitsName>Extension Indicator</BitsName>
                        <BitsValue val="0">End of Data Item</BitsValue>
                        <BitsValue val="1">Extension into next extent</BitsValue>
                    </Bits>
                </Fixed>
                <Fixed length="1">
                    <Bits from="8" to="2">
                        <BitsShortName>Ori</BitsShortName>
                        <BitsName>Orientation</BitsName>
                        <BitsUnit scale="2.81">deg.</BitsUnit>
                    </Bits>
                    <Bits bit="1" fx="1">
                        <BitsShortName>FX</BitsShortName>
                        <BitsName>Extension Indicator</BitsName>
                        <BitsValue val="0">End of Data Item</BitsValue>
                        <BitsValue val="1">Extension into next extent</BitsValue>
                    </Bits>
                </Fixed>
                <Fixed length="1">
                    <Bits from="8" to="2">
                        <BitsShortName>Width</BitsShortName>
                        <BitsName>Width</BitsName>
                        <BitsUnit scale="1">m</BitsUnit>
                    </Bits>
                    <Bits bit="1" fx="1">
                        <BitsShortName>FX</BitsShortName>
                        <BitsName>Extension Indicator</BitsName>
                        <BitsValue val="0">End of Data Item</BitsValue>
                        <BitsValue val="1">Extension into next extent</BitsValue>
                    </Bits>
                </Fixed>
            </Variable>
        </DataItemFormat>
    </DataItem>

     <DataItem id="290" rule="optional">
        <DataItemName>System Track Update Ages</DataItemName>
        <DataItemDefinition>Ages of the last plot/local track, or the last valid mode-A/mode-C, used to update the system track.</DataItemDefinition>
        <DataItemFormat desc="Compound Data Item, comprising a primary subfield of up to two octets, followed by the indicated subfields.">
            <Compound>
                <Variable>
                    <Fixed length="1">
                        <Bits bit="8">
                            <BitsShortName>PSR</BitsShortName>
                            <BitsName>PSR age</BitsName>
                            <BitsPresence>1</BitsPresence>
                        </Bits>
                        <Bits bit="7">
                            <BitsShortName>SSR</BitsShortName>
                            <BitsName>SSR age</BitsName>
                            <BitsPresence>2</BitsPresence>
                        </Bits>
                        <Bits bit="6">
                            <BitsShortName>Mda</BitsShortName>
                            <BitsName>Mode A age</BitsName>
                            <BitsPresence>3</BitsPresence>
                        </Bits>
                        <Bits bit="5">
                            <BitsShortName>MFL</BitsShortName>
                            <BitsName>Measure flight level age</BitsName>
                            <BitsPresence>4</BitsPresence>
                        </Bits>
                        <Bits bit="4">
                            <BitsShortName>Mds</BitsShortName>
                            <BitsName>Mode S age</BitsName>
                            <BitsPresence>5</BitsPresence>
                        </Bits>
                        <Bits bit="3">
                            <BitsShortName>Ads</BitsShortName>
                            <BitsName>ADS age</BitsName>
                            <BitsPresence>6</BitsPresence>
                        </Bits>
                        <Bits bit="2">
                            <BitsShortName>Adb</BitsShortName>
                            <BitsName>Ads b age</BitsName>
                            <BitsPresence>7</BitsPresence>
                        </Bits>
                        <Bits bit="1" fx="1">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsValue val="0">no extension</BitsValue>
                            <BitsValue val="1">extension</BitsValue>
                        </Bits>
                    </Fixed>
                    <Fixed length="1">
                        <Bits bit="8">
                            <BitsShortName>MD1</BitsShortName>
                            <BitsName>Mode 1 age</BitsName>
                            <BitsPresence>8</BitsPresence>
                        </Bits>
                        <Bits bit="7">
                            <BitsShortName>MD2</BitsShortName>
                            <BitsName>Mode 2 age</BitsName>
                            <BitsPresence>9</BitsPresence>
                        </Bits>
                        <Bits bit="6">
                            <BitsShortName>LOP</BitsShortName>
                            <BitsName>Loop age</BitsName>

                        </Bits>
                        <Bits bit="5">
                            <BitsShortName>MUL</BitsShortName>
                            <BitsName>Multilateration age</BitsName>

                        </Bits>
                        <Bits bit="4">
                            <BitsShortName>LOP</BitsShortName>
                            <BitsName>Loop age</BitsName>

                        </Bits>
                        <Bits from="3" to="2">
                            <BitsShortName>spare</BitsShortName>
                            <BitsName>Spare bits set to 0</BitsName>
                        </Bits>
                        <Bits bit="1" fx="1">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsValue val="0">no extension</BitsValue>
                            <BitsValue val="1">extension</BitsValue>
                        </Bits>
                    </Fixed>
                </Variable>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>PSR</BitsShortName>
                        <BitsName>Age of the last primary detection used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>SSR</BitsShortName>
                        <BitsName>Age of the last secondary detection used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>MDA</BitsShortName>
                        <BitsName>Age of the last Mode A detection used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>MFL</BitsShortName>
                        <BitsName>Age of the last Mode C detection used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>MDS</BitsShortName>
                        <BitsName>Age of the last Mode S detection used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="2">
                    <Bits from="16" to="1">
                        <BitsShortName>ADS</BitsShortName>
                        <BitsName>Age of the last ADS report used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>ADB</BitsShortName>
                        <BitsName>Age of the last ADS-B report used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>MD1</BitsShortName>
                        <BitsName>Age of the last valid Mode 1 used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>MD2</BitsShortName>
                        <BitsName>Age of the last Mode 2 used to update the track</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>LOP</BitsShortName>
                        <BitsName>Age of the last magentic loop detection</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>MLT</BitsShortName>
                        <BitsName>Age of the last MLT detection </BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>TRK</BitsShortName>
                        <BitsName>Actual track age since first occurrence</BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>MUL</BitsShortName>
                        <BitsName>Age of the last multilateration detection </BitsName>
                        <BitsUnit scale="0.25">sec</BitsUnit>                       
                    </Bits>
                </Fixed>

            </Compound>
        </DataItemFormat>
    </DataItem> 

    <DataItem id="300" rule="optional">
        <DataItemName>Vehicle Fleet Identification</DataItemName>
        <DataItemDefinition>Vehicle fleet identification number.</DataItemDefinition>
        <DataItemFormat desc="One octet fixed length Data Item.">
            <Fixed length="1">
                <Bits from="8" to="1">
                    <BitsShortName>VFI</BitsShortName>
                    <BitsName>Vehicle Fleet Identification</BitsName>
                    <BitsValue val="0">Flyco (follow me)</BitsValue>
                    <BitsValue val="1">ATC equipment maintenance</BitsValue>
                    <BitsValue val="2">Airport maintenance</BitsValue>
                    <BitsValue val="3">Fire</BitsValue>
                    <BitsValue val="4">Bird scarer</BitsValue>
                    <BitsValue val="5">Snow plough</BitsValue>
                    <BitsValue val="6">Runway sweeper</BitsValue>
                    <BitsValue val="7">Emergency</BitsValue>
                    <BitsValue val="8">Police</BitsValue>
                    <BitsValue val="9">Bus</BitsValue>
                    <BitsValue val="10">Tug (push/tow)</BitsValue>
                    <BitsValue val="11">Grass cutter</BitsValue>
                    <BitsValue val="12">Fuel</BitsValue>
                    <BitsValue val="13">Baggage</BitsValue>
                    <BitsValue val="14">Catering</BitsValue>
                    <BitsValue val="15">Aircraft maintenance</BitsValue>
                    <BitsValue val="16">Unknown</BitsValue>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="310" rule="optional">
        <DataItemName>Pre-programmed Message</DataItemName>
        <DataItemDefinition>Number related to a pre-programmed message that can be transmitted by a vehicle.</DataItemDefinition>
        <DataItemFormat desc="One octet fixed length Data Item.">
            <Fixed length="1">
                <Bits bit="8">
                    <BitsShortName>TRB</BitsShortName>
                    <BitsValue val="0">Default</BitsValue>
                    <BitsValue val="1">In Trouble</BitsValue>
                </Bits>
                <Bits from="7" to="1">
                    <BitsShortName>MSG</BitsShortName>
                    <BitsValue val="1">Towing aircraft</BitsValue>
                    <BitsValue val="2">"Follow me" operation</BitsValue>
                    <BitsValue val="3">Runway check</BitsValue>
                    <BitsValue val="4">Emergency operation (fire, medical...)</BitsValue>
                    <BitsValue val="5">Work in progress (maintenance, birds scarer, sweepers...)</BitsValue>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="380" rule="optional">
        <DataItemName>Mode-S / ADS-B Related Data</DataItemName>
        <DataItemDefinition>Data specific to Mode-S / ADS-B.</DataItemDefinition>
        <DataItemFormat desc="Compound Data Item, comprising a primary subfield of two octets, followed by up to 11 subfields.">
            <Compound>
                <Variable>
                    <Fixed length="2">
                        <Bits bit="16">
                            <BitsShortName>MB</BitsShortName>
                            <BitsName>Mode S MB Data</BitsName>
                            <BitsPresence>1</BitsPresence>
                        </Bits>
                        <Bits bit="15">
                            <BitsShortName>ADR</BitsShortName>
                            <BitsName>Aircraft Address</BitsName>
                            <BitsPresence>2</BitsPresence>
                        </Bits>
                        <Bits bit="14">
                            <BitsShortName>spare</BitsShortName>
                            <BitsName>Spare bits set to 0</BitsName>
                        </Bits>
                        <Bits bit="13">
                            <BitsShortName>COM</BitsShortName>
                            <BitsName>Communications / ACAS Capability and Flight Status</BitsName>
                            <BitsPresence>3</BitsPresence>
                        </Bits>
                        <Bits from="12" to="10">
                            <BitsShortName>spare</BitsShortName>
                            <BitsName>Spare bits set to 0</BitsName>
                        </Bits>
                        <Bits bit="9">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsPresence>4</BitsPresence>
                        </Bits>
                        <Bits bit="8">
                            <BitsShortName>ACT</BitsShortName>
                            <BitsName>Aircraft Derived Aircraft Type</BitsName>
                            <BitsPresence>5</BitsPresence>
                        </Bits>
                        <Bits bit="7">
                            <BitsShortName>EMC</BitsShortName>
                            <BitsName>Emitter category</BitsName>
                            <BitsPresence>6</BitsPresence>
                        </Bits>
                        <Bits bit="6">
                            <BitsShortName>spare</BitsShortName>
                            <BitsName>Spare bits set to 0</BitsName>
                        </Bits>
                        <Bits bit="5">
                            <BitsShortName>ATC</BitsShortName>
                            <BitsName>Available Technologies</BitsName>
                            <BitsPresence>7</BitsPresence>
                        </Bits>
                        <Bits from="4" to="2">
                            <BitsShortName>spare</BitsShortName>
                            <BitsName>Spare bits set to 0</BitsName>
                        </Bits>
                        <Bits bit="1" fx="1">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsValue val="0">no extension</BitsValue>
                            <BitsValue val="1">extension</BitsValue>
                        </Bits>
                    </Fixed>
                </Variable>

                <Repetitive>
                    <BDS/>
                </Repetitive>

                <Fixed length="3">
                    <Bits from="24" to="1">
                        <BitsShortName>AircraftAdress</BitsShortName>
                        <BitsName>24 bits Aircraft address, A23 to A0 </BitsName>

                    </Bits>
                </Fixed>

                <Fixed length="3">
                    <Bits from="24" to="22">
                        <BitsShortName>COM</BitsShortName>
                        <BitsName>Communications capability of the transponder</BitsName>
                        <BitsValue val="0">No communications capability (surveillance only)</BitsValue>
                        <BitsValue val="1">Comm. A and Comm. B capability</BitsValue>
                        <BitsValue val="2">Comm. A, Comm. B and Uplink ELM</BitsValue>
                        <BitsValue val="3">Comm. A, Comm. B, Uplink ELM and Downlink ELM</BitsValue>
                        <BitsValue val="4">Level 5 Transponder capability</BitsValue>
                        <BitsValue val="5">Not assigned</BitsValue>
                        <BitsValue val="6">Not assigned</BitsValue>
                        <BitsValue val="7">Not assigned</BitsValue>
                    </Bits>
                    <Bits from="21" to="18">
                        <BitsShortName>STAT</BitsShortName>
                        <BitsName>Flight Status</BitsName>
                            <BitsValue val="0">No alert, no SPI, aircraft airborne</BitsValue>
                            <BitsValue val="1">No alert, no SPI, aircraft on ground</BitsValue>
                            <BitsValue val="2">Alert, no SPI, aircraft airborne</BitsValue>
                            <BitsValue val="3">Alert, no SPI, aircraft on ground</BitsValue>
                            <BitsValue val="4">Alert, SPI, aircraft airborne or on ground</BitsValue>
                            <BitsValue val="5">No alert, SPI, aircraft airborne or on ground</BitsValue>
                            <BitsValue val="6">General Emergency</BitsValue>
                            <BitsValue val="7"> Lifeguard / medical</BitsValue>
                            <BitsValue val="8">Minimum fuel</BitsValue>
                            <BitsValue val="9">No communications</BitsValue>
                            <BitsValue val="10">Unlawful</BitsValue>
                    </Bits>
                    <Bits bit="17">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>
                    <Bits bit="16">
                        <BitsShortName>SSC</BitsShortName>
                        <BitsName>Specific service capability</BitsName>
                        <BitsValue val="0">No</BitsValue>
                        <BitsValue val="1">Yes</BitsValue>
                    </Bits>
                    <Bits bit="15">
                        <BitsShortName>ARC</BitsShortName>
                        <BitsName>Altitude reporting capability</BitsName>
                            <BitsValue val="0">100 ft resolution</BitsValue>
                            <BitsValue val="1">25 ft resolution</BitsValue>
                    </Bits>
                    <Bits bit="14">
                        <BitsShortName>AIC</BitsShortName>
                        <BitsName>Aircraft identification capability</BitsName>
                        <BitsValue val="0">No</BitsValue>
                        <BitsValue val="1">Yes</BitsValue>
                    </Bits>
                    <Bits bit="13">
                        <BitsShortName>B1A</BitsShortName>
                        <BitsName>BDS 1,0 bit 16</BitsName>
                    </Bits>
                    <Bits from="12" to="9">
                        <BitsShortName>B1B</BitsShortName>
                        <BitsName>BDS 1,0 bit 37/40</BitsName>

                    </Bits>
                    <Bits bit="8">
                        <BitsShortName>AC</BitsShortName>
                        <BitsName>ACAS operational</BitsName>
                            <BitsValue val="0">No</BitsValue>
                            <BitsValue val="1">Yes</BitsValue>
                    </Bits>
                    <Bits bit="7">
                        <BitsShortName>MN</BitsShortName>
                        <BitsName>Multiple navigational aids operating</BitsName>
                            <BitsValue val="0">No</BitsValue>
                            <BitsValue val="1">Yes</BitsValue>
                    </Bits>
                    <Bits bit="6">
                        <BitsShortName>DC</BitsShortName>
                        <BitsName>Differential correction</BitsName>
                            <BitsValue val="0">Yes</BitsValue>
                            <BitsValue val="1">No</BitsValue>
                    </Bits>
                    <Bits from="5" to="1">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>
                </Fixed>

                <Fixed length="4">
                    <Bits from="32" to="1" encode="ascii">
                        <BitsShortName>AircraftType</BitsShortName>
                        <BitsName>Aircraft Derived Aircraft Type</BitsName>
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>ECAT</BitsShortName>
                        <BitsName>Emitter category</BitsName>
                            <BitsValue val="1">light aircraft ≤ 7000 kg </BitsValue>
                            <BitsValue val="2">reserved </BitsValue>
                            <BitsValue val="3">7000 kg &lt; medium aircraft &lt; 136000 kg </BitsValue>
                            <BitsValue val="4">reserved </BitsValue>
                            <BitsValue val="5">136000 kg ≤ heavy aircraft </BitsValue>
                            <BitsValue val="6">highly manoeuvrable (5g acceleration capability) and high speed (&gt;400 knots cruise) </BitsValue>
                            <BitsValue val="7">reserved </BitsValue>
                            <BitsValue val="8">reserved </BitsValue>
                            <BitsValue val="9">reserved </BitsValue>
                            <BitsValue val="10">rotocraft </BitsValue>
                            <BitsValue val="11">glider / sailplane </BitsValue>
                            <BitsValue val="12">lighter-than-air </BitsValue>
                            <BitsValue val="13">unmanned aerial vehicle </BitsValue>
                            <BitsValue val="14">space / transatmospheric vehicle </BitsValue>
                            <BitsValue val="15">ultralight / handglider / paraglider </BitsValue>
                            <BitsValue val="16">parachutist / skydiver </BitsValue>
                            <BitsValue val="17">reserved </BitsValue>
                            <BitsValue val="18">reserved </BitsValue>
                            <BitsValue val="19">reserved </BitsValue>
                            <BitsValue val="20">surface emergency vehicle </BitsValue>
                            <BitsValue val="21">surface service vehicle </BitsValue>
                            <BitsValue val="22">fixed ground or tethered obstruction </BitsValue>
                            <BitsValue val="23">reserved </BitsValue>
                            <BitsValue val="24">reserved </BitsValue>
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits bit="8">
                        <BitsShortName>VDL</BitsShortName>
                        <BitsName>VDL</BitsName>
                            <BitsValue val="0">VDL Mode 4 available </BitsValue>
                            <BitsValue val="1">VDL Mode 4 not available </BitsValue>
                    </Bits>

                    <Bits bit="7">
                        <BitsShortName>MDS</BitsShortName>
                        <BitsName>MDS</BitsName>
                            <BitsValue val="0">Mode S available </BitsValue>
                            <BitsValue val="1">Mode S not available </BitsValue>
                    </Bits>

                    <Bits bit="6">
                        <BitsShortName>UAT</BitsShortName>
                        <BitsName>UAT</BitsName>
                            <BitsValue val="0">UAT available </BitsValue>
                            <BitsValue val="1">UAT not available </BitsValue>
                    </Bits>
                        <Bits from="5" to="1">
                            <BitsShortName>spare</BitsShortName>
                            <BitsName>Spare bits set to 0</BitsName>
                     </Bits>
                </Fixed>

            </Compound>
        </DataItemFormat>
    </DataItem>

    <DataItem id="390" rule="optional">
        <DataItemName>Flight Plan Related Data</DataItemName>
        <DataItemDefinition>All flight plan related information.</DataItemDefinition>
        <DataItemFormat desc="Compound Data Item, comprising a primary subfield of two octets, followed by 14 subfields.">
            <Compound>
                <Variable>
                    <Fixed length="1">
                        <Bits bit="8">
                            <BitsShortName>TAG</BitsShortName>
                            <BitsName>FPPS Identification Tag </BitsName>
                            <BitsValue val="0">Absence of Subfield #1</BitsValue>
                            <BitsValue val="1">Presence of Subfield #1</BitsValue>
                            <BitsPresence>1</BitsPresence>
                        </Bits>
                        <Bits bit="7">
                            <BitsShortName>CSN</BitsShortName>
                            <BitsName>Callsign</BitsName>
                            <BitsValue val="0">Absence of Subfield #2</BitsValue>
                            <BitsValue val="1">Presence of Subfield #2</BitsValue>
                            <BitsPresence>2</BitsPresence>
                        </Bits>
                        <Bits bit="6">
                            <BitsShortName>IFI</BitsShortName>
                            <BitsName>IFPS_FLIGHT_ID</BitsName>
                            <BitsValue val="0">Absence of Subfield #3</BitsValue>
                            <BitsValue val="1">Presence of Subfield #3</BitsValue>
                            <BitsPresence>3</BitsPresence>
                        </Bits>
                        <Bits bit="5">
                            <BitsShortName>FCT</BitsShortName>
                            <BitsName>Flight Category</BitsName>
                            <BitsValue val="0">Absence of Subfield #4</BitsValue>
                            <BitsValue val="1">Presence of Subfield #4</BitsValue>
                            <BitsPresence>4</BitsPresence>
                        </Bits>
                        <Bits bit="4">
                            <BitsShortName>TAC</BitsShortName>
                            <BitsName>Type of aircraft</BitsName>
                            <BitsValue val="0">Absence of Subfield #5</BitsValue>
                            <BitsValue val="1">Presence of Subfield #5</BitsValue>
                            <BitsPresence>5</BitsPresence>
                        </Bits>
                        <Bits bit="3">
                            <BitsShortName>WTC</BitsShortName>
                            <BitsName>Wake Turbuluence Category</BitsName>
                            <BitsValue val="0">Absence of Subfield #6</BitsValue>
                            <BitsValue val="1">Presence of Subfield #6</BitsValue>
                            <BitsPresence>6</BitsPresence>
                        </Bits>
                        <Bits bit="2">
                            <BitsShortName>DEP</BitsShortName>
                            <BitsName>Departure Airport</BitsName>
                            <BitsValue val="0">Absence of Subfield #7</BitsValue>
                            <BitsValue val="1">Presence of Subfield #7</BitsValue>
                            <BitsPresence>7</BitsPresence>
                        </Bits>
                        <Bits bit="1" fx="1">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsValue val="0">no extension</BitsValue>
                            <BitsValue val="1">extension</BitsValue>
                        </Bits>
                    </Fixed>
                    <Fixed length="1">
                        <Bits bit="8">
                            <BitsShortName>DST</BitsShortName>
                            <BitsName>Destination Airport</BitsName>
                            <BitsValue val="0">Absence of Subfield #8</BitsValue>
                            <BitsValue val="1">Presence of Subfield #8</BitsValue>
                            <BitsPresence>8</BitsPresence>
                        </Bits>
                        <Bits bit="7">
                            <BitsShortName>RDS</BitsShortName>
                            <BitsName>Runway designation</BitsName>
                            <BitsValue val="0">Absence of Subfield #9</BitsValue>
                            <BitsValue val="1">Presence of Subfield #9</BitsValue>
                            <BitsPresence>9</BitsPresence>
                        </Bits>
                        <Bits bit="6">
                            <BitsShortName>CFL</BitsShortName>
                            <BitsName>Current Cleared Flight Level</BitsName>
                            <BitsValue val="0">Absence of Subfield #10</BitsValue>
                            <BitsValue val="1">Presence of Subfield #10</BitsValue>
                            <BitsPresence>10</BitsPresence>
                        </Bits>
                        <Bits bit="5">
                            <BitsShortName>CTL</BitsShortName>
                            <BitsName>Current Control Position</BitsName>
                            <BitsValue val="0">Absence of Subfield #11</BitsValue>
                            <BitsValue val="1">Presence of Subfield #11</BitsValue>
                            <BitsPresence>11</BitsPresence>
                        </Bits>
                        <Bits bit="4">
                            <BitsShortName>TOD</BitsShortName>
                            <BitsName>Time Of Departure</BitsName>
                            <BitsValue val="0">Absence of Subfield #12</BitsValue>
                            <BitsValue val="1">Presence of Subfield #12</BitsValue>
                            <BitsPresence>12</BitsPresence>
                        </Bits>
                        <Bits bit="3">
                            <BitsShortName>AST</BitsShortName>
                            <BitsName>Aircraft Stand</BitsName>
                            <BitsValue val="0">Absence of Subfield #13</BitsValue>
                            <BitsValue val="1">Presence of Subfield #13</BitsValue>
                            <BitsPresence>13</BitsPresence>
                        </Bits>
                        <Bits bit="2">
                            <BitsShortName>STS</BitsShortName>
                            <BitsName>Stand Status</BitsName>
                            <BitsValue val="0">Absence of Subfield #14</BitsValue>
                            <BitsValue val="1">Presence of Subfield #14</BitsValue>
                            <BitsPresence>14</BitsPresence>
                        </Bits>
                        <Bits bit="1">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsValue val="0">no extension</BitsValue>
                            <BitsValue val="1">extension</BitsValue>
                        </Bits>
                    </Fixed>
                </Variable>
                <!--Subfields-->
                <Fixed length="2">
                    <Bits from="16" to="9">
                        <BitsShortName>SAC</BitsShortName>
                        <BitsName>System Area Code</BitsName>

                    </Bits>
                    <Bits from="8" to="1">
                        <BitsShortName>SIC</BitsShortName>
                        <BitsName>System Identity Code</BitsName>

                    </Bits>
                </Fixed>
                <Fixed length="7">
                    <Bits from="56" to="1" encode="ascii">
                        <BitsShortName>CSN</BitsShortName>
                        <BitsName>Callsign</BitsName>

                    </Bits>
                </Fixed>
                <Fixed length="4">
                    <Bits from="32" to="31" encode="unsigned">
                        <BitsShortName>TYP</BitsShortName>
                        <BitsName>TYP</BitsName>
                        <BitsValue val="0">Plan number </BitsValue>
                        <BitsValue val="1">Unit 1 internal flight number </BitsValue>
                        <BitsValue val="2">Unit 2 internal flight number </BitsValue>
                        <BitsValue val="3">Unit 3 internal flight number </BitsValue>
                    </Bits>
                    <Bits from="30" to="28">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>
                    <Bits from="27" to="1" encode="hex">
                        <BitsShortName>NBR</BitsShortName>
                        <BitsName>Number from 0 to 99 999 999</BitsName>

                    </Bits>
                </Fixed>
                <Fixed length="1">
                    <Bits from="8" to="7" encode="unsigned">
                        <BitsShortName>GAT/OAT</BitsShortName>
                        <BitsName>GAT/OAT</BitsName>
                        <BitsValue val="0">Unknown</BitsValue>
                        <BitsValue val="1">General Air Traffic</BitsValue>
                        <BitsValue val="2">Operational Air Traffic</BitsValue>
                        <BitsValue val="3">Not applicable</BitsValue>
                    </Bits>
                    <Bits from="6" to="5" encode="unsigned">
                        <BitsShortName>FR1/FR2</BitsShortName>
                        <BitsName>FR1/FR2</BitsName>
                        <BitsValue val="0">Instrument Flight Rules</BitsValue>
                        <BitsValue val="1">Visual Flight rules</BitsValue>
                        <BitsValue val="2">Not applicable</BitsValue>
                        <BitsValue val="3">Controlled Visual Flight Rules</BitsValue>
                    </Bits>
                    <Bits from="4" to="3" encode="unsigned">
                        <BitsShortName>RVSM</BitsShortName>
                        <BitsName>RVSM</BitsName>
                        <BitsValue val="0">Unknown Instrument Flight Rules</BitsValue>
                        <BitsValue val="1">Approved</BitsValue>
                        <BitsValue val="2">Exempt</BitsValue>
                        <BitsValue val="3">Not Approved</BitsValue>
                    </Bits>
                    <Bits bit="2">
                        <BitsShortName>HPR</BitsShortName>
                        <BitsName>HPR</BitsName>
                        <BitsValue val="0">Normal Priority Flight</BitsValue>
                        <BitsValue val="1">High Priority Flight</BitsValue>
                    </Bits>
                    <Bits bit="1">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>
                </Fixed>
                <Fixed length="4">
                    <Bits from="32" to="1" encode="ascii">
                        <BitsShortName>TOA</BitsShortName>
                        <BitsName>Type of Aircraft</BitsName>
                    </Bits>
                </Fixed>
                <Fixed length="1">
                    <Bits from="8" to="1" encode="ascii">
                        <BitsValue val="L">Light</BitsValue>
                        <BitsValue val="M">Medium</BitsValue>
                        <BitsValue val="H">Heavy</BitsValue>
                        <BitsValue val="J">Super</BitsValue>

                    </Bits>
                </Fixed>
                <Fixed length="4">
                    <Bits from="32" to="1" encode="ascii">
                        <BitsShortName>Departure Airport</BitsShortName>
                        <BitsName>The Airport Names are indicated in the ICAO Location Indicators book.
                        </BitsName>

                    </Bits>
                </Fixed>
                <Fixed length="4">
                    <Bits from="32" to="1" encode="ascii">
                        <BitsShortName>Destination Airport</BitsShortName>
                        <BitsName>The Airport Names are indicated in the ICAO Location Indicators book.
                        </BitsName>

                    </Bits>
                </Fixed>
                <Fixed length="3">
                    <Bits from="24" to="1" encode="ascii">
                        <BitsShortName>Runway Designation</BitsShortName>
                        <BitsName>For details refer to ICAO Annex 14, chapter 5.
                        </BitsName>

                    </Bits>
                </Fixed>
                <Fixed length="2">
                    <Bits from="16" to="1">
                        <BitsShortName>CFL</BitsShortName>
                        <BitsName>(LSB) = 1/4 FL</BitsName>
                        <BitsUnit scale="0.25">FL</BitsUnit>

                    </Bits>
                </Fixed>
                <Fixed length="2">
                    <Bits from="16" to="9" encode="hex">
                        <BitsShortName>Centre</BitsShortName>
                        <BitsName>8-bit group Identification code</BitsName>

                    </Bits>
                    <Bits from="8" to="1" encode="hex">
                        <BitsShortName>Position</BitsShortName>
                        <BitsName>8-bit Control Position identification code</BitsName>

                    </Bits>
                </Fixed>
                <Fixed length="4">
                    <Bits from="32" to="28">
                        <BitsShortName>TYP</BitsShortName>
                        <BitsName>TYP</BitsName>
                        <BitsValue val="0">Scheduled off-block time </BitsValue>
                        <BitsValue val="1">Estimated off-block time </BitsValue>
                        <BitsValue val="2">Estimated take-off time </BitsValue>
                        <BitsValue val="3">Actual off-block time </BitsValue>
                        <BitsValue val="4">Predicted time at runway hold </BitsValue>
                        <BitsValue val="5">Actual time at runway hold </BitsValue>
                        <BitsValue val="6">Actual line-up time </BitsValue>
                        <BitsValue val="7">Actual take-off time </BitsValue>
                        <BitsValue val="8">Estimated time of arrival </BitsValue>
                        <BitsValue val="9">Predicted landing time </BitsValue>
                        <BitsValue val="10">Actual landing time </BitsValue>
                        <BitsValue val="11">Actual time off runway </BitsValue>
                        <BitsValue val="12">Predicted time to gate </BitsValue>
                        <BitsValue val="13">Actual on-block time </BitsValue>

                    </Bits>
                    <Bits from="27" to="26">
                        <BitsShortName>DAY</BitsShortName>
                        <BitsName>DAY</BitsName>
                        <BitsValue val="0">Today</BitsValue>
                        <BitsValue val="1">Yesterday</BitsValue>
                        <BitsValue val="2">Tomorrow</BitsValue>

                    </Bits>

                    <Bits from="25" to="22">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>

                    <Bits from="21" to="17">
                        <BitsShortName>HOR</BitsShortName>
                        <BitsName>Hours, from 0 to 23</BitsName>

                    </Bits>

                    <Bits from="16" to="15">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>

                    <Bits from="14" to="9">
                        <BitsShortName>MIN</BitsShortName>
                        <BitsName>Minutes, from 0 to 59</BitsName>

                    </Bits>

                    <Bits bit="8">
                        <BitsShortName>AVS</BitsShortName>
                        <BitsName>AVS</BitsName>
                        <BitsValue val="0">Seconds available</BitsValue>
                        <BitsValue val="1">Seconds not available</BitsValue>

                    </Bits>

                    <Bits bit="7">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>

                    <Bits from="6" to="1">
                        <BitsShortName>SEC</BitsShortName>
                        <BitsName>Seconds, from 0 to 59</BitsName>

                    </Bits>

                </Fixed>
                <Fixed length="6">
                    <Bits from="48" to="1" encode="ascii">
                        <BitsShortName>Aircraft Stand</BitsShortName>
                        <BitsName>Aircraft Stand</BitsName>

                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="8" to="7" encode="ascii">
                        <BitsShortName>EMP</BitsShortName>
                        <BitsName>EMP</BitsName>
                        <BitsValue val="0">Empty </BitsValue>
                        <BitsValue val="1">Occupied </BitsValue>
                        <BitsValue val="2">Unknown </BitsValue>

                    </Bits>

                    <Bits from="6" to="5">
                        <BitsShortName>AVL</BitsShortName>
                        <BitsName>AVL</BitsName>
                        <BitsValue val="0">Available </BitsValue>
                        <BitsValue val="1">Not available </BitsValue>
                        <BitsValue val="2">Unknown </BitsValue>

                    </Bits>

                    <Bits from="4" to="1">
                        <BitsShortName>spare</BitsShortName>
                        <BitsName>Spare bits set to 0</BitsName>
                    </Bits>
                </Fixed>
            </Compound>
        </DataItemFormat>
    </DataItem>

    <DataItem id="430" rule="optional">

        <DataItemName>Phase of flight</DataItemName>
        <DataItemDefinition>Current phase of the flight.</DataItemDefinition>
        <DataItemFormat desc="One-octet fixed length Data Item.">
            <Fixed length="1">
                <Bits from="8" to="1">
                    <BitsShortName>FLS</BitsShortName>
                    <BitsName>Phase of flight</BitsName>
                    <BitsValue val="0">unknown </BitsValue>
                    <BitsValue val="1">on stand </BitsValue>
                    <BitsValue val="2">taxiing for departure </BitsValue>
                    <BitsValue val="3">taxiing for arrival </BitsValue>
                    <BitsValue val="4">runway for departure </BitsValue>
                    <BitsValue val="5">runway for arrival </BitsValue>
                    <BitsValue val="6">hold for departure </BitsValue>
                    <BitsValue val="7">hold for arrival </BitsValue>
                    <BitsValue val="8">push back </BitsValue>
                    <BitsValue val="9">on finals </BitsValue>
                </Bits>

            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="500" rule="optional">

        <DataItemName>Estimated Accuracies</DataItemName>
        <DataItemDefinition>Overview of all important accuracies</DataItemDefinition>
        <DataItemFormat desc="Compound Data Item, comprising a primary subfield of two octets, followed by up to eight subfields of predefined length.">
            <Compound>
                <Variable>
                    <Fixed length="1">
                        <Bits bit="8">
                            <BitsShortName>APC</BitsShortName>
                            <BitsName>Estimated Accuracy Of Track Position Cartesian</BitsName>
                            <BitsPresence>1</BitsPresence>
                        </Bits>
                        <Bits bit="7">
                            <BitsShortName>COV</BitsShortName>
                            <BitsName>XY Covariance</BitsName>
                            <BitsPresence>2</BitsPresence>
                        </Bits>
                        <Bits bit="6">
                            <BitsShortName>APW</BitsShortName>
                            <BitsName>Estimated Accuracy Of Track Position WGS-84</BitsName>
                            <BitsPresence>3</BitsPresence>
                        </Bits>
                        <Bits bit="5">
                            <BitsShortName>AGA</BitsShortName>
                            <BitsName>Estimated Accuracy Of Calculated Track Geometric Altitude</BitsName>
                            <BitsPresence>4</BitsPresence>
                        </Bits>
                        <Bits bit="4">
                            <BitsShortName>ABA</BitsShortName>
                            <BitsName>Estimated Accuracy Of Calculated Track Barometric Altitude</BitsName>
                            <BitsPresence>5</BitsPresence>
                        </Bits>
                        <Bits bit="3">
                            <BitsShortName>ATV</BitsShortName>
                            <BitsName>Estimated Accuracy Of Track Velocity Cartesian</BitsName>
                            <BitsPresence>6</BitsPresence>
                        </Bits>
                        <Bits bit="2">
                            <BitsShortName>AA</BitsShortName>
                            <BitsName>Estimated Accuracy Of Acceleration Cartesian</BitsName>
                            <BitsPresence>7</BitsPresence>
                        </Bits>
                        <Bits bit="1" fx="1">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsValue val="0">End of Primary Subfield</BitsValue>
                            <BitsValue val="1">Extension into next Octet</BitsValue>
                        </Bits>
                    </Fixed>
                    <Fixed length="1">
                        <Bits bit="8">
                            <BitsShortName>ARC</BitsShortName>
                            <BitsName>Estimated Accuracy Of Rate Of Climb/Descent</BitsName>
                            <BitsPresence>8</BitsPresence>
                        </Bits>
                        <Bits from="2" to="7">
                            <BitsShortName>spare</BitsShortName>
                            <BitsName>Spare bits set to 0</BitsName>
                            <BitsConst>0</BitsConst>
                        </Bits>
                        <Bits bit="1" fx="1">
                            <BitsShortName>FX</BitsShortName>
                            <BitsName>Extension indicator</BitsName>
                            <BitsValue val="0">End of Primary Subfield</BitsValue>
                            <BitsValue val="1">Extension into next Octet</BitsValue>
                        </Bits>
                    </Fixed>
                </Variable>

                <Fixed length="4">
                    <Bits from="32" to="17">
                        <BitsShortName>APC_X</BitsShortName>
                        <BitsName>Estimated accuracy i.e. standard deviation of the calculated position of an aircraft expressed in Cartesian co-ordinates</BitsName>
                        <BitsUnit scale="0.5">m</BitsUnit>
                    </Bits>
                    <Bits from="16" to="1">
                        <BitsShortName>APC_Y</BitsShortName>
                        <BitsName>Estimated accuracy i.e. standard deviation of the calculated position of an aircraft expressed in Cartesian co-ordinates</BitsName>
                        <BitsUnit scale="0.5">m</BitsUnit>
                    </Bits>
                </Fixed>

                <Fixed length="2">
                    <Bits from="16" to="1" encode="signed">
                        <BitsShortName>COV_XY</BitsShortName>
                        <BitsName>XY covariance component</BitsName>
                        <BitsUnit scale="0.5">m</BitsUnit>
                    </Bits>
                </Fixed>

                <Fixed length="4">
                    <Bits from="17" to="32">
                        <BitsShortName>APW_Lat</BitsShortName>
                        <BitsName>APW Latitude Component</BitsName>
                        <BitsUnit scale="0.000021457672119140625">deg</BitsUnit>
                    </Bits>
                    <Bits from="1" to="16">
                        <BitsShortName>APW_Long</BitsShortName>
                        <BitsName>APW Longitude Component</BitsName>
                        <BitsUnit scale="0.000021457672119140625">deg</BitsUnit>
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="1" to="8">
                        <BitsShortName>AGA_Acc</BitsShortName>
                        <BitsName>Calculated Track Geometric Altitude Estimated accuracy</BitsName>
                        <BitsUnit scale="6.25">ft</BitsUnit>
                    </Bits>
                </Fixed>

                <Fixed length="1">
                    <Bits from="1" to="8">
                        <BitsShortName>ABA_Acc</BitsShortName>
                        <BitsName>Calculated Track Barometric Altitude Estimated accuracy</BitsName>
                        <BitsUnit scale="6.25">ft</BitsUnit>
                    </Bits>
                </Fixed>

                <Fixed length="2">
                    <Bits from="16" to="9">
                        <BitsShortName>ATV_X</BitsShortName>
                        <BitsName>Estimated Accuracy Of Track Velocity X_Cartesian</BitsName>
                        <BitsUnit scale="0.25">m/s</BitsUnit>
                    </Bits>
                    <Bits from="8" to="1">
                        <BitsShortName>ATV_Y</BitsShortName>
                        <BitsName>Estimated Accuracy Of Track Velocity Y_Cartesian</BitsName>
                        <BitsUnit scale="0.25">m/s</BitsUnit>
                    </Bits>
                </Fixed>

                <Fixed length="2">
                    <Bits from="16" to="9">
                        <BitsShortName>AA_X</BitsShortName>
                        <BitsName>Estimated Accuracy Of Acceleration X_Cartesian</BitsName>
                        <BitsUnit scale="0.25">m/s^2</BitsUnit>
                    </Bits>
                    <Bits from="8" to="1">
                        <BitsShortName>AA_Y</BitsShortName>
                        <BitsName>Estimated Accuracy Of Acceleration Y_Cartesian</BitsName>
                        <BitsUnit scale="0.25">m/s^2</BitsUnit>
                    </Bits>
                </Fixed>                            

                <Fixed length="1">
                    <Bits from="1" to="8">
                        <BitsShortName>ARC_Acc</BitsShortName>
                        <BitsName>Rate Of Climb/Descent Estimated accuracy</BitsName>
                        <BitsUnit scale="6.25">ft/min</BitsUnit>
                    </Bits>
                </Fixed>

            </Compound>
        </DataItemFormat>
    </DataItem>

    <DataItem id="600" rule="optional">
        <DataItemName>Alert messages</DataItemName>
        <DataItemDefinition>Alert involving the targets indicated in I011/605.</DataItemDefinition>
        <DataItemFormat desc="Three-octet fixed length Data Item.">
            <Fixed length="3">
                <Bits bit="24">
                    <BitsShortName>ACK</BitsShortName>
                    <BitsName>ACK</BitsName>
                    <BitsValue val="0">Alert acknowledged</BitsValue>
                    <BitsValue val="1">Alert not acknowledged</BitsValue>
                </Bits>
                <Bits from="23" to="22" encode="unsigned">
                    <BitsShortName>SVR</BitsShortName>
                    <BitsName>SVR</BitsName>
                    <BitsValue val="0">End fo alert</BitsValue>
                    <BitsValue val="1">Pre-alarm</BitsValue>
                    <BitsValue val="2">Severe alert</BitsValue>
                </Bits>

                <Bits from="21" to="17" encode="hex">
                    <BitsShortName>spare</BitsShortName>
                    <BitsName>Spare Bit set to zero</BitsName>
                </Bits>
                <Bits from="16" to="9" encode="hex">
                    <BitsShortName>AT</BitsShortName>
                    <BitsName>Alert Type</BitsName>
                </Bits>
                <Bits from="8" to="1" encode="hex">
                    <BitsShortName>AN</BitsShortName>
                    <BitsName>Alert Number</BitsName>
                </Bits>

            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="605" rule="optional">
        <DataItemName>Tracks in Alert</DataItemName>
        <DataItemDefinition>List of track numbers of the targets concerned by the alert described in I011/600.</DataItemDefinition>
        <DataItemFormat desc="Repetitive Data Item starting with a one-octet Field Repetition Indicator (REP) followed by two-octet track numbers. ">
            <Fixed length="2">
                <!--Bits from="24" to="17" encode="hex">
                    <BitsShortName>REP</BitsShortName>
                    <BitsName>Repetition Factor</BitsName>
                </Bits-->

                <Bits from="16" to="13" encode="hex">
                    <BitsShortName>spare</BitsShortName>
                    <BitsName>Spare Bit set to zero</BitsName>
                </Bits>
                <Bits from="12" to="1" encode="hex">
                    <BitsShortName>FTN</BitsShortName>
                    <BitsName>Fusion Track Number</BitsName>
                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="610" rule="optional">
        <DataItemName>Holdbar status</DataItemName>
        <DataItemDefinition>Status of up to sixteen banks of twelve indicators.</DataItemDefinition>
        <DataItemFormat desc="Repetitive Data Item starting with a one-octet Field Repetition Indicator (REP) followed by two-octet track numbers. ">
            <Fixed length="2">
                <!--Bits from="24" to="17" encode="hex">
                    <BitsShortName>REP</BitsShortName>
                    <BitsName>Repetition Factor</BitsName>
                </Bits-->

                <Bits from="16" to="13" encode="hex">
                    <BitsShortName>spare</BitsShortName>
                    <BitsName>Spare Bit set to zero</BitsName>
                </Bits>
                <Bits from="12" to="1" encode="hex">
                    <BitsShortName>li</BitsShortName>
                    <BitsName>Indicator</BitsName>
                    <BitsValue val="0">Indicator on</BitsValue>
                    <BitsValue val="1">Indicator off</BitsValue>

                </Bits>
            </Fixed>
        </DataItemFormat>
    </DataItem>

    <DataItem id="SP" rule="optional">
        <DataItemName>Special Purpose Field</DataItemName>
        <DataItemDefinition>Special Purpose Field</DataItemDefinition>
        <DataItemFormat desc="Special Purpose Field">
            <Explicit>
                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>SPval</BitsShortName>
                    </Bits>
                </Fixed>
            </Explicit>
        </DataItemFormat>
    </DataItem>

    <DataItem id="RE" rule="optional">
        <DataItemName>Reserved Expansion Field</DataItemName>
        <DataItemDefinition>Reserved Expansion Field</DataItemDefinition>
        <DataItemFormat desc="Reserved Expansion Field">
            <Explicit>
                <Fixed length="1">
                    <Bits from="8" to="1">
                        <BitsShortName>REval</BitsShortName>
                    </Bits>
                </Fixed>
            </Explicit>
        </DataItemFormat>
    </DataItem>

    <UAP>
        <UAPItem bit="0" frn="1" len="2">010</UAPItem>
        <UAPItem bit="1" frn="2" len="1">000</UAPItem>
        <UAPItem bit="2" frn="3" len="1">015</UAPItem>
        <UAPItem bit="3" frn="4" len="3">140</UAPItem>
        <UAPItem bit="4" frn="5" len="8">041</UAPItem>
        <UAPItem bit="5" frn="6" len="4">042</UAPItem>
        <UAPItem bit="6" frn="7" len="4">202</UAPItem>
        <UAPItem bit="7" frn="FX" len="-">-</UAPItem>
        <UAPItem bit="8" frn="8" len="2">210</UAPItem>
        <UAPItem bit="9" frn="9" len="2">060</UAPItem>
        <UAPItem bit="10" frn="10" len="7">245</UAPItem>
        <UAPItem bit="11" frn="11" len="1+1+">380</UAPItem>
        <UAPItem bit="12" frn="12" len="2">161</UAPItem>
        <UAPItem bit="13" frn="13" len="1+1+">170</UAPItem>
        <UAPItem bit="14" frn="14" len="1+1+">290</UAPItem>
        <UAPItem bit="15" frn="FX" len="-">-</UAPItem>
        <UAPItem bit="16" frn="15" len="1">430</UAPItem>
        <UAPItem bit="17" frn="16" len="2">090</UAPItem>
        <UAPItem bit="18" frn="17" len="2">093</UAPItem>
        <UAPItem bit="19" frn="18" len="2">092</UAPItem>
        <UAPItem bit="20" frn="19" len="2">215</UAPItem>
        <UAPItem bit="21" frn="20" len="1+">270</UAPItem>
        <UAPItem bit="22" frn="21" len="1+1+">390</UAPItem>
        <UAPItem bit="23" frn="FX" len="-">-</UAPItem>
        <UAPItem bit="24" frn="22" len="1">300</UAPItem>
        <UAPItem bit="25" frn="23" len="1">310</UAPItem>
        <UAPItem bit="26" frn="24" len="1+1+">500</UAPItem>
        <UAPItem bit="27" frn="25" len="3">600</UAPItem>
        <UAPItem bit="28" frn="26" len="1+2N">605</UAPItem>
        <UAPItem bit="29" frn="27" len="1+2N">610</UAPItem>
        <UAPItem bit="30" frn="28" len="1+">SP</UAPItem>
        <UAPItem bit="31" frn="FX" len="-">-</UAPItem>
        <UAPItem bit="32" frn="29" len="1+">RE</UAPItem>
        <UAPItem bit="33" frn="30" len="-">-</UAPItem>
        <UAPItem bit="34" frn="31" len="-">-</UAPItem>
        <UAPItem bit="35" frn="32" len="-">-</UAPItem>
        <UAPItem bit="36" frn="33" len="-">-</UAPItem>
        <UAPItem bit="37" frn="34" len="-">-</UAPItem>
        <UAPItem bit="38" frn="35" len="-">-</UAPItem>
        <UAPItem bit="39" frn="FX" len="-">-</UAPItem>
    </UAP>

</Category>
princepaul commented 4 years ago

Can you please provide a sample pcap file for CAT011?

georglysen commented 4 years ago

Certainly, here it is. Note, though, that it's not "official". It's from another tool under development. However, it is parsed as expected in this tool: https://sourceforge.net/projects/asterix/ The sample is also quite short, but the data items I245/STI and I430/FLS are included and affected by the changes to the specification above. test.zip

Edit: Sorry, I saw you asked for a pcap file - this is just a binary file I dumped from python. It is the binary data that I send to "asterix.parse". I hope this file also works.

princepaul commented 4 years ago

Certainly, here it is. Note, though, that it's not "official". It's from another tool under development. However, it is parsed as expected in this tool: https://sourceforge.net/projects/asterix/ The sample is also quite short, but the data items I245/STI and I430/FLS are included and affected by the changes to the specification above. test.zip

Edit: Sorry, I saw you asked for a pcap file - this is just a binary file I dumped from python. It is the binary data that I send to "asterix.parse". I hope this file also works.

No Problem. Anyway thanks for the binary dump. I have made pcap out of it. Attaching it here. cat011_pcap.zip

dsalantic commented 4 years ago

Thank you for your submission. I pushed it to master branch.

georglysen commented 4 years ago

Thank you for your submission. I pushed it to master branch.

Great, thanks. When is the next pypi release scheduled for?

dsalantic commented 4 years ago

I made some changes in CAT011 mainly in names of items and published new version of asterix and also pypi version .