From 1527aa7659c89dbdedc78d29075f84e653160431 Mon Sep 17 00:00:00 2001 From: hpuhr Date: Mon, 30 Nov 2020 15:59:39 +0100 Subject: [PATCH 01/13] hardware concurrency --- src/client/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/main.cpp b/src/client/main.cpp index fa7ff24..fb4fde2 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -36,6 +36,8 @@ namespace po = boost::program_options; #include #include +#include + #if USE_LOG4CPP #include "log4cpp/Layout.hh" #include "log4cpp/OstreamAppender.hh" @@ -80,6 +82,8 @@ int main(int argc, char** argv) root.addAppender(console_appender_); #endif + tbb::task_scheduler_init guard(std::thread::hardware_concurrency()); + std::string filename; std::string framing{""}; std::string definition_path; From 299835632b4542e2d0c1291a13c07df2d36ad0ee Mon Sep 17 00:00:00 2001 From: alex-scp Date: Tue, 8 Dec 2020 13:11:25 +0000 Subject: [PATCH 02/13] adding category 10 version 0.31 and minor corrections the correction in cat 20 prevents a crash of the application --- definitions/categories/020/cat020_1.5.json | 2 +- definitions/categories/020/cat020_1.8.json | 12 ++++++------ definitions/categories/021/cat021_2.1.json | 2 +- definitions/categories/021/cat021_2.4.json | 2 +- definitions/categories/062/cat062_1.12.json | 3 ++- definitions/categories/062/cat062_1.16.json | 3 ++- definitions/categories/062/cat062_1.18.json | 3 ++- definitions/categories/categories.json | 19 ++++++++++++++----- 8 files changed, 29 insertions(+), 17 deletions(-) diff --git a/definitions/categories/020/cat020_1.5.json b/definitions/categories/020/cat020_1.5.json index 79156d3..6b88843 100644 --- a/definitions/categories/020/cat020_1.5.json +++ b/definitions/categories/020/cat020_1.5.json @@ -996,7 +996,7 @@ "lsb":0.25 }, { - "name":"sigma-x", + "name":"sigma-y", "comment":"Standard Deviation of Y component", "type":"fixed_bytes", "length":2, diff --git a/definitions/categories/020/cat020_1.8.json b/definitions/categories/020/cat020_1.8.json index 5bbc302..c0d5f6f 100644 --- a/definitions/categories/020/cat020_1.8.json +++ b/definitions/categories/020/cat020_1.8.json @@ -972,7 +972,7 @@ }, { "name":"DOP-xy", - "comment":"ρ(X,Y)", + "comment":"DOP covariance along (X,Y)", "type":"fixed_bytes", "length":2, "data_type":"uint", @@ -988,7 +988,7 @@ "optional_bitfield_index":1, "data_fields":[ { - "name":"sigma-x", + "name":"SDP-x", "comment":"Standard Deviation of X component", "type":"fixed_bytes", "length":2, @@ -996,7 +996,7 @@ "lsb":0.25 }, { - "name":"sigma-x", + "name":"SDP-y", "comment":"Standard Deviation of Y component", "type":"fixed_bytes", "length":2, @@ -1004,8 +1004,8 @@ "lsb":0.25 }, { - "name":"rho-xy", - "comment":"Correlation coefficient in two’s complement", + "name":"SDP-xy", + "comment":"Correlation coefficient in two's complement", "type":"fixed_bytes", "length":2, "data_type":"int", @@ -1021,7 +1021,7 @@ "optional_bitfield_index":2, "data_fields":[ { - "name":"sigma-gh", + "name":"SDH-gh", "comment":"Standard Deviation of Geometric Height", "type":"fixed_bytes", "length":2, diff --git a/definitions/categories/021/cat021_2.1.json b/definitions/categories/021/cat021_2.1.json index be10c9c..b134b63 100644 --- a/definitions/categories/021/cat021_2.1.json +++ b/definitions/categories/021/cat021_2.1.json @@ -1708,7 +1708,7 @@ "optional_bitfield_index":8, "data_fields":[ { - "name":"age", + "name":"Age", "comment":"Age of the Flight Level information in item I021/145", "type":"fixed_bytes", "data_type":"uint", diff --git a/definitions/categories/021/cat021_2.4.json b/definitions/categories/021/cat021_2.4.json index 206198f..6cab5a3 100644 --- a/definitions/categories/021/cat021_2.4.json +++ b/definitions/categories/021/cat021_2.4.json @@ -1722,7 +1722,7 @@ "optional_bitfield_index":8, "data_fields":[ { - "name":"age", + "name":"Age", "comment":"Age of the Flight Level information in item I021/145", "type":"fixed_bytes", "data_type":"uint", diff --git a/definitions/categories/062/cat062_1.12.json b/definitions/categories/062/cat062_1.12.json index b721dfe..ecf8624 100755 --- a/definitions/categories/062/cat062_1.12.json +++ b/definitions/categories/062/cat062_1.12.json @@ -1483,7 +1483,8 @@ "comment":"Age of the DAP \"Track Angle Rate\" in item 062/380 (Subfield #16)", "type":"fixed_bytes", "length":1, - "data_type":"uint" + "data_type":"uint", + "lsb":0.25 } ] }, diff --git a/definitions/categories/062/cat062_1.16.json b/definitions/categories/062/cat062_1.16.json index db7befc..f1b9978 100755 --- a/definitions/categories/062/cat062_1.16.json +++ b/definitions/categories/062/cat062_1.16.json @@ -1571,7 +1571,8 @@ "comment":"Age of the DAP \"Track Angle Rate\" in item 062/380 (Subfield #16)", "type":"fixed_bytes", "length":1, - "data_type":"uint" + "data_type":"uint", + "lsb":0.25 } ] }, diff --git a/definitions/categories/062/cat062_1.18.json b/definitions/categories/062/cat062_1.18.json index 14f1c8d..365887f 100755 --- a/definitions/categories/062/cat062_1.18.json +++ b/definitions/categories/062/cat062_1.18.json @@ -1606,7 +1606,8 @@ "comment":"Age of the DAP \"Track Angle Rate\" in item 062/380 (Subfield #16)", "type":"fixed_bytes", "length":1, - "data_type":"uint" + "data_type":"uint", + "lsb":0.25 } ] }, diff --git a/definitions/categories/categories.json b/definitions/categories/categories.json index b0097de..a9b98ec 100755 --- a/definitions/categories/categories.json +++ b/definitions/categories/categories.json @@ -27,6 +27,20 @@ "mappings":{ } }, + "010":{ + "comment":"Category 010 Transmission of Monosensor Surface Movement Data", + "default_edition":"0.31", + "default_mapping":"", + "editions":{ + "0.31":{ + "document":"SUR.ET1.ST05.2000-STD-07-01", + "date":"December 2001", + "file":"010/cat010_0.31.json" + } + }, + "mappings":{ + } + }, "019":{ "comment":"Category 019 Multilateration System Status Messages", "default_edition":"1.3", @@ -88,11 +102,6 @@ "document":"SUR.ET1.ST05.2000-STD-12-01", "date":"May 2011", "file":"021/cat021_2.1.json" - }, - "2.4":{ - "document":"EUROCONTROL-SPEC-0149-12", - "date":"15/06/2015", - "file":"021/cat021_2.4.json" } }, "mappings":{ From 65fdf5cfe8de19762d0bf13fb23cd0e62d87749c Mon Sep 17 00:00:00 2001 From: alex-scp Date: Tue, 8 Dec 2020 16:46:22 +0000 Subject: [PATCH 03/13] adding tests for cat010 v0.31 --- definitions/categories/010/cat010_0.31.json | 949 ++++++++++++++++++++ src/test/CMakeLists.txt | 1 + src/test/cat010ed0.31.bin | Bin 0 -> 41 bytes src/test/test_cat010_0.31.cpp | 349 +++++++ 4 files changed, 1299 insertions(+) create mode 100644 definitions/categories/010/cat010_0.31.json create mode 100644 src/test/cat010ed0.31.bin create mode 100644 src/test/test_cat010_0.31.cpp diff --git a/definitions/categories/010/cat010_0.31.json b/definitions/categories/010/cat010_0.31.json new file mode 100644 index 0000000..2238c08 --- /dev/null +++ b/definitions/categories/010/cat010_0.31.json @@ -0,0 +1,949 @@ +{ + "name":"cat010_0.31_record", + "type":"record", + "field_specification":{ + "name":"FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "uap":[ + "010", + "000", + "020", + "140", + "041", + "040", + "042", + "FX", + "200", + "202", + "161", + "170", + "060", + "220", + "245", + "FX", + "250", + "300", + "090", + "091", + "270", + "550", + "310", + "FX", + "500", + "280", + "131", + "210", + "-", + "SP", + "RE", + "FX" + ], + "items":[ + { + "number":"010", + "name":"Data Source Identifier", + "comment":"Identification of the system from which the data are received.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"System Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"System Identification Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"000", + "name":"Message Type", + "comment":"This Data Item allows for a more convenient handling of the messages at the receiver side by further defining the type of transaction.", + "type":"item", + "data_fields":[ + { + "name":"Message Type", + "comment":"001, Target Report;\n 002, Start of Update Cycle;\n003, Periodic Status Message;\n004, Event-triggered Status Message.", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"020", + "name":"Target Report Descriptor", + "comment":"Type and characteristics of the data as transmitted by a system.", + "type":"item", + "data_fields":[ + { + "name":"target_report_descriptor", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"TYP", + "comment":"000 SSR multilateration\n001 Mode S multilateration\n010 ADS-B\n011 PSR\n100 Magnetic Loop System\n101 HF multilateration\n110 Not defined\n111 Other types", + "type":"fixed_bits", + "start_bit":5, + "bit_length":3 + }, + { + "name":"DCR", + "comment":"1 Differential correction (ADS-B)\n0 No differential correction (ADS-B)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"CHN", + "comment":"1 Chain 2\n0 Chain 1", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"GBS", + "comment":"1 Transponder Ground bit set\n0 Transponder Ground bit not set", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"CRT", + "comment":"1 Corrupted replies in multilateration\n0 No Corrupted reply in multilateration", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Target Report Descriptor First Extent", + "comment":"", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"SIM", + "comment":"0 Actual target report\n1 Simulated target report", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"TST", + "comment":"0 Default\n1 Test Target", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"RAB", + "comment":"0 Report from target transponder\n1 Report from field monitor (fixed transponder)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"LOP", + "comment":"00 Undetermined\n01 Loop start\n10 Loop finish\n11 Not defined", + "type":"fixed_bits", + "start_bit":3, + "bit_length":2 + }, + { + "name":"TOT", + "comment":"00 Undetermined\n01 Aircraft\n10 Ground vehicle\n11 Helicopter", + "type":"fixed_bits", + "start_bit":1, + "bit_length":2 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Target Report Descriptor Second Extent", + "comment":"", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX2", + "optional_variable_value":1, + "items":[ + { + "name":"SPI", + "comment":"0 Absence of SPI\n1 Special Position Identification", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + } + ] + } + + ] + }, + { + "number":"040", + "name":"Measured Position in Polar Coordinates", + "comment":"Measured position of an aircraft in local polar coordinates.", + "type":"item", + "data_fields":[ + { + "name":"RHO", + "comment":"Max. range = 65536 m", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":1 + }, + { + "name":"THETA", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"041", + "name":"Position in WGS-84 Coordinates", + "comment":"Position of a target in WGS-84 Coordinates.", + "type":"item", + "data_fields":[ + { + "name":"Latitude", + "comment":"In WGS-84 in two’s complement.\nRange -90 <= latitude <= 90 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.00000536441 + }, + { + "name":"Longitude", + "comment":"In WGS-84 in two’s complement.\nRange -180 <= longitude < 180 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.00000536441 + } + ] + }, + { + "number":"042", + "name":"Position in Cartesian Coordinates", + "comment":"Calculated position in Cartesian Coordinates, in two’s complement representation.", + "type":"item", + "data_fields":[ + { + "name":"X", + "comment":"max range=+/-32768m (~17.7 NM)", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":1 + }, + { + "name":"Y", + "comment":"max range=+/-32768m (~17.7 NM)", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":1 + } + ] + }, + { + "number":"060", + "name":"Mode-3/A Code in Octal Representation", + "comment":"Mode-3/A code converted into octal representation.", + "type":"item", + "data_fields":[ + { + "name":"mode_3a", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 Mode-3/A code derived from the reply of the transponder\n1 Mode-3/A code not extracted during the last scan", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Mode-3/A reply", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "number":"090", + "name":"Flight Level in Binary Representation", + "comment":"Flight Level converted into binary representation.", + "type":"item", + "data_fields":[ + { + "name":"flight_level", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"Flight Level", + "comment":"", + "type":"fixed_bits", + "start_bit":0, + "bit_length":14, + "data_type":"int", + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"091", + "name":"Measured Height", + "comment":"Height above local 2D co-ordinate reference system (two's complement) based on direct measurements not related to barometric pressure.", + "type":"item", + "data_fields":[ + { + "name":"Measured Height", + "comment":"Range= +/- 204 800 ft", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":6.25 + } + ] + }, + { + "number":"131", + "name":"Amplitude of Primary Plot", + "comment":"Amplitude of Primary Plot.", + "type":"item", + "data_fields":[ + { + "name":"PAM", + "comment":"Range=0..255", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":1 + } + ] + }, + { + "number":"140", + "name":"Time of Day", + "comment":"Absolute time stamping expressed as Co-ordinated Universal Time (UTC).", + "type":"item", + "data_fields":[ + { + "name":"Time-of-Day", + "comment":"Acceptable Range of values: 0<= Time-of-Day<=24 hrs", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"161", + "name":"Track Number", + "comment":"An integer value representing a unique reference to a track record within a particular track file.", + "type":"item", + "data_fields":[ + { + "name":"TRACK NUMBER", + "comment":"Acceptable Range of values: 0<=Track-number<=4095", + "type":"fixed_bytes", + "length":2, + "start_bit":0, + "bit_length":11, + "data_type":"uint" + } + ] + }, + + { + "number":"170", + "name":"Track Status", + "comment":"Status of track.", + "type":"item", + "data_fields":[ + { + "name":"track_status", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"CNF", + "comment":"0 Confirmed track\n1 Track in initiation phase", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"TRE", + "comment":"0 Default\n1 Last report for a track", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"CST", + "comment":"00 No extrapolation\n01 Predictable extrapolation due to sensor refresh period\n10 Predictable extrapolation in masked area\n11 Extrapolation due to unpredictable absence of detection", + "type":"fixed_bits", + "start_bit":4, + "bit_length":2 + }, + { + "name":"MAH", + "comment":"0 Default\n1 Horizontal manoeuvre", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"TCC", + "comment":"0 Tracking performed in Sensor Plane, i.e. neither slant range correction nor projection was applied\n1 Slant range correction and a suitable projection technique are used to track in a 2D.reference plane, tangential to the earth model at the Sensor Site co-ordinates", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"STH", + "comment":"0 Measured position\n1 Smoothed position", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Track Status First Extent", + "comment":"", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"TOM", + "comment":"00 Unknown type of movement\n01 Taking-off\n10 Landing\n11 Other types of movement", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"DOU", + "comment":"000 No doubt\n001 Doubtful correlation (undetermined reason)\n010 Doubtful correlation in clutter\n011 Loss of accuracy\n100 Loss of accuracy in clutter\n101 Unstable track\n110 Previously coasted\n111 Not defined", + "type":"fixed_bits", + "start_bit":3, + "bit_length":3 + }, + { + "name":"MRS", + "comment":"00 Merge or split indication undetermined\n01 Track merged by association to plot\n10 Track merged by non-association to plot\n11 Split track", + "type":"fixed_bits", + "start_bit":1, + "bit_length":2 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Track Status Second Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX2", + "optional_variable_value":1, + "items":[ + { + "name":"GHO", + "comment":"0 Default\n1 Ghost track", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"200", + "name":"Calculated Track Velocity in Polar Co-ordinates", + "comment":"Calculated track velocity expressed in polar co-ordinates.", + "type":"item", + "data_fields":[ + { + "name":"Ground Speed", + "comment":"Max. val. = 2 NM/s = 7200kt", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.00006103515 + }, + { + "name":"Track Angle", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"202", + "name":"Calculated Track Velocity in Cartesian Coordinates", + "comment":"Calculated track velocity expressed in Cartesian Coordinates, in two’s complement representation.", + "type":"item", + "data_fields":[ + { + "name":"Vx", + "comment":"Max.range = +/-8192m/s", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + }, + { + "name":"Vy", + "comment":"Max.range = +/-8192m/s", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"210", + "name":"Calculated Acceleration", + "comment":"Calculated Acceleration of the target, in two’s complement form.", + "type":"item", + "data_fields":[ + { + "name":"Ax", + "comment":"Max. range +/- 31 m/s^2\nMaximum value means “maximum value or above”", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.25 + }, + { + "name":"Ay", + "comment":"Max. range +/- 31 m/s^2\nMaximum value means “maximum value or above”", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"220", + "name":"Target Address", + "comment":"Target address (ICAO 24-bit address) assigned uniquely to each Target.", + "type":"item", + "data_fields":[ + { + "name":"Target Address", + "type":"fixed_bytes", + "length":3, + "data_type":"uint" + } + ] + }, + { + "number":"245", + "name":"Target Identification", + "comment":"Target (aircraft or vehicle) identification in 8 characters.", + "type":"item", + "data_fields":[ + { + "name":"aircraft_identification1", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"STI", + "comment":"00 Callsign or registration downlinked from transponder\n01 Callsign downlinked from transponder\n10 Registration not downlinked from transponder\n11 Not defined", + "type":"fixed_bits", + "start_bit":54, + "bit_length":2 + }, + { + "name":"Target Identification", + "comment":"", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + }, + { + "number":"250", + "name":"Mode S MB Data", + "comment":"Mode S Comm B data as extracted from the aircraft transponder.", + "type":"item", + "data_fields":[ + { + "name":"Mode S MB Data", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"MB Data", + "comment":"56-bit message conveying Mode S Comm B message data", + "type":"fixed_bytes", + "length":7, + "data_type":"bin" + }, + { + "name":"address", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"BDS1", + "comment":"Comm B Data Buffer Store 1 Address", + "type":"fixed_bits", + "start_bit":4, + "bit_length":4 + }, + { + "name":"BDS2", + "comment":"Comm B Data Buffer Store 2 Address", + "type":"fixed_bits", + "start_bit":0, + "bit_length":4 + } + ] + } + ] + } + ] + }, + { + "number":"270", + "name":"Target Size & Orientation", + "comment":"Target size defined as length and width of the detected target, and orientation.", + "type":"item", + "data_fields":[ + { + "name":"Target Size & Orientation", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"LENGTH", + "comment":"When the length only is sent, the largest dimension is provided.", + "type":"fixed_bits", + "start_bit":1, + "bit_length":7, + "lsb":1.0 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Target Size & Orientation First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"ORIENTATION", + "comment":"The orientation gives the direction which the target nose is pointing to, relative to the Geographical North.", + "type":"fixed_bits", + "start_bit":1, + "bit_length":7, + "lsb":2.8125 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Target Size & Orientation Second Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX2", + "optional_variable_value":1, + "items":[ + { + "name":"WIDTH", + "comment":"", + "type":"fixed_bits", + "start_bit":1, + "bit_length":7, + "lsb":1.0 + } + ] + } + ] + }, + { + "number":"280", + "name":"Presence", + "comment":"Positions of all elementary presences constituting a plot.", + "type":"item", + "data_fields":[ + { + "name":"Presence", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"DRHO", + "comment":"Difference between the radial distance of the plot centre and that of the presence\nMax. Range = +/- 127 m", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":1.0 + }, + { + "name":"DTHETA", + "comment":"Difference between the azimuth of the plot centre and that of the presence\nMax. Range = +/- 19.05 deg", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.15 + } + ] + } + ] + }, + { + "number":"300", + "name":"Vehicle Fleet Identification", + "comment":"Vehicle fleet identification number.", + "type":"item", + "data_fields":[ + { + "name":"VFI", + "comment":"0 Unknown\n1 ATC equipment maintenance\n2 Airport maintenance\n3 Fire\n4 Bird scarer\n5 Snow plough\n6 Runway sweeper\n7 Emergency\n8 Police\n9 Bus\n10 Tug (push/tow)\n11 Grass cutter\n12 Fuel\n13 Baggage\n14 Catering\n15 Aircraft maintenance\n16 Flyco (follow me)", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"310", + "name":"Pre-programmed Message", + "comment":"Number related to a pre-programmed message that can be transmitted by a vehicle.", + "type":"item", + "data_fields":[ + { + "name":"pre_programmed_message", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"TRB", + "comment":"0 Default\n1 In Trouble", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"MSG", + "comment":"0 Not defined\n1 Towing aircraft\n2 Follow me operation\n3 Runway check\n4 Emergency operation (fire, medical... )\n5 Work in progress (maintenance, birds scarer, sweepers... )", + "type":"fixed_bits", + "start_bit":0, + "bit_length":7 + } + ] + } + ] + }, + { + "number":"500", + "name":"Position Accuracy", + "comment":"Standard Deviation of Position", + "type":"item", + "data_fields":[ + { + "name":"SDP-x", + "comment":"Standard Deviation of X component", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + }, + { + "name":"SDP-y", + "comment":"Standard Deviation of Y component", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + }, + { + "name":"SDP-xy", + "comment":"Covariance in two’s complement form", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"550", + "name":"System Status", + "comment":"Information concerning the configuration and status of a System.", + "type":"item", + "data_fields":[ + { + "name":"com", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"NOGO", + "comment":"Operational Release Status of the System\n0 Operational\n1 Degraded\n2 NOGO\n3 undefined", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"OVL", + "comment":"Overload indicator\n0 No overload\n1 Overload", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"TSV", + "comment":"Time Source Validity\n0 valid\n1 invalid", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"DIV", + "comment":"0 Normal Operation\n1 Diversity degraded", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"TTF", + "comment":"0 Test Target Operative\n1 Test Target Failure", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + } + ] + } + ] + } + ] +} diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 9f2c1e3..e5ef1e4 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -15,6 +15,7 @@ target_sources( test_categories PRIVATE "${CMAKE_CURRENT_LIST_DIR}/test_cat001_1.1.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat002_1.0.cpp" + "${CMAKE_CURRENT_LIST_DIR}/test_cat010_0.31.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat019_1.3.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat020_1.5.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat021_2.1.cpp" diff --git a/src/test/cat010ed0.31.bin b/src/test/cat010ed0.31.bin new file mode 100644 index 0000000000000000000000000000000000000000..9314822d24f816c89ba37cd4c8f6b5ae26274645 GIT binary patch literal 41 zcmV+^0M`Es04ewJ2@q%=0bu|zI+6x7hQt2#`QiWsz7YTZ000041Hk|{zfk=DGY}9$ literal 0 HcmV?d00001 diff --git a/src/test/test_cat010_0.31.cpp b/src/test/test_cat010_0.31.cpp new file mode 100644 index 0000000..6393530 --- /dev/null +++ b/src/test/test_cat010_0.31.cpp @@ -0,0 +1,349 @@ +/* + * This file is part of COMPASS. + * + * COMPASS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * COMPASS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with COMPASS. If not, see . + */ + +#include "catch.hpp" +#include "files.h" +#include "jasterix.h" +#include "logger.h" +#include "string_conv.h" +#include "test_jasterix.h" + +using namespace std; +using namespace nlohmann; + +void test_cat010_callback(std::unique_ptr json_data, size_t num_frames, + size_t num_records, size_t num_errors) +{ + loginf << "cat010 test: decoded " << num_frames << " frames, " << num_records << " records, " + << num_errors << " errors" << logendl; + + REQUIRE(num_frames == 0); + REQUIRE(num_records == 1); + REQUIRE(num_errors == 0); + + // { + // "frames": [ + // { + // "board_number": 0, + // "cnt": 0, + // "content": { + // "data_blocks": [ + // { + // "category": 10, + // "content": { + // "index": 11, + // "length": 38, + // "records": [ + // { + // "000": { + // "Message Type": 1 + // }, + // "010": { + // "SAC": 104, + // "SIC": 30 + // }, + // "020": { + // "CHN": 0, + // "CRT": 0, + // "DCR": 0, + // "FX": 1, + // "FX2": 0, + // "GBS": 0, + // "LOP": 0, + // "RAB": 0, + // "SIM": 0, + // "TOT": 0, + // "TST": 0, + // "TYP": 3 + // }, + // "040": { + // "RHO": 1588.0, + // "THETA": 189.50866690594 + // }, + // "042": { + // "X": -267.0, + // "Y": -1566.0 + // }, + // "140": { + // "Time-of-Day": 24693.140625 + // }, + // "161": { + // "TRACK NUMBER": 4 + // }, + // "170": { + // "CNF": 0, + // "CST": 0, + // "DOU": 0, + // "FX": 1, + // "FX2": 1, + // "GHO": 0, + // "MAH": 0, + // "MRS": 0, + // "STH": 1, + // "TCC": 0, + // "TOM": 3, + // "TRE": 0 + // }, + // "200": { + // "Ground Speed": 0.0002441406, + // "Track Angle": 267.27539050336 + // }, + // "202": { + // "Vx": -0.5, + // "Vy": 0.0 + // }, + // "210": { + // "Ax": -1.0, + // "Ay": -0.25 + // }, + // "270": { + // "FX": 1, + // "FX2": 1, + // "LENGTH": 27.0, + // "ORIENTATION": 267.1875, + // "WIDTH": 40.0 + // }, + // "FSPEC": [ + // true, + // true, + // true, + // true, + // false, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // false, + // false, + // false, + // true, + // false, + // false, + // false, + // false, + // true, + // false, + // false, + // true, + // false, + // false, + // false, + // true, + // false, + // false, + // false, + // false + // ], + // "index": 11, + // "length": 38, + // "record_data": "f7f10910681e016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff" + // } + // ] + // }, + // "length": 41 + // } + // ], + // "index": 8, + // "length": 41 + // }, + // "length": 53, + // "padding": 2779096485, + // "recording_day": 0, + // "time_ms": 24693.2 + // } + // ], + // "rec_num": 0 + // } + + loginf << "cat010 test: data block" << logendl; + + REQUIRE(json_data->contains("data_blocks")); + REQUIRE(json_data->at("data_blocks").is_array()); + REQUIRE(json_data->at("data_blocks").size() == 1); + + const json& first_data_block = json_data->at("data_blocks").at(0); + + REQUIRE(first_data_block.contains("category")); + REQUIRE(first_data_block.at("category") == 10); + REQUIRE(first_data_block.contains("length")); + REQUIRE(first_data_block.at("length") == 41); + + loginf << "cat010 test: num records" << logendl; + REQUIRE(first_data_block.contains("content")); + REQUIRE(first_data_block.at("content").contains("records")); + REQUIRE(first_data_block.at("content").at("records").is_array()); + REQUIRE(first_data_block.at("content").at("records").size() == 1); + + const json& record = first_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x f7 f1 09 10 + // 11110111 11110001 00001001 00010000 + + loginf << "cat010 test: fspec" << logendl; + REQUIRE(record.at("FSPEC").size() == 4 * 8); + + REQUIRE(record.at("FSPEC") == + std::vector({1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0})); + + // ; I010/010: =0x 68 1e + // ; Data Source Identifier: 0x681e (SAC=104; SIC=30) + + loginf << "cat010 test: 010" << logendl; + REQUIRE(record.at("010").at("SAC") == 104); + REQUIRE(record.at("010").at("SIC") == 30); + + // ; I010/000: =0x 01 + // ; Message Type: 1 (Target Report) + + loginf << "cat010 test: 000" << logendl; + REQUIRE(record.at("000").at("Message Type") == 1); + + // ; I010/020: =0x 61 00 + // ; Target Report Descriptor: TYP='PSR' CHN-1 LOP=0 TOT=0 + // + // ; NOTE: this case shows a poor encoding since the first extent should have not been sent + + loginf << "cat010 test: 020" << logendl; + REQUIRE(record.at("020").at("TYP") == 3); + REQUIRE(record.at("020").at("DCR") == 0); + REQUIRE(record.at("020").at("CHN") == 0); + REQUIRE(record.at("020").at("GBS") == 0); + REQUIRE(record.at("020").at("CRT") == 0); + REQUIRE(record.at("020").at("FX") == 1); + + REQUIRE(record.at("020").at("SIM") == 0); + REQUIRE(record.at("020").at("TST") == 0); + REQUIRE(record.at("020").at("RAB") == 0); + REQUIRE(record.at("020").at("LOP") == 0); + REQUIRE(record.at("020").at("TOT") == 0); + REQUIRE(record.at("020").at("FX2") == 0); + + // ; I010/040: =0x 30 3a 92 + // ; Measured Position: srg=1588 (0.857 nmi); azm=34499 (189.509 deg) + + loginf << "cat010 test: 040" << logendl; + REQUIRE(record.at("040").at("RHO") == 1588.0); + REQUIRE(approximatelyEqual(record.at("040").at("THETA"), 189.50866690594, 10e-11)); + + // ; I010/042: =0x fe f5 f9 e2 + // ; Calculated Position: x=-267 mtr; y=-1566 mtr + + loginf << "cat010 test: 042" << logendl; + REQUIRE(record.at("042").at("X") == -267.0); + REQUIRE(record.at("042").at("Y") == -1566.0); + + // ; I010/140: =0x 30 3a 92 + // ; Time of Day: tod=0x303a92 (3160722; 06:51:33.141 UTC) + + loginf << "cat010 test: 140" << logendl; + REQUIRE(approximatelyEqual(record.at("140").at("Time-of-Day"), 24693.140625, 10e-6)); + + // ; I010/161: =0x 00 04 + // ; Track Number: tno=4 + + loginf << "cat010 test: 161" << logendl; + REQUIRE(record.at("161").at("TRACK NUMBER") == 4); + + // ; I010/170: =0x 03 c1 00 + // ; Track Status: + // ; CON CST=0 TCC=0 STH=1 + // ; TOM=3 DOU=0 mrs=0 + // + // ; NOTE: this case shows a poor encoding since the second extent should have not been sent + + loginf << "cat010 test: 170" << logendl; + REQUIRE(record.at("170").at("CNF") == 0); + REQUIRE(record.at("170").at("TRE") == 0); + REQUIRE(record.at("170").at("CST") == 0); + REQUIRE(record.at("170").at("MAH") == 0); + REQUIRE(record.at("170").at("TCC") == 0); + REQUIRE(record.at("170").at("STH") == 1); + REQUIRE(record.at("170").at("FX") == 1); + + REQUIRE(record.at("170").at("TOM") == 3); + REQUIRE(record.at("170").at("DOU") == 0); + REQUIRE(record.at("170").at("MRS") == 0); + REQUIRE(record.at("170").at("FX2") == 1); + + REQUIRE(record.at("170").at("GHO") == 0); + + // ; I010/200: =0x 00 04 be 10 + // ; Calculated Track Velocity: spd=4 (0.879 kts); hdg=48656 (267.275 deg) + + loginf << "cat010 test: 200" << logendl; + REQUIRE(approximatelyEqual(record.at("200").at("Ground Speed"), 0.0002441406, 10e-10)); + REQUIRE(approximatelyEqual(record.at("200").at("Track Angle"), 267.27539050336, 10e-11)); + + // ; I010/202: =0x ff fe 00 00 + // ; Calculated Track Velocity in Cartesian Co-ordinates: vx=-0.50 m/s; vy=0.00 m/s + + loginf << "cat010 test: 202" << logendl; + REQUIRE(record.at("202").at("Vx") == -0.5); + REQUIRE(record.at("202").at("Vy") == 0.0); + + // ; I010/210: =0x fc ff + // ; Calculated Acceleration: ax=-1.00 [m/s2]; ay=-0.25 [m/s2] + + loginf << "cat010 test: 210" << logendl; + REQUIRE(record.at("210").at("Ax") == -1.0); + REQUIRE(record.at("210").at("Ay") == -0.25); + + // ; I010/270: =0x 37 bf 50 + // ; Target Size and Orientation: + // ; length=95 + // ; orientation=40 + + loginf << "cat010 test: 210" << logendl; + REQUIRE(record.at("270").at("LENGTH") == 27.0); + REQUIRE(record.at("270").at("FX") == 1); + + REQUIRE(approximatelyEqual(record.at("270").at("ORIENTATION"), 267.1875, 10e-4)); + REQUIRE(record.at("270").at("FX2") == 1); + + REQUIRE(record.at("270").at("WIDTH") == 40.0); +} + +TEST_CASE("jASTERIX CAT010 0.31", "[jASTERIX CAT010]") +{ + loginf << "cat010 test: start" << logendl; + + jASTERIX::jASTERIX jasterix(definition_path, true, true, false); + + // 0a0029f7f10910681e016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff + // echo -n + // 0a0029f7f10910681e016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff + // | xxd -r -p > cat010ed0.31.bin + + REQUIRE(jasterix.hasCategory(10)); + std::shared_ptr cat010 = jasterix.category(10); + REQUIRE(cat010->hasEdition("0.31")); + cat010->setCurrentEdition("0.31"); + cat010->setCurrentMapping(""); + + const std::string filename = "cat010ed0.31.bin"; + + REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 41); + + jasterix.decodeFile(data_path + filename, test_cat010_callback); + + loginf << "cat010 ed 0.31 test: end" << logendl; +} From 6fa4e79a201e1f45a3862d60d34aef7cfe75cab4 Mon Sep 17 00:00:00 2001 From: alex-scp Date: Tue, 8 Dec 2020 18:38:25 +0000 Subject: [PATCH 04/13] added cat247 ed 1.2 --- definitions/categories/247/cat247_1.2.json | 116 ++++++++++++ definitions/categories/categories.json | 14 ++ src/test/CMakeLists.txt | 1 + src/test/cat247ed1.2.bin | Bin 0 -> 20 bytes src/test/test_cat010_0.31.cpp | 10 +- src/test/test_cat247_1.2.cpp | 206 +++++++++++++++++++++ 6 files changed, 342 insertions(+), 5 deletions(-) create mode 100644 definitions/categories/247/cat247_1.2.json create mode 100644 src/test/cat247ed1.2.bin create mode 100644 src/test/test_cat247_1.2.cpp diff --git a/definitions/categories/247/cat247_1.2.json b/definitions/categories/247/cat247_1.2.json new file mode 100644 index 0000000..8fe7eb4 --- /dev/null +++ b/definitions/categories/247/cat247_1.2.json @@ -0,0 +1,116 @@ +{ + "name":"cat247_1.2_record", + "type":"record", + "field_specification":{ + "name":"FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "uap":[ + "010", + "015", + "140", + "550", + "-", + "SP", + "RE", + "FX" + ], + "items":[ + { + "number":"010", + "name":"Data Source Identifier", + "comment":"Identification of the radar station from which the data are received.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"System Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"System Identification Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"015", + "name":"Service Identification", + "comment":"Identification of the service provided to one or more users.", + "type":"item", + "data_fields":[ + { + "name":"Service Identification", + "comment":"The service identification is allocated by the system", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"140", + "name":"Time of Day", + "comment":"Absolute time stamping expressed as Co-ordinated Universal Time (UTC).", + "type":"item", + "data_fields":[ + { + "name":"Time-of-Day", + "comment":"Acceptable Range of values: 0<= Time-of-Day<=24 hrs", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"550", + "name":"Category Version Number Report", + "comment":"Version number of Categories used.", + "type":"item", + "data_fields":[ + { + "name":"Category Version Number Report", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"CAT", + "comment":"ASTERIX Category [0..255]", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"Main version number", + "comment":"range: [0..99]", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"Sub version number", + "comment":"range: [0..99]", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + } + ] + } + ] +} diff --git a/definitions/categories/categories.json b/definitions/categories/categories.json index a9b98ec..0bf9180 100755 --- a/definitions/categories/categories.json +++ b/definitions/categories/categories.json @@ -241,5 +241,19 @@ }, "mappings":{ } + }, + "247":{ + "comment":"Category 247 Version Number Exchange", + "default_edition":"1.2", + "default_mapping":"", + "editions":{ + "1.2":{ + "document":"", + "date":"February 2008", + "file":"247/cat247_1.2.json" + } + }, + "mappings":{ + } } } diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index e5ef1e4..9e1af76 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -25,6 +25,7 @@ target_sources( test_categories "${CMAKE_CURRENT_LIST_DIR}/test_cat062_1.16.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat063_1.0.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat065_1.3.cpp" + "${CMAKE_CURRENT_LIST_DIR}/test_cat247_1.2.cpp" ) target_sources( test_limits diff --git a/src/test/cat247ed1.2.bin b/src/test/cat247ed1.2.bin new file mode 100644 index 0000000000000000000000000000000000000000..209213c13ad5f5c051a820f79fa4c885c99e023c GIT binary patch literal 20 bcmey)Ao3w2fKf(&H?t@cqc|hecSa@vKoJD$ literal 0 HcmV?d00001 diff --git a/src/test/test_cat010_0.31.cpp b/src/test/test_cat010_0.31.cpp index 6393530..affcca6 100644 --- a/src/test/test_cat010_0.31.cpp +++ b/src/test/test_cat010_0.31.cpp @@ -200,7 +200,7 @@ void test_cat010_callback(std::unique_ptr json_data, size_t num_ REQUIRE(record.at("FSPEC").size() == 4 * 8); REQUIRE(record.at("FSPEC") == - std::vector({1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, + std::vector({1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0})); // ; I010/010: =0x 68 1e @@ -277,12 +277,12 @@ void test_cat010_callback(std::unique_ptr json_data, size_t num_ REQUIRE(record.at("170").at("TCC") == 0); REQUIRE(record.at("170").at("STH") == 1); REQUIRE(record.at("170").at("FX") == 1); - + REQUIRE(record.at("170").at("TOM") == 3); REQUIRE(record.at("170").at("DOU") == 0); REQUIRE(record.at("170").at("MRS") == 0); REQUIRE(record.at("170").at("FX2") == 1); - + REQUIRE(record.at("170").at("GHO") == 0); // ; I010/200: =0x 00 04 be 10 @@ -313,10 +313,10 @@ void test_cat010_callback(std::unique_ptr json_data, size_t num_ loginf << "cat010 test: 210" << logendl; REQUIRE(record.at("270").at("LENGTH") == 27.0); - REQUIRE(record.at("270").at("FX") == 1); + REQUIRE(record.at("270").at("FX") == 1); REQUIRE(approximatelyEqual(record.at("270").at("ORIENTATION"), 267.1875, 10e-4)); - REQUIRE(record.at("270").at("FX2") == 1); + REQUIRE(record.at("270").at("FX2") == 1); REQUIRE(record.at("270").at("WIDTH") == 40.0); } diff --git a/src/test/test_cat247_1.2.cpp b/src/test/test_cat247_1.2.cpp new file mode 100644 index 0000000..0355225 --- /dev/null +++ b/src/test/test_cat247_1.2.cpp @@ -0,0 +1,206 @@ +/* + * This file is part of COMPASS. + * + * COMPASS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * COMPASS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with COMPASS. If not, see . + */ + +#include "catch.hpp" +#include "files.h" +#include "jasterix.h" +#include "logger.h" +#include "string_conv.h" +#include "test_jasterix.h" + +using namespace std; +using namespace nlohmann; + +void test_cat247_callback(std::unique_ptr json_data, size_t num_frames, + size_t num_records, size_t num_errors) +{ + loginf << "cat247 test: decoded " << num_frames << " frames, " << num_records << " records, " + << num_errors << " errors" << logendl; + + REQUIRE(num_frames == 0); + REQUIRE(num_records == 1); + REQUIRE(num_errors == 0); + + // { + // "frames": [ + // { + // "board_number": 15, + // "cnt": 0, + // "content": { + // "data_blocks": [ + // { + // "category": 247, + // "content": { + // "index": 11, + // "length": 17, + // "records": [ + // { + // "010": { + // "SAC": 104, + // "SIC": 80 + // }, + // "015": { + // "Service Identification": 1 + // }, + // "140": { + // "Time-of-Day": 14431.4609375 + // }, + // "550": { + // "Category Version Number Report": [ + // { + // "CAT": 21, + // "Main version number": 2, + // "Sub version number": 1 + // }, + // { + // "CAT": 23, + // "Main version number": 1, + // "Sub version number": 2 + // }, + // { + // "CAT": 247, + // "Main version number": 1, + // "Sub version number": 2 + // } + // ], + // "REP": 3 + // }, + // "FSPEC": [ + // true, + // true, + // true, + // true, + // false, + // false, + // false, + // false + // ], + // "index": 11, + // "length": 17, + // "record_data": "f06850011c2fbb03150201170102f70102" + // } + // ] + // }, + // "length": 20 + // } + // ], + // "index": 8, + // "length": 20 + // }, + // "length": 32, + // "padding": 2779096485, + // "recording_day": 0, + // "time_ms": 14432.0 + // } + // ], + // "rec_num": 0 + // } + + loginf << "cat247 test: data block" << logendl; + + REQUIRE(json_data->contains("data_blocks")); + REQUIRE(json_data->at("data_blocks").is_array()); + REQUIRE(json_data->at("data_blocks").size() == 1); + + const json& first_data_block = json_data->at("data_blocks").at(0); + + REQUIRE(first_data_block.contains("category")); + REQUIRE(first_data_block.at("category") == 247); + REQUIRE(first_data_block.contains("length")); + REQUIRE(first_data_block.at("length") == 20); + + loginf << "cat247 test: num records" << logendl; + REQUIRE(first_data_block.contains("content")); + REQUIRE(first_data_block.at("content").contains("records")); + REQUIRE(first_data_block.at("content").at("records").is_array()); + REQUIRE(first_data_block.at("content").at("records").size() == 1); + + const json& record = first_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x f0 + // 11110000 + + loginf << "cat247 test: fspec" << logendl; + REQUIRE(record.at("FSPEC").size() == 1 * 8); + + REQUIRE(record.at("FSPEC") == + std::vector({1, 1, 1, 1, 0, 0, 0, 0})); + + // ; I247/010: =0x 68 50 + // ; Data Source Identifier: 0x6850 (SAC=104; SIC=80) + + loginf << "cat247 test: 010" << logendl; + REQUIRE(record.at("010").at("SAC") == 104); + REQUIRE(record.at("010").at("SIC") == 80); + + // ; I247/015: =0x 01 + // ; Service Identification: 1 + + loginf << "cat247 test: 015" << logendl; + REQUIRE(record.at("015").at("Service Identification") == 1); + + // ; I247/140: =0x 1c 2f bb + // ; Time of Day: 0x1c2fbb (1847227; 14431.460938 secs; 04:00:31.461 UTC) + + loginf << "cat247 test: 140" << logendl; + REQUIRE(approximatelyEqual(record.at("140").at("Time-of-Day"), 14431.4609375, 10e-7)); + + // ; I247/550: =0x 03 15 02 01 17 01 02 f7 01 02 + // ; Category Version Number Report: + // ; Category 21: Version 2.1 + // ; Category 23: Version 1.2 + // ; Category 247: Version 1.2 + + loginf << "cat247 test: 550" << logendl; + REQUIRE(record.at("550").at("Category Version Number Report").size() == 3); + REQUIRE(record.at("550").at("Category Version Number Report")[0].at("CAT") == 21); + REQUIRE(record.at("550").at("Category Version Number Report")[0].at("Main version number") == 2); + REQUIRE(record.at("550").at("Category Version Number Report")[0].at("Sub version number") == 1); + REQUIRE(record.at("550").at("Category Version Number Report")[1].at("CAT") == 23); + REQUIRE(record.at("550").at("Category Version Number Report")[1].at("Main version number") == 1); + REQUIRE(record.at("550").at("Category Version Number Report")[1].at("Sub version number") == 2); + REQUIRE(record.at("550").at("Category Version Number Report")[2].at("CAT") == 247); + REQUIRE(record.at("550").at("Category Version Number Report")[2].at("Main version number") == 1); + REQUIRE(record.at("550").at("Category Version Number Report")[2].at("Sub version number") == 2); +} + +TEST_CASE("jASTERIX CAT247 1.2", "[jASTERIX CAT247]") +{ + loginf << "cat247 test: start" << logendl; + + jASTERIX::jASTERIX jasterix(definition_path, true, true, false); + + // f70014f06850011c2fbb03150201170102f70102 + // echo -n + // f70014f06850011c2fbb03150201170102f70102 + // | xxd -r -p > cat247ed1.2.bin + + REQUIRE(jasterix.hasCategory(247)); + std::shared_ptr cat247 = jasterix.category(247); + REQUIRE(cat247->hasEdition("1.2")); + cat247->setCurrentEdition("1.2"); + cat247->setCurrentMapping(""); + + const std::string filename = "cat247ed1.2.bin"; + + REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 20); + + jasterix.decodeFile(data_path + filename, test_cat247_callback); + + loginf << "cat247 ed 1.2 test: end" << logendl; +} From 5f53db161a4d157b982057953f2b6f5a8f715071 Mon Sep 17 00:00:00 2001 From: alex-scp Date: Wed, 9 Dec 2020 17:31:57 +0000 Subject: [PATCH 05/13] using dummy values for SAC/SIC --- src/test/cat010ed0.31.bin | Bin 41 -> 41 bytes src/test/cat247ed1.2.bin | Bin 20 -> 20 bytes src/test/test_cat010_0.31.cpp | 18 +++++++++--------- src/test/test_cat247_1.2.cpp | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/test/cat010ed0.31.bin b/src/test/cat010ed0.31.bin index 9314822d24f816c89ba37cd4c8f6b5ae26274645..b0869249eedf07d632ede02cc7114293b2b6ca72 100644 GIT binary patch delta 15 WcmdPY json_data, size_t num_ // "Message Type": 1 // }, // "010": { - // "SAC": 104, - // "SIC": 30 + // "SAC": 0, + // "SIC": 1 // }, // "020": { // "CHN": 0, @@ -153,7 +153,7 @@ void test_cat010_callback(std::unique_ptr json_data, size_t num_ // ], // "index": 11, // "length": 38, - // "record_data": "f7f10910681e016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff" + // "record_data": "f7f109100001016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff" // } // ] // }, @@ -203,12 +203,12 @@ void test_cat010_callback(std::unique_ptr json_data, size_t num_ std::vector({1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0})); - // ; I010/010: =0x 68 1e - // ; Data Source Identifier: 0x681e (SAC=104; SIC=30) + // ; I010/010: =0x 00 01 + // ; Data Source Identifier: 0x0001 (SAC=0; SIC=1) loginf << "cat010 test: 010" << logendl; - REQUIRE(record.at("010").at("SAC") == 104); - REQUIRE(record.at("010").at("SIC") == 30); + REQUIRE(record.at("010").at("SAC") == 0); + REQUIRE(record.at("010").at("SIC") == 1); // ; I010/000: =0x 01 // ; Message Type: 1 (Target Report) @@ -327,9 +327,9 @@ TEST_CASE("jASTERIX CAT010 0.31", "[jASTERIX CAT010]") jASTERIX::jASTERIX jasterix(definition_path, true, true, false); - // 0a0029f7f10910681e016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff + // 0a0029f7f109100001016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff // echo -n - // 0a0029f7f10910681e016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff + // 0a0029f7f109100001016100303a92063486c3fef5f9e20004be10fffe0000000403c10037bf50fcff // | xxd -r -p > cat010ed0.31.bin REQUIRE(jasterix.hasCategory(10)); diff --git a/src/test/test_cat247_1.2.cpp b/src/test/test_cat247_1.2.cpp index 0355225..2b68004 100644 --- a/src/test/test_cat247_1.2.cpp +++ b/src/test/test_cat247_1.2.cpp @@ -50,8 +50,8 @@ void test_cat247_callback(std::unique_ptr json_data, size_t num_ // "records": [ // { // "010": { - // "SAC": 104, - // "SIC": 80 + // "SAC": 0, + // "SIC": 1 // }, // "015": { // "Service Identification": 1 @@ -91,7 +91,7 @@ void test_cat247_callback(std::unique_ptr json_data, size_t num_ // ], // "index": 11, // "length": 17, - // "record_data": "f06850011c2fbb03150201170102f70102" + // "record_data": "f00001011c2fbb03150201170102f70102" // } // ] // }, @@ -140,12 +140,12 @@ void test_cat247_callback(std::unique_ptr json_data, size_t num_ REQUIRE(record.at("FSPEC") == std::vector({1, 1, 1, 1, 0, 0, 0, 0})); - // ; I247/010: =0x 68 50 - // ; Data Source Identifier: 0x6850 (SAC=104; SIC=80) + // ; I247/010: =0x 00 01 + // ; Data Source Identifier: 0x0001 (SAC=0; SIC=1) loginf << "cat247 test: 010" << logendl; - REQUIRE(record.at("010").at("SAC") == 104); - REQUIRE(record.at("010").at("SIC") == 80); + REQUIRE(record.at("010").at("SAC") == 0); + REQUIRE(record.at("010").at("SIC") == 1); // ; I247/015: =0x 01 // ; Service Identification: 1 @@ -184,9 +184,9 @@ TEST_CASE("jASTERIX CAT247 1.2", "[jASTERIX CAT247]") jASTERIX::jASTERIX jasterix(definition_path, true, true, false); - // f70014f06850011c2fbb03150201170102f70102 + // f70014f00001011c2fbb03150201170102f70102 // echo -n - // f70014f06850011c2fbb03150201170102f70102 + // f70014f00001011c2fbb03150201170102f70102 // | xxd -r -p > cat247ed1.2.bin REQUIRE(jasterix.hasCategory(247)); From fd3b293813b1ed711ee850c029207b38e473afd2 Mon Sep 17 00:00:00 2001 From: alex-scp Date: Wed, 9 Dec 2020 19:14:01 +0000 Subject: [PATCH 06/13] added category 004 edition 1.4 --- definitions/categories/004/cat004_1.4.json | 1538 ++++++++++++++++++++ definitions/categories/categories.json | 14 + src/test/CMakeLists.txt | 1 + src/test/cat004ed1.4.bin | Bin 0 -> 46 bytes src/test/test_cat004_1.4.cpp | 438 ++++++ 5 files changed, 1991 insertions(+) create mode 100644 definitions/categories/004/cat004_1.4.json create mode 100644 src/test/cat004ed1.4.bin create mode 100644 src/test/test_cat004_1.4.cpp diff --git a/definitions/categories/004/cat004_1.4.json b/definitions/categories/004/cat004_1.4.json new file mode 100644 index 0000000..b7880f2 --- /dev/null +++ b/definitions/categories/004/cat004_1.4.json @@ -0,0 +1,1538 @@ +{ + "name":"cat004_1.4_record", + "type":"record", + "field_specification":{ + "name":"FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "uap":[ + "010", + "000", + "015", + "020", + "040", + "045", + "060", + "FX", + "030", + "170", + "120", + "070", + "076", + "074", + "075", + "FX", + "100", + "035", + "171", + "110", + "-", + "RE", + "SP", + "FX" + ], + "items":[ + { + "number":"000", + "name":"Message Type", + "comment":"This Data Item allows for a more convenient handling of the messages at the receiver side by further defining the type of transaction.", + "type":"item", + "data_fields":[ + { + "name":"Message Type", + "comment":"1 Alive Message\n2 Route Adherence Monitor Longitudinal Deviation\n3 Route Adherence Monitor Heading Deviation\n4 Minimum Safe Altitude Warning\n5 Area Proximity Warning\n6 Clearance Level Adherence Monitor\n7 Short Term Conflict Alert\n8 Approach Funnel Deviation Alert\n9 RIMCAS Arrival / Landing Monitor (ALM)\n10 RIMCAS Arrival / Departure Wrong Runway Alert (WRA)\n11 RIMCAS Arrival / Departure Opposite Traffic Alert (OTA)\n12 RIMCAS Departure Monitor (RDM)\n13 RIMCAS Runway / Taxiway Crossing Monitor (RCM)\n14 RIMCAS Taxiway Separation Monitor (TSM)\n15 RIMCAS Unauthorized Taxiway Movement Monitor(UTMM)\n16 RIMCAS Stop Bar Overrun Alert (SBOA)\n17 End Of Conflict (EOC)", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"010", + "name":"Data Source Identifier", + "comment":"Identification of the system sending the data", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"System Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"System Identification Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"015", + "name":"SDPS Identifier", + "comment":"Identification of the SDPS providing data to the safety nets server.", + "type":"item", + "data_fields":[ + { + "name":"SDPS Identifier", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"SAC", + "comment":"System Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"System Identification Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + } + ] + }, + { + "number":"020", + "name":"Time of Message", + "comment":"Absolute time stamping of the message in the form of elapsed time since last midnight", + "type":"item", + "data_fields":[ + { + "name":"TIME OF MESSAGE", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"030", + "name":"Track Number 1", + "comment":"Identification of a track number related to conflict", + "type":"item", + "data_fields":[ + { + "name":"Track Number 1", + "comment":"range: 0 to 65535", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"035", + "name":"Track Number 2", + "comment":"Together with I004/030, this item defines the track pair in conflict.", + "type":"item", + "data_fields":[ + { + "name":"Track Number 2", + "comment":"range: 0 to 65535", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"040", + "name":"Alert Identifier", + "comment":"Identification of an alert (Alert number)", + "type":"item", + "data_fields":[ + { + "name":"Alert Identifier", + "comment":"range: 0 to 65535", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"045", + "name":"Alert Status", + "comment":"Information concerning status of the alert", + "type":"item", + "data_fields":[ + { + "name":"Alert Status", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"Alert status", + "comment":"Status of the alert", + "type":"fixed_bits", + "start_bit":1, + "bit_length":3 + } + ] + } + ] + }, + { + "number":"060", + "name":"Safety Net Function & System Status", + "comment":"Status of the Safety Nets functions handled by the system", + "type":"item", + "data_fields":[ + { + "name":"Safety Net Function & System Status", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"MRVA", + "comment":"0 Default\n1 MRVA function", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"RAMLD", + "comment":"0 Default\n1 RAMLD function", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"RAMHD", + "comment":"0 Default\n1 RAMHD function", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"MSAW", + "comment":"0 Default\n1 MSAW function", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"APW", + "comment":"0 Default\n1 APW function", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"CLAM", + "comment":"0 Default\n1 CLAM function", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"STCA", + "comment":"0 Default\n1 STCA function", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Safety Net Function & System Status First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"AFDA", + "comment":"0 Default\n1 AFDA function", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"RIMCA", + "comment":"0 Default\n1 RIMCA function", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"OF", + "comment":"0 Default\n1 Overflow error", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"OL", + "comment":"0 Default\n1 Overload error", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"070", + "name":"Conflict Timing and Separation", + "comment":"Information on Timing and Aircraft Separation", + "type":"item", + "data_fields":[ + { + "name":"070", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"TC", + "comment":"Time to Conflict", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"TIME TO CONFLICT", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "name":"TCA", + "comment":"Time to Closest Approach", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"TIME TO CLOSEST APPROACH", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "name":"CHS", + "comment":"Current Horizontal Separation", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"Current Horizontal Separation", + "comment":"unit: metres", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.5 + } + ] + }, + { + "name":"MHS", + "comment":"Estimated Minimum Horizontal Separation", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"Estimated minimum horizontal separation", + "comment":"unit: metres", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.5 + } + ] + }, + { + "name":"CVS", + "comment":"Current Vertical Separation", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"Current Vertical Separation", + "comment":"unit: feet", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":25 + } + ] + }, + { + "name":"MVS", + "comment":"Estimated Minimum Vertical Separation", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":5, + "data_fields":[ + { + "name":"Estimated minimum vertical separation", + "comment":"unit: feet", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":25 + } + ] + } + ] + } + ] + }, + { + "number":"074", + "name":"Longitudinal Deviation", + "comment":"Longitudinal deviation for Route Adherence Monitoring, in two’s complement form.", + "type":"item", + "data_fields":[ + { + "name":"Longitudinal deviation", + "comment":"unit: metres", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":32 + } + ] + }, + { + "number":"075", + "name":"Transversal Distance Deviation", + "comment":"Transversal distance deviation for Route Adherence Monitoring, in two’s complement form.", + "type":"item", + "data_fields":[ + { + "name":"Transversal Distance Deviation", + "comment":"unit: metres", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.5 + } + ] + }, + { + "number":"076", + "name":"Vertical Deviation", + "comment":"Vertical Deviation from planned altitude, in two’s complement form.", + "type":"item", + "data_fields":[ + { + "name":"Vertical deviation", + "comment":"unit: feet", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":25 + } + ] + }, + { + "number":"100", + "name":"Area Definition", + "comment":"Definition of Areas involved in a Safety Net Alert", + "type":"item", + "data_fields":[ + { + "name":"100", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"AN", + "comment":"Name of the area involved in an APW alarm", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Area Name", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"Area Name", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + }, + { + "name":"CAN", + "comment":"Crossing Area Name", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"Crossing Area Name", + "comment":"Name of Crossing Area Involved in a RIMCA", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"Crossing Area Name", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + }, + { + "name":"RT1", + "comment":"Runway/Taxiway Designator 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"Runway/Taxiway Designator 1", + "comment":"Designator of Runway/Taxiway 1 Involved in a RIMCA", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"Runway/Taxiway Designator 1", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + }, + { + "name":"RT2", + "comment":"Runway/Taxiway Designator 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"Runway/Taxiway Designator 2", + "comment":"Designator of Runway/Taxiway 2 Involved in a RIMCA", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"Runway/Taxiway Designator 2", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + }, + { + "name":"SB", + "comment":"Stop Bar Designator", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"Stop Bar Designator", + "comment":"Designator of Stop-Bar Involved in a RIMCA", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"Stop Bar Designator", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + }, + { + "name":"G", + "comment":"Gate Designator", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"Gate Designator", + "comment":"Gate Designator (in 7 characters) of the approaching aircraft in a RIMCA", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"Gate Designator", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + } + ] + } + ] + }, + { + "number":"110", + "name":"FDPS Sector Control Identification", + "comment":"Identification of a list of FDPS Sector Control Positions in charge of the involved targets, as provided by the FDPS", + "type":"item", + "data_fields":[ + { + "name":"FDPS Sector Control Identification", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"Centre", + "comment":"Centre identification code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"Position", + "comment":"Control position identification code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + } + ] + }, + { + "number":"120", + "name":"Conflict Characteristics", + "comment":"Description of the Conflict Properties", + "type":"item", + "data_fields":[ + { + "name":"120", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"CN", + "comment":"Conflict Nature", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Conflict Nature", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"MAS", + "comment":"Conflict location in military airspace\n0 conflict not predicted to occur in military airspace\n1 conflict predicted to occur in military airspace", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"CAS", + "comment":"Conflict location in civil airspace\n0 conflict not predicted to occur in civil airspace\n1 conflict predicted to occur in civil airspace", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"FLD", + "comment":"Fast lateral divergence\n0 Aircraft are not fast diverging laterally at current time\n1 Aircraft are fast diverging laterally at current time", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"FVD", + "comment":"Fast vertical divergence\n0 Aircraft are not fast diverging vertically at current time\n1 Aircraft are fast diverging vertically at current time", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"Type", + "comment":"Type of separation infringement\n0 Minor separation infringement\n1 Major separation infringement", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"Cross", + "comment":"Crossing test\n0 Aircraft have not crossed at starting time of conflict\n1 Aircraft have crossed at starting time of conflict", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"Div", + "comment":"Divergence test\n0 Aircraft are not diverging at starting time of conflict\n1 Aircraft are diverging at starting time of conflict", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Conflict Nature First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"RRC", + "comment":"Runway/Runway crossing in RIMCAS\n0 Default\n1 Runway/Runway Crossing", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"RTC", + "comment":"Runway/Taxiway Crossing in RIMCAS\n0 Default\n1 Runway/Taxiway Crossing", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"MRVA", + "comment":"0 Default\n1 Msg Type 4 (MSAW) indicates MRVA", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"CC", + "comment":"Conflict Classification", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"CC", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"Table Id", + "comment":"Identification of conflict categories definition table", + "type":"fixed_bits", + "start_bit":4, + "bit_length":4 + }, + { + "name":"Severity Class", + "comment":"Conflict Severity Class", + "type":"fixed_bits", + "start_bit":1, + "bit_length":3 + }, + { + "name":"CS", + "comment":"Conflict Severity\n0 LOW\n1 HIGH", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"CP", + "comment":"Conflict Probability", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"Probability", + "comment":"Conflict probability (%)", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.5 + } + ] + }, + { + "name":"CD", + "comment":"Conflict Duration", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"Duration", + "comment":"The duration of the conflict is the elapsed time since the declaration of the conflict", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + } + ] + } + ] + }, + { + "number":"170", + "name":"Aircraft Identification & Characteristics 1", + "comment":"Identification & Characteristics of Aircraft 1 Involved in the Conflict.", + "type":"item", + "data_fields":[ + { + "name":"170", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"AI1", + "comment":"Aircraft Identifier 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Aircraft Identifier #1", + "comment":"Aircraft Identifier (in 7 characters) of Aircraft 1 Involved in the Conflict", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"Aircraft Identifier #1", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + }, + { + "name":"M31", + "comment":"Mode 3/A Code Aircraft 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"Mode 3/A Code Aircraft 1", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"Mode-3/A reply #1", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "name":"CPW", + "comment":"Predicted Conflict Position 1 (WGS84)", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"Latitude #1", + "comment":"In WGS.84 in two’s complement. Range -90 <= latitude <= 90 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.00000536442 + }, + { + "name":"Longitude #1", + "comment":"In WGS.84 in two’s complement. Range -180 <= longitude < 180 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.00000536442 + }, + { + "name":"Altitude #1", + "comment":"Altitude of predicted conflict in two’s complement. Range -15FL <= Altitude <= 1500FL", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":25 + } + ] + }, + { + "name":"CPC", + "comment":"Predicted Conflict Position 1 (Cartesian Coordinates)", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"X-position #1", + "comment":"Starting X-Position of Conflict. unit: metres", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.5 + }, + { + "name":"Y-Position #1", + "comment":"Starting Y-Position of Conflict. unit: metres", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.5 + }, + { + "name":"Z-Position #1", + "comment":"Starting Z-Position of Conflict. unit: feet", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":25 + } + ] + }, + { + "name":"TT1", + "comment":"Time to Threshold Aircraft 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"TIME TO THRESHOLD #1", + "comment":"Time to runway threshold for first approaching aircraft in a RIMCA", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.0078125 + } + ] + }, + { + "name":"DT1", + "comment":"Distance to Threshold Aircraft 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":5, + "data_fields":[ + { + "name":"Distance to Threshold #1", + "comment":"Distance from threshold for Aircraft 1 involved in a RIMCA. unit: metres", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.5 + } + ] + }, + { + "name":"AC1", + "comment":"Aircraft Characteristics Aircraft 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":6, + "data_fields":[ + { + "name":"Aircraft Characteristics Aircraft #1", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"GAT/OAT #1", + "comment":"00 Unknown\n01 General Air Traffic\n10 Operational Air Traffic\n11 Not applicable", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"FR1/FR2 #1", + "comment":"00 Instrument Flight Rules\n01 Visual Flight rules\n10 Not applicable\n11 Controlled Visual Flight Rules", + "type":"fixed_bits", + "start_bit":4, + "bit_length":2 + }, + { + "name":"RVSM #1", + "comment":"00 Unknown\n01 Approved\n10 Exempt\n11 Not Approved", + "type":"fixed_bits", + "start_bit":2, + "bit_length":2 + }, + { + "name":"HPR #1", + "comment":"0 Normal Priority Flight\n1 High Priority Flight", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Aircraft Characteristics Aircraft First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"CDM #1", + "comment":"Climbing/Descending mode\n00 Maintaining\n01 Climbing\n10 Descending\n11 Invalid", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"PRI #1", + "comment":"0 Non primary target\n1 Primary target", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"GV #1", + "comment":"0 Default\n1 Ground Vehicle", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"MS1", + "comment":"Mode S Identifier Aircraft 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":7, + "data_fields":[ + { + "name":"Mode S Identifier Aircraft #1", + "comment":"Aircraft Identification downloaded from Aircraft 1 involved in the Conflict if equipped with a Mode-S transponder.", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"Mode S Identifier Aircraft #1", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + }, + { + "name":"FP1", + "comment":"Flight Plan Number Aircraft 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":8, + "data_fields":[ + { + "name":"Flight Plan Number Aircraft #1", + "comment":"Number of the Flight Plan Correlated to Aircraft 1 Involved in the Conflict", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"NBR #1", + "comment":"Number from 0 to 99 999 999", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":27 + } + ] + } + ] + }, + { + "name":"CF1", + "comment":"Cleared Flight Level Aircraft 1", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":9, + "data_fields":[ + { + "name":"CFL #1", + "comment":"Cleared Flight Level for Aircraft 1 Involved in the Conflict. unit: FL", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + } + ] + } + ] + } + ] + }, + { + "number":"171", + "name":"Aircraft Identification & Characteristics 2", + "comment":"Identification & Characteristics of Aircraft 2 Involved in the Conflict.", + "type":"item", + "data_fields":[ + { + "name":"171", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"AI2", + "comment":"Aircraft Identifier 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Aircraft Identifier #2", + "comment":"Aircraft Identifier (in 7 characters) of Aircraft 2 Involved in the Conflict", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"Aircraft Identifier #2", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + }, + { + "name":"M32", + "comment":"Mode 3/A Code Aircraft 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"Mode 3/A Code Aircraft 2", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"Mode-3/A reply #2", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "name":"CPW", + "comment":"Predicted Conflict Position 2 (WGS84)", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"Latitude #2", + "comment":"In WGS.84 in two’s complement. Range -90 <= latitude <= 90 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.00000536442 + }, + { + "name":"Longitude #2", + "comment":"In WGS.84 in two’s complement. Range -180 <= longitude < 180 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.00000536442 + }, + { + "name":"Altitude #2", + "comment":"Altitude of predicted conflict in two’s complement. Range -15FL <= Altitude <= 1500FL", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":25 + } + ] + }, + { + "name":"CPC", + "comment":"Predicted Conflict Position 2 (Cartesian Coordinates)", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"X-position #2", + "comment":"Starting X-Position of Conflict. unit: metres", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.5 + }, + { + "name":"Y-Position #2", + "comment":"Starting Y-Position of Conflict. unit: metres", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.5 + }, + { + "name":"Z-Position #2", + "comment":"Starting Z-Position of Conflict. unit: feet", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":25 + } + ] + }, + { + "name":"TT2", + "comment":"Time to Threshold Aircraft 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"TIME TO THRESHOLD #2", + "comment":"Time to runway threshold for first approaching aircraft in a RIMCA", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.0078125 + } + ] + }, + { + "name":"DT2", + "comment":"Distance to Threshold Aircraft 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":5, + "data_fields":[ + { + "name":"Distance to Threshold #2", + "comment":"Distance from threshold for Aircraft 2 involved in a RIMCA. unit: metres", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.5 + } + ] + }, + { + "name":"AC2", + "comment":"Aircraft Characteristics Aircraft 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":6, + "data_fields":[ + { + "name":"Aircraft Characteristics Aircraft #2", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"GAT/OAT #2", + "comment":"00 Unknown\n01 General Air Traffic\n10 Operational Air Traffic\n11 Not applicable", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"FR1/FR2 #2", + "comment":"00 Instrument Flight Rules\n01 Visual Flight rules\n10 Not applicable\n11 Controlled Visual Flight Rules", + "type":"fixed_bits", + "start_bit":4, + "bit_length":2 + }, + { + "name":"RVSM #2", + "comment":"00 Unknown\n01 Approved\n10 Exempt\n11 Not Approved", + "type":"fixed_bits", + "start_bit":2, + "bit_length":2 + }, + { + "name":"HPR #2", + "comment":"0 Normal Priority Flight\n1 High Priority Flight", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Aircraft Characteristics Aircraft First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"CDM #2", + "comment":"Climbing/Descending mode\n00 Maintaining\n01 Climbing\n10 Descending\n11 Invalid", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"PRI #2", + "comment":"0 Non primary target\n1 Primary target", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"GV #2", + "comment":"0 Default\n1 Ground Vehicle", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"MS2", + "comment":"Mode S Identifier Aircraft 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":7, + "data_fields":[ + { + "name":"Mode S Identifier Aircraft #2", + "comment":"Aircraft Identification downloaded from Aircraft 2 involved in the Conflict if equipped with a Mode-S transponder.", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"Mode S Identifier Aircraft #2", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + }, + { + "name":"FP2", + "comment":"Flight Plan Number Aircraft 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":8, + "data_fields":[ + { + "name":"Flight Plan Number Aircraft #2", + "comment":"Number of the Flight Plan Correlated to Aircraft 2 Involved in the Conflict", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"NBR #2", + "comment":"Number from 0 to 99 999 999", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":27 + } + ] + } + ] + }, + { + "name":"CF2", + "comment":"Cleared Flight Level Aircraft 2", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":9, + "data_fields":[ + { + "name":"CFL #2", + "comment":"Cleared Flight Level for Aircraft 2 Involved in the Conflict. unit: FL", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + } + ] + } + ] + } + ] + } + ] +} diff --git a/definitions/categories/categories.json b/definitions/categories/categories.json index 0bf9180..e881e04 100755 --- a/definitions/categories/categories.json +++ b/definitions/categories/categories.json @@ -27,6 +27,20 @@ "mappings":{ } }, + "004":{ + "comment":"Category 004 Safety Net Messages", + "default_edition":"1.4", + "default_mapping":"", + "editions":{ + "1.4":{ + "document":"SUR.ET1.ST05.2000-STD-17-02", + "date":"October 2010", + "file":"004/cat004_1.4.json" + } + }, + "mappings":{ + } + }, "010":{ "comment":"Category 010 Transmission of Monosensor Surface Movement Data", "default_edition":"0.31", diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 9e1af76..b1bd240 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -15,6 +15,7 @@ target_sources( test_categories PRIVATE "${CMAKE_CURRENT_LIST_DIR}/test_cat001_1.1.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat002_1.0.cpp" + "${CMAKE_CURRENT_LIST_DIR}/test_cat004_1.4.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat010_0.31.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat019_1.3.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat020_1.5.cpp" diff --git a/src/test/cat004ed1.4.bin b/src/test/cat004ed1.4.bin new file mode 100644 index 0000000000000000000000000000000000000000..e1e1d2e77b0e8f172e1f0a0d15aa5631deb3c252 GIT binary patch literal 46 zcmZQ!;J(Db$jI8(z{kSCf3tysk*$lB!KQ=zG7E#q-GvSejO<;E3^tu?JXQ>xg#g@v B36%f< literal 0 HcmV?d00001 diff --git a/src/test/test_cat004_1.4.cpp b/src/test/test_cat004_1.4.cpp new file mode 100644 index 0000000..9bfa9d0 --- /dev/null +++ b/src/test/test_cat004_1.4.cpp @@ -0,0 +1,438 @@ +/* + * This file is part of COMPASS. + * + * COMPASS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * COMPASS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with COMPASS. If not, see . + */ + +#include "catch.hpp" +#include "files.h" +#include "jasterix.h" +#include "logger.h" +#include "string_conv.h" +#include "test_jasterix.h" + +using namespace std; +using namespace nlohmann; + +void test_cat004_callback(std::unique_ptr json_data, size_t num_frames, + size_t num_records, size_t num_errors) +{ + loginf << "cat004 test: decoded " << num_frames << " frames, " << num_records << " records, " + << num_errors << " errors" << logendl; + + REQUIRE(num_frames == 0); + REQUIRE(num_records == 3); + REQUIRE(num_errors == 0); + + // { + // "data_blocks": [ + // { + // "category": 4, + // "content": { + // "index": 3, + // "length": 8, + // "records": [ + // { + // "000": { + // "Message Type": 1 + // }, + // "010": { + // "SAC": 0, + // "SIC": 1 + // }, + // "020": { + // "TIME OF MESSAGE": 2829.0 + // }, + // "060": { + // "APW": 1, + // "CLAM": 1, + // "FX": 0, + // "MRVA": 0, + // "MSAW": 0, + // "RAMHD": 0, + // "RAMLD": 0, + // "STCA": 1 + // }, + // "FSPEC": [ + // true, + // true, + // false, + // true, + // false, + // false, + // true, + // false + // ], + // "index": 3, + // "length": 8, + // "record_data": "d20001010586800e" + // } + // ] + // }, + // "length": 11 + // }, + // { + // "category": 4, + // "content": { + // "index": 14, + // "length": 12, + // "records": [ + // { + // "000": { + // "Message Type": 6 + // }, + // "010": { + // "SAC": 0, + // "SIC": 1 + // }, + // "020": { + // "TIME OF MESSAGE": 70666.0 + // }, + // "030": { + // "Track Number 1": 3027 + // }, + // "040": { + // "Alert Identifier": 15496 + // }, + // "FSPEC": [ + // true, + // true, + // false, + // true, + // true, + // false, + // false, + // true, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // false + // ], + // "index": 14, + // "length": 12, + // "record_data": "d9800001068a05003c880bd3" + // } + // ] + // }, + // "length": 15 + // }, + // { + // "category": 4, + // "content": { + // "index": 29, + // "length": 17, + // "records": [ + // { + // "000": { + // "Message Type": 7 + // }, + // "010": { + // "SAC": 0, + // "SIC": 1 + // }, + // "020": { + // "TIME OF MESSAGE": 70658.0 + // }, + // "030": { + // "Track Number 1": 3130 + // }, + // "035": { + // "Track Number 2": 2417 + // }, + // "040": { + // "Alert Identifier": 15497 + // }, + // "045": { + // "Alert status": 3 + // }, + // "120": { + // "available": [ + // false, + // false, + // false, + // false, + // false, + // false, + // false, + // false + // ] + // }, + // "FSPEC": [ + // true, + // true, + // false, + // true, + // true, + // true, + // false, + // true, + // true, + // false, + // true, + // false, + // false, + // false, + // false, + // true, + // false, + // true, + // false, + // false, + // false, + // false, + // false, + // false + // ], + // "index": 29, + // "length": 17, + // "record_data": "dda1400001078a01003c89060c3a000971" + // } + // ] + // }, + // "length": 20 + // } + // ], + // "rec_num": 0 + // } + + loginf << "cat004 test: data block" << logendl; + + REQUIRE(json_data->contains("data_blocks")); + REQUIRE(json_data->at("data_blocks").is_array()); + REQUIRE(json_data->at("data_blocks").size() == 3); + + // ---------------------------------- + // --- first frame = Alive + // ---------------------------------- + + const json& first_data_block = json_data->at("data_blocks").at(0); + + REQUIRE(first_data_block.contains("category")); + REQUIRE(first_data_block.at("category") == 4); + REQUIRE(first_data_block.contains("length")); + REQUIRE(first_data_block.at("length") == 11); + + loginf << "cat004 test #1: num records" << logendl; + REQUIRE(first_data_block.contains("content")); + REQUIRE(first_data_block.at("content").contains("records")); + REQUIRE(first_data_block.at("content").at("records").is_array()); + REQUIRE(first_data_block.at("content").at("records").size() == 1); + + const json& record1 = first_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x d2 + // 11010010 + + loginf << "cat004 test #1: fspec" << logendl; + REQUIRE(record1.at("FSPEC").size() == 1 * 8); + + REQUIRE(record1.at("FSPEC") == + std::vector({1, 1, 0, 1, 0, 0, 1, 0})); + + // ; I004/010: =0x 00 01 + // ; Data Source Identifier: 0x0001 (SAC=0; SIC=1) + + loginf << "cat004 test #1: 010" << logendl; + REQUIRE(record1.at("010").at("SAC") == 0); + REQUIRE(record1.at("010").at("SIC") == 1); + + // ; I004/000: =0x 01 + // ; Message Type: 1 (Alive Message) + + loginf << "cat004 test #1: 000" << logendl; + REQUIRE(record1.at("000").at("Message Type") == 1); + + // ; I004/020: =0x 05 86 80 + // ; Time of Day: 0x058680 (362112; 2829.000000 secs; 00:47:09.000 UTC) + + loginf << "cat004 test #1: 020" << logendl; + REQUIRE(record1.at("020").at("TIME OF MESSAGE") == 2829.0); + + // ; I004/060: =0x 0e + // ; Safety Net Function Status: + // ; ix=1: 0x0e + // ; RAMLD=0; RAMHD=0; MSAW=0; APW=1; CLAM=1; STCA=1 + + loginf << "cat004 test #1: 060" << logendl; + REQUIRE(record1.at("060").at("APW") == 1); + REQUIRE(record1.at("060").at("CLAM") == 1); + REQUIRE(record1.at("060").at("MRVA") == 0); + REQUIRE(record1.at("060").at("MSAW") == 0); + REQUIRE(record1.at("060").at("RAMHD") == 0); + REQUIRE(record1.at("060").at("RAMLD") == 0); + REQUIRE(record1.at("060").at("STCA") == 1); + + // ---------------------------------- + // --- second frame = CLAM + // ---------------------------------- + + const json& second_data_block = json_data->at("data_blocks").at(1); + + REQUIRE(second_data_block.contains("category")); + REQUIRE(second_data_block.at("category") == 4); + REQUIRE(second_data_block.contains("length")); + REQUIRE(second_data_block.at("length") == 15); + + loginf << "cat004 test #2: num records" << logendl; + REQUIRE(second_data_block.contains("content")); + REQUIRE(second_data_block.at("content").contains("records")); + REQUIRE(second_data_block.at("content").at("records").is_array()); + REQUIRE(second_data_block.at("content").at("records").size() == 1); + + const json& record2 = second_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x d9 80 + // 11011001 10000000 + + loginf << "cat004 test #2: fspec" << logendl; + REQUIRE(record2.at("FSPEC").size() == 2 * 8); + + REQUIRE(record2.at("FSPEC") == + std::vector({1, 1, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0})); + + // ; I004/010: =0x 00 01 + // ; Data Source Identifier: 0x0001 (SAC=0; SIC=1) + + loginf << "cat004 test #2: 010" << logendl; + REQUIRE(record2.at("010").at("SAC") == 0); + REQUIRE(record2.at("010").at("SIC") == 1); + + // ; I004/000: =0x 06 + // ; Message Type: 6 (Clearance Level Adherence Monitor) + + loginf << "cat004 test #2: 000" << logendl; + REQUIRE(record2.at("000").at("Message Type") == 6); + + // ; I004/020: =0x 8a 05 00 + // ; Time of Day: 0x8a0500 (9045248; 70666.000000 secs; 19:37:46.000 UTC) + + loginf << "cat004 test #2: 020" << logendl; + REQUIRE(record2.at("020").at("TIME OF MESSAGE") == 70666.0); + + // ; I004/040: =0x 3c 88 + // ; Alert Identifier: 15496 + + loginf << "cat004 test #2: 040" << logendl; + REQUIRE(record2.at("040").at("Alert Identifier") == 15496); + + // ; I004/030: =0x 0b d3 + // ; Track Number 1: 3027 + + loginf << "cat004 test #2: 030" << logendl; + REQUIRE(record2.at("030").at("Track Number 1") == 3027); + + // ---------------------------------- + // --- third frame = STCA + // ---------------------------------- + + const json& third_data_block = json_data->at("data_blocks").at(2); + + REQUIRE(third_data_block.contains("category")); + REQUIRE(third_data_block.at("category") == 4); + REQUIRE(third_data_block.contains("length")); + REQUIRE(third_data_block.at("length") == 20); + + loginf << "cat004 test #3: num records" << logendl; + REQUIRE(third_data_block.contains("content")); + REQUIRE(third_data_block.at("content").contains("records")); + REQUIRE(third_data_block.at("content").at("records").is_array()); + REQUIRE(third_data_block.at("content").at("records").size() == 1); + + const json& record3 = third_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x dd a1 40 + // 11011101 10100001 01000000 + + loginf << "cat004 test #3: fspec" << logendl; + REQUIRE(record3.at("FSPEC").size() == 3 * 8); + + REQUIRE(record3.at("FSPEC") == + std::vector({1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, + 0, 1, 0, 0, 0, 0, 0, 0})); + + // ; I004/010: =0x 00 01 + // ; Data Source Identifier: 0x0001 (SAC=0; SIC=1) + + loginf << "cat004 test #3: 010" << logendl; + REQUIRE(record3.at("010").at("SAC") == 0); + REQUIRE(record3.at("010").at("SIC") == 1); + + // ; I004/000: =0x 07 + // ; Message Type: 7 (Short Term Conflict Alert) + + loginf << "cat004 test #3: 000" << logendl; + REQUIRE(record3.at("000").at("Message Type") == 7); + + // ; I004/020: =0x 8a 01 00 + // ; Time of Day: 0x8a0100 (9044224; 70658.000000 secs; 19:37:38.000 UTC) + + loginf << "cat004 test #3: 020" << logendl; + REQUIRE(record3.at("020").at("TIME OF MESSAGE") == 70658.0); + + // ; I004/040: =0x 3c 89 + // ; Alert Identifier: 15497 + + loginf << "cat004 test #3: 040" << logendl; + REQUIRE(record3.at("040").at("Alert Identifier") == 15497); + + // ; I004/045: =0x 06 + // ; Alert Status: 3 + + loginf << "cat004 test #3: 045" << logendl; + REQUIRE(record3.at("045").at("Alert status") == 3); + + // ; I004/030: =0x 0c 3a + // ; Track Number 1: 3130 + + loginf << "cat004 test #3: 030" << logendl; + REQUIRE(record3.at("030").at("Track Number 1") == 3130); + + // ; I004/035: =0x 09 71 + // ; Track Number 2: 2417 + + loginf << "cat004 test #3: 035" << logendl; + REQUIRE(record3.at("035").at("Track Number 2") == 2417); +} + +TEST_CASE("jASTERIX CAT004 1.4", "[jASTERIX CAT004]") +{ + loginf << "cat004 test: start" << logendl; + + jASTERIX::jASTERIX jasterix(definition_path, true, true, false); + + // 04000bd20001010586800e04000fd9800001068a05003c880bd3040014dda1400001078a01003c89060c3a000971 + // echo -n + // 04000bd20001010586800e04000fd9800001068a05003c880bd3040014dda1400001078a01003c89060c3a000971c + // | xxd -r -p > cat004ed1.4.bin + + REQUIRE(jasterix.hasCategory(4)); + std::shared_ptr cat004 = jasterix.category(4); + REQUIRE(cat004->hasEdition("1.4")); + cat004->setCurrentEdition("1.4"); + cat004->setCurrentMapping(""); + + const std::string filename = "cat004ed1.4.bin"; + + REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 46); + + jasterix.decodeFile(data_path + filename, test_cat004_callback); + + loginf << "cat004 ed 1.4 test: end" << logendl; +} From e07ae1714e81f46215605253e7fe13e32ab2cbb0 Mon Sep 17 00:00:00 2001 From: alex-scp Date: Fri, 11 Dec 2020 19:53:50 +0000 Subject: [PATCH 07/13] added category 030 --- definitions/categories/030/cat030_7.0.json | 1739 ++++++++++++++++++++ definitions/categories/categories.json | 14 + src/test/CMakeLists.txt | 1 + src/test/cat030ed7.0.bin | Bin 0 -> 64 bytes src/test/test_cat030_7.0.cpp | 467 ++++++ 5 files changed, 2221 insertions(+) create mode 100644 definitions/categories/030/cat030_7.0.json create mode 100644 src/test/cat030ed7.0.bin create mode 100644 src/test/test_cat030_7.0.cpp diff --git a/definitions/categories/030/cat030_7.0.json b/definitions/categories/030/cat030_7.0.json new file mode 100644 index 0000000..fa7cf12 --- /dev/null +++ b/definitions/categories/030/cat030_7.0.json @@ -0,0 +1,1739 @@ +{ + "name":"cat030_7.0_record", + "type":"record", + "field_specification":{ + "name":"FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "uap":[ + "010", + "015", + "030", + "035", + "040", + "070", + "170", + "FX", + "100", + "180", + "181", + "060", + "150", + "130", + "160", + "FX", + "080", + "090", + "200", + "220", + "240", + "290", + "260", + "FX", + "360", + "140", + "340", + "SP", + "390", + "400", + "410", + "FX", + "440", + "450", + "435", + "430", + "460", + "480", + "420", + "FX", + "490", + "020", + "382", + "384", + "386", + "110", + "190", + "FX", + "191", + "135", + "165", + "230", + "250", + "210", + "120", + "FX", + "050", + "270", + "370", + "-", + "-", + "-", + "RE", + "FX" + ], + "items":[ + { + "number":"010", + "name":"SERVER IDENTIFICATION TAG", + "comment":"Identification of the Server of track information.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"Source Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"Source Identity Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"015", + "name":"USER NUMBER", + "comment":"Identification of the User of track information", + "type":"item", + "data_fields":[ + { + "name":"USER NUMBER", + "comment":"User number (0 => 16#FFFF#)", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"020", + "name":"TIME OF MESSAGE", + "comment":"Absolute time stamping of the message in the form of elapsed time since last midnight", + "type":"item", + "data_fields":[ + { + "name":"TIME OF MESSAGE", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"030", + "name":"SERVICE IDENTIFICATION", + "comment":"Identification of the service(s) to which a track message belongs.", + "type":"item", + "data_fields":[ + { + "name":"SERVICE IDENTIFICATION", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"BS", + "comment":"1 Track selected by the Background service", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"C1", + "comment":"1 Track selected by the Complementary service 1", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"SERVICE IDENTIFICATION First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"C2", + "comment":"1 Track selected by the Complementary service 2", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"C3", + "comment":"1 Track selected by the Complementary service 3", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"C4", + "comment":"1 Track selected by the Complementary service 4", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"C5", + "comment":"1 Track selected by the Complementary service 5", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"035", + "name":"TYPE OF MESSAGE", + "comment":"This data item allows for a more convenient handling of the message at the receiver side by further defining the type of transaction.", + "type":"item", + "data_fields":[ + { + "name":"TYPE OF MESSAGE", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"FAMILY", + "comment":"FAMILY to which the message belongs", + "type":"fixed_bits", + "start_bit":4, + "bit_length":4 + }, + { + "name":"NATURE", + "comment":"NATURE of the message within its FAMILY", + "type":"fixed_bits", + "start_bit":0, + "bit_length":4 + } + ] + } + ] + }, + { + "number":"040", + "name":"TRACK NUMBER", + "comment":"Identification of a track", + "type":"item", + "data_fields":[ + { + "name":"TRACK NUMBER", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"sttn", + "comment":"track numbering indicator, value is changed when the track numbering is restarted.", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"TRACK NUMBER", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":0, + "bit_length":12 + } + ] + } + ] + }, + { + "number":"050", + "name":"ARTAS TRACK NUMBER", + "comment":"Identification of an ARTAS track", + "type":"item", + "data_fields":[ + { + "name":"ARTAS TRACK NUMBER", + "type":"fixed_bitfield", + "length":3, + "items":[ + { + "name":"ARTAS UNIT IDENTIFICATION", + "comment":"0 to 255", + "type":"fixed_bits", + "start_bit":13, + "bit_length":11 + }, + { + "name":"SYSTEM TRACK NUMBER", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":1, + "bit_length":12 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ARTAS TRACK NUMBER First Extent", + "type":"fixed_bitfield", + "length":3, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"UNIT a IDENT", + "comment":"0 to 255", + "type":"fixed_bits", + "start_bit":13, + "bit_length":11 + }, + { + "name":"SYSTEM TRACK NUMBER IN UNIT a", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":1, + "bit_length":12 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ARTAS TRACK NUMBER Second Extent", + "type":"fixed_bitfield", + "length":3, + "optional":true, + "optional_variable_name":"FX2", + "optional_variable_value":1, + "items":[ + { + "name":"UNIT b IDENT", + "comment":"0 to 255", + "type":"fixed_bits", + "start_bit":13, + "bit_length":11 + }, + { + "name":"SYSTEM TRACK NUMBER IN UNIT b", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":1, + "bit_length":12 + }, + { + "name":"FX3", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ARTAS TRACK NUMBER Third Extent", + "type":"fixed_bitfield", + "length":3, + "optional":true, + "optional_variable_name":"FX3", + "optional_variable_value":1, + "items":[ + { + "name":"UNIT c IDENT", + "comment":"0 to 255", + "type":"fixed_bits", + "start_bit":13, + "bit_length":11 + }, + { + "name":"SYSTEM TRACK NUMBER IN UNIT c", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":1, + "bit_length":12 + }, + { + "name":"FX4", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ARTAS TRACK NUMBER Fourth Extent", + "type":"fixed_bitfield", + "length":3, + "optional":true, + "optional_variable_name":"FX4", + "optional_variable_value":1, + "items":[ + { + "name":"UNIT d IDENT", + "comment":"0 to 255", + "type":"fixed_bits", + "start_bit":13, + "bit_length":11 + }, + { + "name":"SYSTEM TRACK NUMBER IN UNIT d", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":1, + "bit_length":12 + }, + { + "name":"FX5", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ARTAS TRACK NUMBER Fifth Extent", + "type":"fixed_bitfield", + "length":3, + "optional":true, + "optional_variable_name":"FX5", + "optional_variable_value":1, + "items":[ + { + "name":"UNIT e IDENT", + "comment":"0 to 255", + "type":"fixed_bits", + "start_bit":13, + "bit_length":11 + }, + { + "name":"SYSTEM TRACK NUMBER IN UNIT e", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":1, + "bit_length":12 + }, + { + "name":"FX6", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ARTAS TRACK NUMBER Sixth Extent", + "type":"fixed_bitfield", + "length":3, + "optional":true, + "optional_variable_name":"FX6", + "optional_variable_value":1, + "items":[ + { + "name":"UNIT f IDENT", + "comment":"0 to 255", + "type":"fixed_bits", + "start_bit":13, + "bit_length":11 + }, + { + "name":"SYSTEM TRACK NUMBER IN UNIT f", + "comment":"0 to 4095", + "type":"fixed_bits", + "start_bit":1, + "bit_length":12 + }, + { + "name":"FX7", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"060", + "name":"TRACK MODE 3/A", + "comment":"Mode 3/A identity associated to the track", + "type":"item", + "data_fields":[ + { + "name":"Mode 3/A", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled Code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"C", + "comment":"Change in Mode 3/A\n0 No Change\n1 Mode 3/A has changed", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Mode 3/A Code", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "number":"070", + "name":"TIME OF LAST UPDATE", + "comment":"Absolute time stamping of the information provided in the track message, in the form of elapsed time since last midnight.", + "type":"item", + "data_fields":[ + { + "name":"TIME OF LAST UPDATE", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"080", + "name":"ARTAS TRACK STATUS", + "comment":"Status of an ARTAS track.", + "type":"item", + "data_fields":[ + { + "name":"ARTAS TRACK STATUS", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"LIV", + "comment":"0 Live target\n1 Simulated or test target track", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"CNF", + "comment":"0 Confirmed track\n1 Tentative track", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"ADD", + "comment":"0 track not updated using Aircraft Derived Data\n1 track updated using Aircraft Derived Data", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"CST", + "comment":"0 non-coasted track\n1 coasted track", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"TYPE", + "comment":"000 both PR and SSR Multiradar track\n001 PR only Multiradar track\n010 SSR only Multiradar track\n011 not used\n100 combined (P+S) monoradar track\n101 PR monoradar track\n110 SSR monoradar track\n111 not used", + "type":"fixed_bits", + "start_bit":1, + "bit_length":3 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Track Status First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"TRM", + "comment":"0 default value\n1 track TERMINATED", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"CRE", + "comment":"0 default value\n1 track CREATED", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"SLR", + "comment":"0 slant range corrected track coordinates using tracked MODE C information.\n1 slant range corrected track coordinates using triangulated track height or height derived from coverage\n2 slant range correction using assumed height\n3 non slant range corrected track coordinates", + "type":"fixed_bits", + "start_bit":4, + "bit_length":2 + }, + { + "name":"COR", + "comment":"000 confirmed flight plan to track correlation\n001 type 1 correlation\n010 type 2 correlation\n011 type 3 correlation\n100 type 4 correlation\n101 type 5 correlation\n110 type 6 correlation\n111 track not correlated to a flight plan", + "type":"fixed_bits", + "start_bit":1, + "bit_length":3 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Track Status Second Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX2", + "optional_variable_value":1, + "items":[ + { + "name":"FOR", + "comment":"0 default\n1 Formation flight", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"AMA", + "comment":"0 amalgamated track\n1 non amalgamated track", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"SPI", + "comment":"0 default value\n1 Special Position Indication in the last SSR plot that was used to update the track", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"ME", + "comment":"0 default value\n1 Military Emergency", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"TDC", + "comment":"0 Accurate estimation of the track Transponder Delay enabling correction of the plots associated to the track\n1 Estimation of the track Transponder Delay not accurate enough to enable the plots correction", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX3", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Track Status Third Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX3", + "optional_variable_value":1, + "items":[ + { + "name":"SF", + "comment":"0 Track position coding precision (1/64 NM)\n1 Track position coding precision = 1/32 NM", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"FX4", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"090", + "name":"ARTAS TRACK QUALITY", + "comment":"ARTAS track quality.", + "type":"item", + "data_fields":[ + { + "name":"ARTAS TRACK QUALITY", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"Quality", + "comment":"ARTAS track quality = 0 (low quality) to 7 (high quality)", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":3 + } + ] + } + ] + }, + { + "number":"100", + "name":"CALCULATED TRACK POSITION (CARTESIAN)", + "comment":"Calculated position of an aircraft expressed in Cartesian coordinates.", + "type":"item", + "data_fields":[ + { + "name":"X-Component", + "comment":"unit: NM, NOTE: LSB is set considering f=0 (I252/340)", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.015625 + }, + { + "name":"Y-Component", + "comment":"unit: NM, NOTE: LSB is set considering f=0 (I252/340)", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.015625 + } + ] + }, + { + "number":"110", + "name":"ESTIMATED ACCURACY OF TRACK POSITION (CARTESIAN)", + "comment":"Estimated accuracy (i.e. standard deviation) of the calculated position of an aircraft expressed in Cartesian coordinates.", + "type":"item", + "data_fields":[ + { + "name":"X-Component accuracy", + "comment":"unit: NM, NOTE: LSB is set considering f=0 (I252/340)", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.015625 + }, + { + "name":"Y-Component accuracy", + "comment":"unit: NM, NOTE: LSB is set considering f=0 (I252/340)", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.015625 + } + ] + }, + { + "number":"120", + "name":"TRACK MODE 2 CODE", + "comment":"Mode 2 identification associated to the track", + "type":"item", + "data_fields":[ + { + "name":"TRACK MODE 2 CODE", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled Code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"C", + "comment":"Change in Mode 2\n0 No Change\n1 Mode 2 has changed", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Mode 2 reply", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "number":"130", + "name":"CALCULATED TRACK ALTITUDE", + "comment":"Calculated altitude of an aircraft.", + "type":"item", + "data_fields":[ + { + "name":"CALCULATED TRACK ALTITUDE", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"SRC", + "comment":"0 3D height\n1 Triangulated height\n2 Height derived from coverage\n3 Assumed height", + "type":"fixed_bits", + "start_bit":14, + "bit_length":2 + }, + { + "name":"ALTITUDE", + "comment":"calculated track altitude. unit: feet", + "type":"fixed_bits", + "data_type":"int", + "start_bit":0, + "bit_length":14, + "lsb":25 + } + ] + } + ] + }, + { + "number":"135", + "name":"ESTIMATED ACCURACY OF TRACK ALTITUDE", + "comment":"Estimated accuracy (i.e. standard deviation) of the calculated altitude of an aircraft.", + "type":"item", + "data_fields":[ + { + "name":"ALTITUDE ACCURACY", + "comment":"unit: feet", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":25 + } + ] + }, + { + "number":"140", + "name":"LAST MEASURED MODE C", + "comment":"Mode C code of the last nearest neighbour plot containing a Mode C and used to update the track.", + "type":"item", + "data_fields":[ + { + "name":"LAST MEASURED MODE C", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"VAL", + "comment":"0 valid Mode C code\n1 invalid Mode C code", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"GC", + "comment":"0 default value\n1 garbled information", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"MODE C", + "comment":"Vmin = -12 FL = -1200 ft; Vmax = 1270 FL = 127000 ft", + "type":"fixed_bits", + "data_type":"int", + "start_bit":0, + "bit_length":14, + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"150", + "name":"MEASURED TRACK MODE C", + "comment":"Last validated and credible Mode C value used to update the track.", + "type":"item", + "data_fields":[ + { + "name":"MEASURED TRACK MODE C", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"MODE C", + "comment":"Vmin = -12 FL = -1200 ft; Vmax = 1270 FL = 127000 ft", + "type":"fixed_bits", + "data_type":"int", + "start_bit":0, + "bit_length":14, + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"160", + "name":"CALCULATED TRACK FLIGHT LEVEL", + "comment":"Calculated Flight Level of the track (isobar).", + "type":"item", + "data_fields":[ + { + "name":"CALCULATED TRACK FLIGHT LEVEL", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"QNC", + "comment":"0 FL calculated without QNH correction\n1 FL calculated with QNH correction", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"TRACK FLIGHT LEVEL", + "comment":"Vmin = -15 FL = -1500 ft; Vmax = 15000 FL = 150000 ft", + "type":"fixed_bits", + "data_type":"int", + "start_bit":0, + "bit_length":14, + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"165", + "name":"ESTIMATED ACCURACY OF CALCULATED TRACK FLIGHT LEVEL", + "comment":"Estimated accuracy (i.e. standard deviation) of the calculated Flight Level of the track (isobar).", + "type":"item", + "data_fields":[ + { + "name":"CALCULATED TRACK FLIGHT LEVEL ACCURACY", + "comment":"unit: FL", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.25 + } + ] + }, + { + "number":"170", + "name":"TRACK AGES", + "comment":"A set of track related ages.", + "type":"item", + "data_fields":[ + { + "name":"PSR", + "comment":"Age of the last primary plot/local track used to update the track. maximum value = 63.75 s", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + }, + { + "name":"SSR", + "comment":"Age of the last secondary plot/local track used to update the track. maximum value = 63.75 s", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + }, + { + "name":"AMODE", + "comment":"Age of the last detection of the mode A contained in the track mode A item I030/060. maximum value = 63.75 s", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + }, + { + "name":"CMODE", + "comment":"Age of the last valid and credible mode C used to update the track, contained in I030/150. maximum value = 63.75 s", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + } + ] + }, + { + "number":"180", + "name":"CALCULATED TRACK VELOCITY (POLAR)", + "comment":"Calculated track velocity expressed in polar coordinates.", + "type":"item", + "data_fields":[ + { + "name":"SPEED", + "comment":"Maximum value = 2 NM/s = 7200 kt", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.00006103515 + }, + { + "name":"HEADING", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"181", + "name":"CALCULATED TRACK VELOCITY (CARTESIAN)", + "comment":"Calculated track velocity expressed in Cartesian coordinates.", + "type":"item", + "data_fields":[ + { + "name":"X-VELOCITY COMPONENT", + "comment":"Maximum value = 2 NM/s = 7200 kt", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.00006103515 + }, + { + "name":"Y-VELOCITY COMPONENT", + "comment":"Maximum value = 2 NM/s = 7200 kt", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.00006103515 + } + ] + }, + { + "number":"190", + "name":"ESTIMATED ACCURACY OF TRACK VELOCITY (POLAR)", + "comment":"", + "type":"item", + "data_fields":[ + { + "name":"SPEED COMPONENT ACCURACY", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00006103515 + }, + { + "name":"HEADING COMPONENT ACCURACY", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"191", + "name":"ESTIMATED ACCURACY OF TRACK VELOCITY (CARTESIAN)", + "comment":"Estimated accuracy (i.e. standard deviation) of the calculated track velocity expressed in Cartesian coordinates.", + "type":"item", + "data_fields":[ + { + "name":"X-velocity component accuracy", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00006103515 + }, + { + "name":"Y-velocity component accuracy", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00006103515 + } + ] + }, + { + "number":"200", + "name":"MODE OF FLIGHT", + "comment":"Calculated Mode-of-Flight of an aircraft.", + "type":"item", + "data_fields":[ + { + "name":"Mode of Movement", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"TRANS", + "comment":"Transversal Acceleration :\n0 Constant Course\n1 Right Turn\n2 Left Turn\n3 Undetermined", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"LONGI", + "comment":"Longitudinal Acceleration :\n0 Constant Groundspeed\n1 Increasing Groundspeed\n2 Decreasing Groundspeed\n3 Undetermined", + "type":"fixed_bits", + "start_bit":4, + "bit_length":2 + }, + { + "name":"VERTI", + "comment":"Vertical Rate :\n0 Level\n1 Climb\n2 Descent\n3 Undetermined", + "type":"fixed_bits", + "start_bit":2, + "bit_length":2 + } + ] + } + ] + }, + { + "number":"210", + "name":"MODE OF FLIGHT PROBABILITIES", + "comment":"Probabilities attached to the Transversal, longitudinal and Vertical components of a calculated Mode-of-Flight.", + "type":"item", + "data_fields":[ + { + "name":"TCPROB", + "comment":"probability associated to the assessment of the Transversal Acceleration Mode-of-Flight Component", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.5 + }, + { + "name":"LCPROB", + "comment":"probability associated to the assessment of the Longitudinal Acceleration Mode-of-Flight Component", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.5 + }, + { + "name":"VCPROB", + "comment":"probability associated to the assessment of the Vertical Acceleration Mode-of-Flight Component", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.5 + } + ] + }, + { + "number":"220", + "name":"CALCULATED RATE OF CLIMB/DESCENT", + "comment":"Calculated rate of Climb/Descent of an aircraft.", + "type":"item", + "data_fields":[ + { + "name":"RATE OF C/D", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.0009765625 + } + ] + }, + { + "number":"230", + "name":"ESTIMATED ACCURACY OF RATE OF CLIMB/DESCENT", + "comment":"Estimated accuracy (i.e. standard deviation) of the calculated rate of Climb/Descent of an aircraft", + "type":"item", + "data_fields":[ + { + "name":"RATE OF C/D ESTIMATED ACCURACY", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.0009765625 + } + ] + }, + { + "number":"240", + "name":"CALCULATED RATE OF TURN", + "comment":"Calculated Rate of Turn expressed in degrees per second.", + "type":"item", + "data_fields":[ + { + "name":"CALCULATED RATE OF TURN", + "comment":"Maximum value = 32 deg/s", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"250", + "name":"ESTIMATED ACCURACY OF RATE OF TURN", + "comment":"Estimated accuracy (i.e. standard deviation) of a calculated Rate of Turn expressed in degrees per second", + "type":"item", + "data_fields":[ + { + "name":"ESTIMATED ACCURACY OF RATE OF TURN", + "comment":"Maximum value = 64 deg/s", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + } + ] + }, + { + "number":"260", + "name":"RADAR IDENTIFICATION TAG", + "comment":"Identification of the radar station from which has been received the last plot/local track used to update an ARTAS track.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"Source Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"Source Identity Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"270", + "name":"LOCAL TRACK NUMBER", + "comment":"The local track number is an integer value representing a unique reference to a track record within a particular track file e.g. the track data-base of a radar local tracker.", + "type":"item", + "data_fields":[ + { + "name":"LOCAL TRACK NUMBER", + "comment":"Maximum value = 65535", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"290", + "name":"PLOT AGES", + "comment":"A set of plot related ages.", + "type":"item", + "data_fields":[ + { + "name":"AMODE", + "comment":"Age of the last mode A used to update the track and contained in item I030/340. maximum value = 63.75 s", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + }, + { + "name":"CMODE", + "comment":"Age of the last mode C used to update the track and contained in I030/140. maximum value = 63.75 s", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + } + ] + }, + { + "number":"340", + "name":"LAST MEASURED MODE 3/A", + "comment":"Mode 3/A of the last nearest neighbour plot containing a mode 3/A and used to update the track.", + "type":"item", + "data_fields":[ + { + "name":"Mode 3/A", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled Code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 MODE 3/A code as derived from the reply of the transponder\n1 Smoothed MODE 3/A code as provided by a local tracker", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Mode 3/A Code", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "number":"360", + "name":"MEASURED POSITION", + "comment":"Measured position of an aircraft in local polar coordinates (information provided in the last plot/local track used to update an ARTAS track).", + "type":"item", + "data_fields":[ + { + "name":"RHO", + "comment":"Measured distance", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.0078125 + }, + { + "name":"THETA", + "comment":"measured azimuth", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"370", + "name":"MEASURED 3-D HEIGHT", + "comment":"Height of an aircraft measured by a 3-D Radar (Information provided in the last plot/local track used to update an ARTAS track).", + "type":"item", + "data_fields":[ + { + "name":"HEIGHT", + "comment":"unit: FL", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.25 + } + ] + }, + { + "number":"382", + "name":"AIRCRAFT ADDRESS", + "comment":"technical Mode-S address used for identification of an aircraft", + "type":"item", + "data_fields":[ + { + "name":"AIRCRAFT ADDRESS", + "comment":"24 bits Mode-S address", + "type":"fixed_bytes", + "length":3, + "data_type":"uint" + } + ] + }, + { + "number":"384", + "name":"AIRCRAFT IDENTIFICATION", + "comment":"Aircraft Identification (in 8 characters) obtained from an aircraft equipped with a Mode S transponder.", + "type":"item", + "data_fields":[ + { + "name":"ID", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"AIRCRAFT IDENTIFICATION", + "comment":"", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + }, + { + "number":"386", + "name":"COMMUNICATIONS CAPABILITY AND FLIGHT STATUS", + "comment":"Communications capability of the transponder and flight status.", + "type":"item", + "data_fields":[ + { + "name":"COMMUNICATIONS CAPABILITY AND FLIGHT STATUS", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"COM", + "comment":"0 no communications capability (surveillance only)\n1 Comm. A and Comm. B capability\n2 Comm. A, Comm. B and Uplink ELM\n3 Comm. A, Comm. B, Uplink ELM and Downlink ELM\n4 Level 5 Transponder capability.\n5/7 not assigned", + "type":"fixed_bits", + "start_bit":5, + "bit_length":3 + }, + { + "name":"STAT", + "comment":"0 no alert, no SPI, aircraft airborne\n1 no alert, no SPI, aircraft on ground\n2 alert, no SPI, aircraft airborne\n3 alert, no SPI, aircraft on ground\n4 alert, SPI, aircraft on ground or airborne\n5 no alert, SPI, aircraft on ground or airborne\n6/7 not assigned", + "type":"fixed_bits", + "start_bit":2, + "bit_length":3 + } + ] + } + ] + }, + { + "number":"390", + "name":"FPPS IDENTIFICATION TAG", + "comment":"Identification of the Flight Plan Data Processing System from which Flight-Plan related information are preferred by the User.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"Source Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"Source Identity Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"400", + "name":"CALLSIGN", + "comment":"Callsign (in 7 characters) of an aircraft (provided in the Miniplan).", + "type":"item", + "data_fields":[ + { + "name":"CALLSIGN", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"CALLSIGN", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + ] + }, + { + "number":"410", + "name":"PLN NUMBER", + "comment":"The PLN NUMBER is an integer value representing a unique reference to a Flight-plan record within a particular FPPS (Information provided in the miniplan).", + "type":"item", + "data_fields":[ + { + "name":"PLN NUMBER", + "comment":"Maximum value = 65535", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"420", + "name":"FLIGHT CATEGORY", + "comment":"Flight Category (information provided in the Miniplan).", + "type":"item", + "data_fields":[ + { + "name":"FLIGHT CATEGORY", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"GAT/OAT", + "comment":"0 Unknown\n1 General Air Traffic\n2 Operational Air Traffic\n3 Not applicable", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"FR1/FR2", + "comment":"0 Instrument Flight Rules\n1 Visual Flight Rules\n2 Not applicable\n3 Controlled Visual Flight Rules", + "type":"fixed_bits", + "start_bit":4, + "bit_length":2 + }, + { + "name":"SP3/SP2/SP1", + "comment":"These three bits allow for the definition of up to 7 sub-categories within the main categories.", + "type":"fixed_bits", + "start_bit":1, + "bit_length":3 + } + ] + } + ] + }, + { + "number":"430", + "name":"TYPE OF AIRCRAFT", + "comment":"Type of Aircraft indicated in a Miniplan.", + "type":"item", + "data_fields":[ + { + "name":"TYPE OF AIRCRAFT", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"TYPE OF AIRCRAFT", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":32, + "num_characters":4, + "character_bit_length":8 + } + ] + } + ] + }, + { + "number":"435", + "name":"CATEGORY OF TURBULENCE", + "comment":"Category of turbulence of an aircraft (information provided in the Miniplan).", + "type":"item", + "data_fields":[ + { + "name":"TURBULENCE CATEGORY", + "comment":"1001100 = L : Light\n1001101 = M : Medium\n1001000 = H : Heavy\n1001010 = J : Super", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"440", + "name":"DEPARTURE AIRPORT", + "comment":"Departure Airport indicated in a Miniplan.", + "type":"item", + "data_fields":[ + { + "name":"DEPARTURE AIRPORT", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"DEPARTURE AIRPORT", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":32, + "num_characters":4, + "character_bit_length":8 + } + ] + } + ] + }, + { + "number":"450", + "name":"DESTINATION AIRPORT", + "comment":"Destination Airport indicated in a Miniplan.", + "type":"item", + "data_fields":[ + { + "name":"DESTINATION AIRPORT", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"DESTINATION AIRPORT", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":32, + "num_characters":4, + "character_bit_length":8 + } + ] + } + ] + }, + { + "number":"460", + "name":"ALLOCATED SSR CODES", + "comment":"List of successive SSR codes allocated to a flight (Information provided in the miniplan).", + "type":"item", + "data_fields":[ + { + "name":"ALLOCATED SSR CODES", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"Mode 3/A", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"ALLOCATED SSR CODES", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + } + ] + }, + { + "number":"480", + "name":"CURRENT CLEARED FLIGHT LEVEL", + "comment":"Current Cleared Flight Level of an aircraft, provided by a FPPS.", + "type":"item", + "data_fields":[ + { + "name":"CURRENT CLEARED FLIGHT LEVEL", + "comment":"unit: FL", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"490", + "name":"CURRENT CONTROL POSITION", + "comment":"Identification of the Current Control Position in charge of an aircraft, as provided by a FPPS.", + "type":"item", + "data_fields":[ + { + "name":"CENTRE", + "comment":"8-bit group identification code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"POSITION", + "comment":"8-bit Control Position identification code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + } + ] +} diff --git a/definitions/categories/categories.json b/definitions/categories/categories.json index e881e04..6c5ba53 100755 --- a/definitions/categories/categories.json +++ b/definitions/categories/categories.json @@ -140,6 +140,20 @@ "mappings":{ } }, + "030":{ + "comment":"Category 030 APPLICATION OF ASTERIX TO ARTAS", + "default_edition":"7.0", + "default_mapping":"", + "editions":{ + "7.0":{ + "document":"DIS/SUR/ARTAS/ASTX.015", + "date":"06/01/2009", + "file":"030/cat030_7.0.json" + } + }, + "mappings":{ + } + }, "034":{ "comment":"Category 034 Transmission of Monoradar Service Messages", "default_edition":"1.26", diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index b1bd240..ae0a885 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -20,6 +20,7 @@ target_sources( test_categories "${CMAKE_CURRENT_LIST_DIR}/test_cat019_1.3.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat020_1.5.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat021_2.1.cpp" + "${CMAKE_CURRENT_LIST_DIR}/test_cat030_7.0.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat034_1.26.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat048_1.15.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat062_1.12.cpp" diff --git a/src/test/cat030ed7.0.bin b/src/test/cat030ed7.0.bin new file mode 100644 index 0000000000000000000000000000000000000000..0f61bb3410198322eb07fa38c241f6ffad665642 GIT binary patch literal 64 zcmb1RaQJ_B_d`ZU#s&sP1{D?t3CFB|%>UWhIe!N7?dOo4=EAav^@Qs}R(`<-1`uFM RiJDQ#dV*ySP#K%}IRJa@6Mp~z literal 0 HcmV?d00001 diff --git a/src/test/test_cat030_7.0.cpp b/src/test/test_cat030_7.0.cpp new file mode 100644 index 0000000..48fc680 --- /dev/null +++ b/src/test/test_cat030_7.0.cpp @@ -0,0 +1,467 @@ +/* + * This file is part of COMPASS. + * + * COMPASS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * COMPASS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with COMPASS. If not, see . + */ + +#include "catch.hpp" +#include "files.h" +#include "jasterix.h" +#include "logger.h" +#include "string_conv.h" +#include "test_jasterix.h" + +using namespace std; +using namespace nlohmann; + +void test_cat030_callback(std::unique_ptr json_data, size_t num_frames, + size_t num_records, size_t num_errors) +{ + loginf << "cat030 7.0 test: decoded " << num_frames << " frames, " << num_records + << " records, " << num_errors << " errors" << logendl; + + REQUIRE(num_frames == 0); + REQUIRE(num_records == 1); + REQUIRE(num_errors == 0); + + // { + // "data_blocks": [ + // { + // "category": 30, + // "content": { + // "index": 3, + // "length": 61, + // "records": [ + // { + // "010": { + // "SAC": 0, + // "SIC": 1 + // }, + // "015": { + // "USER NUMBER": 36 + // }, + // "020": { + // "TIME OF MESSAGE": 54780.0234375 + // }, + // "030": { + // "BS": 1, + // "C1": 0, + // "FX": 0 + // }, + // "035": { + // "FAMILY": 0, + // "NATURE": 0 + // }, + // "040": { + // "TRACK NUMBER": 2113, + // "sttn": 1 + // }, + // "050": { + // "ARTAS UNIT IDENTIFICATION": 48, + // "FX": 0, + // "SYSTEM TRACK NUMBER": 3047 + // }, + // "060": { + // "C": 0, + // "G": 0, + // "Mode 3/A Code": 2274, + // "V": 0 + // }, + // "070": { + // "TIME OF LAST UPDATE": 54780.0234375 + // }, + // "080": { + // "ADD": 0, + // "AMA": 1, + // "CNF": 0, + // "COR": 7, + // "CRE": 0, + // "CST": 0, + // "FOR": 0, + // "FX": 1, + // "FX2": 1, + // "FX3": 1, + // "FX4": 0, + // "LIV": 0, + // "ME": 0, + // "SF": 1, + // "SLR": 0, + // "SPI": 0, + // "TDC": 0, + // "TRM": 0, + // "TYPE": 2 + // }, + // "100": { + // "X-Component": -26.734375, + // "Y-Component": 58.984375 + // }, + // "130": { + // "ALTITUDE": 36025.0, + // "SRC": 1 + // }, + // "140": { + // "GC": 0, + // "MODE C": 370.0, + // "VAL": 0 + // }, + // "150": { + // "MODE C": 370.0 + // }, + // "170": { + // "AMODE": 1.75, + // "CMODE": 2.25, + // "PSR": 63.75, + // "SSR": 1.75 + // }, + // "180": { + // "HEADING": 211.31103506008, + // "SPEED": 0.12677000655 + // }, + // "200": { + // "LONGI": 0, + // "TRANS": 0, + // "VERTI": 0 + // }, + // "220": { + // "RATE OF C/D": 0.0 + // }, + // "240": { + // "CALCULATED RATE OF TURN": 0.0 + // }, + // "260": { + // "SAC": 0, + // "SIC": 2 + // }, + // "340": { + // "G": 0, + // "L": 0, + // "Mode 3/A Code": 2274, + // "V": 0 + // }, + // "360": { + // "RHO": 200.703125, + // "THETA": 214.41467275398 + // }, + // "FSPEC": [ + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // false, + // true, + // true, + // true, + // false, + // true, + // true, + // false, + // true, + // true, + // true, + // false, + // true, + // true, + // true, + // true, + // true, + // false, + // false, + // false, + // false, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // false, + // true, + // false, + // true, + // false, + // false, + // false, + // false, + // false, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // false, + // true, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // false + // ], + // "index": 3, + // "length": 61, + // "record_data": "ffddbbe10141018000010024040018416afe03ff070709f9510ebf081d964404bc05c845a1050f1180000000000002645a987905c804bc6afe030617ce" + // } + // ] + // }, + // "length": 64 + // } + // ], + // "rec_num": 0 + // } + + loginf << "cat030 7.0 test: data block" << logendl; + + REQUIRE(json_data->contains("data_blocks")); + REQUIRE(json_data->at("data_blocks").is_array()); + REQUIRE(json_data->at("data_blocks").size() == 1); + + const json& first_data_block = json_data->at("data_blocks").at(0); + + REQUIRE(first_data_block.contains("category")); + REQUIRE(first_data_block.at("category") == 30); + REQUIRE(first_data_block.contains("length")); + REQUIRE(first_data_block.at("length") == 64); + + loginf << "cat030 7.0 test: num records" << logendl; + REQUIRE(first_data_block.contains("content")); + REQUIRE(first_data_block.at("content").contains("records")); + REQUIRE(first_data_block.at("content").at("records").is_array()); + REQUIRE(first_data_block.at("content").at("records").size() == 1); + + const json& record = first_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x ff dd bb e1 01 41 01 80 + // 11111111 11011101 10111011 11100001 00000001 01000001 00000001 10000000 + + loginf << "cat030 7.0 test: fspec" << logendl; + REQUIRE(record.at("FSPEC").size() == 8 * 8); + + REQUIRE(record.at("FSPEC") == + std::vector({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, })); + + // ; I030/010: =0x 00 01 + // ; Server Identification Tag: 0x0001 (SAC=0; SIC=1) + + loginf << "cat030 7.0 test: 010" << logendl; + REQUIRE(record.at("010").at("SAC") == 0); + REQUIRE(record.at("010").at("SIC") == 1); + + // ; I030/015: =0x 00 24 + // ; User Number: 36 + + loginf << "cat030 7.0 test: 015" << logendl; + REQUIRE(record.at("015").at("USER NUMBER") == 36); + + // ; I030/030: =0x 04 + // ; Service Identification: BS + + loginf << "cat030 7.0 test: 030" << logendl; + REQUIRE(record.at("030").at("BS") == 1); + REQUIRE(record.at("030").at("C1") == 0); + + // ; I030/035: =0x 00 + // ; Type of Message: family=0; nature=0 + + loginf << "cat030 7.0 test: 035" << logendl; + REQUIRE(record.at("035").at("FAMILY") == 0); + REQUIRE(record.at("035").at("NATURE") == 0); + + // ; I030/040: =0x 18 41 + // ; Track Number: sttn=1; stn=2113 + + loginf << "cat030 7.0 test: 040" << logendl; + REQUIRE(record.at("040").at("sttn") == 1); + REQUIRE(record.at("040").at("TRACK NUMBER") == 2113); + + // ; I030/070: =0x 6a fe 03 + // ; Time of Last Update: 0x6afe03 (7011843; 15:13:00.023 UTC); tolu=54780.023438 + + loginf << "cat030 7.0 test: 070" << logendl; + REQUIRE(approximatelyEqual(record.at("070").at("TIME OF LAST UPDATE"), 54780.0234375, 10e-7)); + + // ; I030/170: =0x ff 07 07 09 + // ; Track Ages: PSR=255 (63.75 sec); SSR=7 (1.75 sec) + // ; amode=7 (1.75 sec); cmode=9 (2.25 sec) + + loginf << "cat030 7.0 test: 170" << logendl; + REQUIRE(record.at("170").at("AMODE") == 1.75); + REQUIRE(record.at("170").at("CMODE") == 2.25); + REQUIRE(record.at("170").at("PSR") == 63.75); + REQUIRE(record.at("170").at("SSR") == 1.75); + + // ; I030/100: =0x f9 51 0e bf + // ; Calculated Track Position: x=-1711 (-26.734 or -53.469 nmi); y=3775 (58.984 or 117.969 nmi) + + loginf << "cat030 7.0 test: 100" << logendl; + REQUIRE(approximatelyEqual(record.at("100").at("X-Component"), -26.734375, 10e-6)); + REQUIRE(approximatelyEqual(record.at("100").at("Y-Component"), 58.984375, 10e-6)); + + // ; I030/180: =0x 08 1d 96 44 + // ; Calculated Track Velocity: spd=2077 (456.372 kts); hdg=38468 (211.311 deg) + + loginf << "cat030 7.0 test: 180" << logendl; + REQUIRE(approximatelyEqual(record.at("180").at("HEADING"), 211.31103506008, 10e-11)); + REQUIRE(approximatelyEqual(record.at("180").at("SPEED"), 0.12677000655, 10e-11)); + + // ; I030/060: =0x 04 bc + // ; Track Mode 3/A: v=0; g=0; c=0; code=02274 + + loginf << "cat030 7.0 test: 060" << logendl; + REQUIRE(record.at("060").at("C") == 0); + REQUIRE(record.at("060").at("G") == 0); + REQUIRE(record.at("060").at("V") == 0); + REQUIRE(record.at("060").at("Mode 3/A Code") == 2274); + + // ; I030/150: =0x 05 c8 + // ; Measured Track Mode C: value=1480 (370.00 FL) + + loginf << "cat030 7.0 test: 150" << logendl; + REQUIRE(record.at("150").at("MODE C") == 370.0); + + // ; I030/130: =0x 45 a1 + // ; Calculated Track Altitude: src=1 (triangulated height); value=1441 (360.25 FL) + + loginf << "cat030 7.0 test: 130" << logendl; + REQUIRE(record.at("130").at("ALTITUDE") == 36025.0); + REQUIRE(record.at("130").at("SRC") == 1); + + // ; I030/080: =0x 05 0f 11 80 + // ; ARTAS Track Status: + // ; LIV CNF TYPE=2 (SSR only multiradar track) + // ; SLR=0 COR=7 + // ; AMA + // ; SF=1 (1/32 nmi) + + loginf << "cat030 7.0 test: 080" << logendl; + REQUIRE(record.at("080").at("ADD") == 0); + REQUIRE(record.at("080").at("AMA") == 1); + REQUIRE(record.at("080").at("CNF") == 0); + REQUIRE(record.at("080").at("COR") == 7); + REQUIRE(record.at("080").at("CRE") == 0); + REQUIRE(record.at("080").at("CST") == 0); + REQUIRE(record.at("080").at("FOR") == 0); + REQUIRE(record.at("080").at("LIV") == 0); + REQUIRE(record.at("080").at("ME") == 0); + REQUIRE(record.at("080").at("SF") == 1); + REQUIRE(record.at("080").at("SLR") == 0); + REQUIRE(record.at("080").at("SPI") == 0); + REQUIRE(record.at("080").at("TDC") == 0); + REQUIRE(record.at("080").at("TRM") == 0); + REQUIRE(record.at("080").at("TYPE") == 2); + + // ; I030/200: =0x 00 + // ; Mode of Flight: trans=0 (constant course) ; longi=0 (constant groundspeed) ; verti=0 (level flight) + + loginf << "cat030 7.0 test: 200" << logendl; + REQUIRE(record.at("200").at("LONGI") == 0); + REQUIRE(record.at("200").at("TRANS") == 0); + REQUIRE(record.at("200").at("VERTI") == 0); + + // ; I030/220: =0x 00 00 + // ; Calculated Rate of Climb/Descent: crocd=0 (0.00 ft/min) + + loginf << "cat030 7.0 test: 220" << logendl; + REQUIRE(record.at("220").at("RATE OF C/D") == 0.0); + + // ; I030/240: =0x 00 + // ; Calculated Rate of Turn: 0 (0.00 deg/sec) + + loginf << "cat030 7.0 test: 240" << logendl; + REQUIRE(record.at("240").at("CALCULATED RATE OF TURN") == 0.0); + + // ; I030/260: =0x 14 0a + // ; Radar Identification Tag: 0x0002 (SAC=0; SIC=2) + + loginf << "cat030 7.0 test: 260" << logendl; + REQUIRE(record.at("260").at("SAC") == 0); + REQUIRE(record.at("260").at("SIC") == 2); + + // ; I030/360: =0x 64 5a 98 79 + // ; Measured Position: rho=25690 (200.703 nmi); theta=39033 (214.415 deg) + + loginf << "cat030 7.0 test: 360" << logendl; + REQUIRE(approximatelyEqual(record.at("360").at("RHO"), 200.703125, 10e-6)); + REQUIRE(approximatelyEqual(record.at("360").at("THETA"), 214.41467275398, 10e-11)); + + // ; I030/140: =0x 05 c8 + // ; Last Measured Mode C: v=0; g=0; value=1480 (370.00 FL) + + loginf << "cat030 7.0 test: 140" << logendl; + REQUIRE(record.at("140").at("GC") == 0); + REQUIRE(record.at("140").at("VAL") == 0); + REQUIRE(record.at("140").at("MODE C") == 370.0); + + // ; I030/340: =0x 04 bc + // ; Last Measured Mode 3/A: v=0; g=0; l=0; code=02274 + + loginf << "cat030 7.0 test: 340" << logendl; + REQUIRE(record.at("340").at("G") == 0); + REQUIRE(record.at("340").at("L") == 0); + REQUIRE(record.at("340").at("V") == 0); + REQUIRE(record.at("340").at("Mode 3/A Code") == 2274); + + // ; I030/020: =0x 6a fe 03 + // ; Time of Message: 0x6afe03 (7011843; 15:13:00.023 UTC) + + loginf << "cat030 7.0 test: 020" << logendl; + REQUIRE(approximatelyEqual(record.at("020").at("TIME OF MESSAGE"), 54780.0234375, 10e-7)); + + // ; I030/050: 0x 06 17 ce + // ; ARTAS Track Number: unit=48; stnr=3047 + + loginf << "cat030 7.0 test: 050" << logendl; + REQUIRE(record.at("050").at("ARTAS UNIT IDENTIFICATION") == 48); + REQUIRE(record.at("050").at("SYSTEM TRACK NUMBER") == 3047); +} + +TEST_CASE("jASTERIX CAT030 7.0", "[jASTERIX CAT030]") +{ + loginf << "cat030 7.0 test: start" << logendl; + + jASTERIX::jASTERIX jasterix(definition_path, true, true, false); + + // ; ASTERIX data block at pos 0: cat=30; len=64 + // 1e0040ffddbbe10141018000010024040018416afe03ff070709f9510ebf081d964404bc05c845a1050f1180000000000002645a987905c804bc6afe030617ce + + // echo -n + // 1e0040ffddbbe10141018000010024040018416afe03ff070709f9510ebf081d964404bc05c845a1050f1180000000000002645a987905c804bc6afe030617ce + // | xxd -r -p > cat030ed7.0.bin + + REQUIRE(jasterix.hasCategory(30)); + std::shared_ptr cat030 = jasterix.category(30); + REQUIRE(cat030->hasEdition("7.0")); + cat030->setCurrentEdition("7.0"); + cat030->setCurrentMapping(""); + + const std::string filename = "cat030ed7.0.bin"; + + REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 64); + + jasterix.decodeFile(data_path + filename, test_cat030_callback); + + loginf << "cat030 7.0 test: end" << logendl; +} From 4c95c33661a864a023ea94fa3686c04f96cff6dc Mon Sep 17 00:00:00 2001 From: alex-scp Date: Sun, 20 Dec 2020 19:25:05 +0000 Subject: [PATCH 08/13] changes to be in accordance with the specs --- definitions/categories/021/cat021_2.1.json | 16 ++++++++++++---- definitions/categories/021/cat021_2.4.json | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/definitions/categories/021/cat021_2.1.json b/definitions/categories/021/cat021_2.1.json index b134b63..4e7f2d8 100644 --- a/definitions/categories/021/cat021_2.1.json +++ b/definitions/categories/021/cat021_2.1.json @@ -1203,10 +1203,18 @@ "data_fields":[ { "name":"Track Number", - "comment":"0...4095", - "type":"fixed_bytes", + "type":"fixed_bitfield", "length":2, - "data_type":"uint" + "items":[ + { + "name":"Track Number", + "comment":"TRACK NUMBER(0...4095)", + "type":"fixed_bits", + "start_bit":0, + "bit_length":12, + "data_type":"uint" + } + ] } ] }, @@ -1251,7 +1259,7 @@ "type":"fixed_bits", "data_type":"icao_characters", "start_bit":0, - "bit_length":47, + "bit_length":48, "num_characters":8, "character_bit_length":6 } diff --git a/definitions/categories/021/cat021_2.4.json b/definitions/categories/021/cat021_2.4.json index 6cab5a3..a4344b7 100644 --- a/definitions/categories/021/cat021_2.4.json +++ b/definitions/categories/021/cat021_2.4.json @@ -1210,10 +1210,18 @@ "data_fields":[ { "name":"Track Number", - "comment":"0...4095", - "type":"fixed_bytes", + "type":"fixed_bitfield", "length":2, - "data_type":"uint" + "items":[ + { + "name":"Track Number", + "comment":"TRACK NUMBER(0...4095)", + "type":"fixed_bits", + "start_bit":0, + "bit_length":12, + "data_type":"uint" + } + ] } ] }, @@ -1258,7 +1266,7 @@ "type":"fixed_bits", "data_type":"icao_characters", "start_bit":0, - "bit_length":47, + "bit_length":48, "num_characters":8, "character_bit_length":6 } From 5494861b8b923c9d051b7e13316484b5c06796df Mon Sep 17 00:00:00 2001 From: alex-scp Date: Tue, 22 Dec 2020 13:58:10 +0000 Subject: [PATCH 09/13] adding cat021 edition 0.26 --- definitions/categories/021/cat021_0.26.json | 1001 +++++++++++++++++++ definitions/categories/categories.json | 10 + src/test/CMakeLists.txt | 1 + src/test/cat021ed0.26.bin | Bin 0 -> 36 bytes src/test/test_cat021_0.26.cpp | 279 ++++++ 5 files changed, 1291 insertions(+) create mode 100644 definitions/categories/021/cat021_0.26.json create mode 100644 src/test/cat021ed0.26.bin create mode 100644 src/test/test_cat021_0.26.cpp diff --git a/definitions/categories/021/cat021_0.26.json b/definitions/categories/021/cat021_0.26.json new file mode 100644 index 0000000..c79f786 --- /dev/null +++ b/definitions/categories/021/cat021_0.26.json @@ -0,0 +1,1001 @@ +{ + "name":"cat021_0.26_record", + "type":"record", + "field_specification":{ + "name":"FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "uap":[ + "010", + "040", + "030", + "130", + "080", + "140", + "090", + "FX", + "210", + "230", + "145", + "150", + "151", + "152", + "155", + "FX", + "157", + "160", + "165", + "170", + "095", + "032", + "200", + "FX", + "020", + "220", + "146", + "148", + "110", + "070", + "131", + "FX", + "-", + "-", + "-", + "-", + "-", + "RE", + "SP", + "FX" + ], + "items":[ + { + "number":"010", + "name":"Data Source Identification", + "comment":"Identification of the ADS-B station providing information.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"System Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"System Identification Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"020", + "name":"Emitter Category", + "comment":"Characteristics of the originating ADS-B unit.", + "type":"item", + "data_fields":[ + { + "name":"ECAT", + "comment":"1 light aircraft <= 7000 kg\n2 reserved\n3 7000 kg < medium aircraft < 136000 kg\n4 reserved\n5 136000 kg <= heavy aircraft\n6 highly manoeuvrable (5g acceleration capability) and high speed (>400 knots cruise)\n7 reserved\n8 reserved\n9 reserved\n10 rotocraft\n11 glider / sailplane\n12 lighter-than-air\n13 unmanned aerial vehicle\n14 space / transatmospheric vehicle\n15 ultralight / handglider / paraglider\n16 parachutist / skydiver\n17 reserved\n18 reserved\n19 reserved\n20 surface emergency vehicle\n21 surface service vehicle\n22 fixed ground or tethered obstruction\n23 reserved\n24 reserved", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"030", + "name":"Time of Day", + "comment":"Time of applicability of the reported position, in the form of elapsed time since last midnight, expressed as UTC.", + "type":"item", + "data_fields":[ + { + "name":"Time of Day", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"032", + "name":"Time of Day Accuracy", + "comment":"The maximum difference between the actual time of applicability of the reported position and the time reported in the Time of Day item (I021/030).", + "type":"item", + "data_fields":[ + { + "name":"Time of Day Accuracy", + "comment":"", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.00390625 + } + ] + }, + { + "number":"040", + "name":"Target Report Descriptor", + "comment":"Type and characteristics of the data as transmitted by a system.", + "type":"item", + "data_fields":[ + { + "name":"", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"DCR", + "comment":"Differential Correction\n0 No differential correction (ADS-B)\n1 Differential correction (ADS-B)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"GBS", + "comment":"Ground Bit Setting\n0 Ground Bit not set\n1 Ground Bit set", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"SIM", + "comment":"Simulated Target\n0 Actual target report\n1 Simulated target report", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"TST", + "comment":"Test Target\n0 Default\n1 Test Target", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"RAB", + "comment":"Report Type\n0 Report from target transponder\n1 Report from field monitor(fixed transponder)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"SAA", + "comment":"Selected Altitude Available\n0 Equipment capable to provide Selected\n1 Altitude Equipment not capable to provide Selected Altitude", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"SPI", + "comment":"0 Absence of SPI\n1 Special Position Identification", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"ATP", + "comment":"Address Type\n0 Non unique address\n1 24-Bit ICAO address\n2 Surface vehicle address\n3 Anonymous address\n4 Reserved for future use\n5 Reserved for future use\n6 Reserved for future use\n7 Reserved for future use", + "type":"fixed_bits", + "start_bit":5, + "bit_length":3 + }, + { + "name":"ARC", + "comment":"Altitude Reporting Capability\n0 Unknown\n1 25 ft\n2 100 ft\n3 undefined", + "type":"fixed_bits", + "start_bit":3, + "bit_length":2 + } + ] + } + ] + }, + { + "number":"070", + "name":"Mode 3/A Code in Octal Representation", + "comment":"Mode-3/A code converted into octal representation.", + "type":"item", + "data_fields":[ + { + "name":"mode-3/a", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 Mode-3/A code derived during last update\n1 Mode-3/A code not extracted during the last update", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Mode-3/A reply", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "number":"080", + "name":"Target Address", + "comment":"Target address (emitter identifier) assigned uniquely to each target.", + "type":"item", + "data_fields":[ + { + "name":"Target Address", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint" + } + ] + }, + { + "number":"090", + "name":"Figure of Merit", + "comment":"ADS figure of merit (FOM) provided by the aircraft avionics", + "type":"item", + "data_fields":[ + { + "name":"Figure of Merit", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"AC", + "comment":"00 unknown\n01 ACAS not operational\n10 ACAS operational\n11 invalid", + "type":"fixed_bits", + "start_bit":14, + "bit_length":2 + }, + { + "name":"MN", + "comment":"00 unknown\n01 Multiple navigational aids not operating\n10 Multiple navigational aids operating\n11 invalid", + "type":"fixed_bits", + "start_bit":12, + "bit_length":2 + }, + { + "name":"DC", + "comment":"00 unknown\n01 Differential correction\n10 No differential correction\n11 invalid", + "type":"fixed_bits", + "start_bit":10, + "bit_length":2 + }, + { + "name":"PA", + "comment":"Position Accuracy", + "type":"fixed_bits", + "start_bit":0, + "bit_length":4 + } + ] + } + ] + }, + { + "number":"095", + "name":"Velocity Accuracy", + "comment":"Velocity uncertainty category of the least accurate velocity component", + "type":"item", + "data_fields":[ + { + "name":"Velocity Uncertainty Category", + "comment":"\"Navigational Uncertainty Categories - Velocity\" as described in the ADS-B MASPS", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"110", + "name":"Trajectory Intent", + "comment":"", + "type":"item", + "data_fields":[ + { + "name":"Trajectory Intent", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"TIS", + "comment":"", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Trajectory Intent Status", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"NAV", + "comment":"0 Trajectory Intent Data is available for this aircraft\n1 Trajectory Intent Data is not available for this aircraft", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"NVB", + "comment":"0 Trajectory Intent Data is valid\n1 Trajectory Intent Data is not valid", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"TID", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"rep", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"TID1", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"TCA", + "comment":"0 TCP number available\n1 TCP number not available", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"NC", + "comment":"0 TCP compliance\n1 TCP non-compliance", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"TCP number", + "comment":"Trajectory Change Point number", + "type":"fixed_bits", + "start_bit":0, + "bit_length":6 + } + ] + }, + { + "name":"Altitude", + "comment":"Altitude in two’s complement form\n-1500 ft <= altitude <= 150000 ft", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":10.0 + }, + { + "name":"Latitude", + "comment":"In WGS.84 in two’s complement.\n-90 <= latitude <= 90 deg.", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.00002145767 + }, + { + "name":"Longitude", + "comment":"In WGS.84 in two’s complement.\n-180 <= longitude < 180", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.00002145767 + }, + { + "name":"TID2", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"Point Type", + "comment":"0 Unknown\n1 Fly by waypoint (LT)\n2 Fly over waypoint (LT)\n3 Hold pattern (LT)\n4 Procedure hold (LT)\n5 Procedure turn (LT)\n6 RF leg (LT)\n7 Top of climb (VT)\n8 Top of descent (VT)\n9 Start of level (VT)\n10 Cross-over altitude (VT)\n11 Transition altitude (VT)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":4 + }, + { + "name":"TD", + "comment":"0 N/A\n1 Turn right\n2 Turn left\n3 No turn", + "type":"fixed_bits", + "start_bit":2, + "bit_length":2 + }, + { + "name":"TRA", + "comment":"Turn Radius Availabilty\n0 TTR not available\n1 TTR available", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"TOA", + "comment":"0 TOV available\n1 TOV not available", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"TOV", + "comment":"Time Over Point", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":1.0 + }, + { + "name":"TTR", + "comment":"TCP Turn radius\n0 <= TTR <= 655.35 Nm", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.01 + } + ] + } + ] + } + ] + } + ] + }, + { + "number":"130", + "name":"Position in WGS-84 Co-ordinates", + "comment":"Calculated Position in WGS-84 Co-ordinates with a resolution of 180/2**25. degrees", + "type":"item", + "data_fields":[ + { + "name":"Latitude", + "comment":"In WGS.84 in two’s complement.\nRange -90 <= latitude <= 90 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.000005364418 + }, + { + "name":"Longitude", + "comment":"In WGS.84 in two’s complement.\nRange -180 <= longitude < 180 deg.", + "type":"fixed_bytes", + "length":4, + "data_type":"int", + "lsb":0.000005364418 + } + ] + }, + { + "number":"131", + "name":"Signal Amplitude", + "comment":"Relative strength of received signal.", + "type":"item", + "data_fields":[ + { + "name":"SAM", + "comment":"Range 0..255", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":1.0 + } + ] + }, + { + "number":"140", + "name":"Geometric Height", + "comment":"Vertical distance between the target and the projection of its position on the earths ellipsoid, as defined by WGS84, in twos complement form.", + "type":"item", + "data_fields":[ + { + "name":"Altitude", + "comment":"-1500 ft <= Geometric Height <= 150000 ft", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":6.25 + } + ] + }, + { + "number":"145", + "name":"Flight Level", + "comment":"Flight Level from barometric measurements, not QNH corrected, in two’s complement form.", + "type":"item", + "data_fields":[ + { + "name":"Flight Level", + "comment":"-15 FL <= Flight Level <= 1500 FL", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"146", + "name":"Intermediate State Selected Altitude", + "comment":"The short-term vertical intent as described by either the FMS selected altitude, the Altitude Control Panel Selected Altitude, or the current aircraft altitude according to the aircraft's mode of flight.", + "type":"item", + "data_fields":[ + { + "name":"Selected Altitude", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"SAS", + "comment":"Source Availability\n0 No source information provided\n1 Source Information provided", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"Source", + "comment":"0 Unknown\n1 Aircraft Altitude (Holding Altitude)\n2 MCP/FCU Selected Altitude\n3 FMS Selected Altitude", + "type":"fixed_bits", + "start_bit":13, + "bit_length":2 + }, + { + "name":"Altitude", + "comment":"Altitude in two’s complement form\n-1300ft <= Altitude <= 100000ft", + "type":"fixed_bits", + "start_bit":0, + "bit_length":13, + "data_type":"int", + "lsb":25.0 + } + ] + } + ] + }, + { + "number":"148", + "name":"Final State Selected Altitude", + "comment":"The vertical intent value that corresponds with the ATC cleared altitude, as derived from the Altitude Control Panel (MCP/FCU).", + "type":"item", + "data_fields":[ + { + "name":"Final State Selected Altitude", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"MV", + "comment":"Manage Vertical Mode\n0 Not active or unknown\n1 Active", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"AH", + "comment":"Altitude Hold Mode\n0 Not active or unknown\n1 Active", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"AM", + "comment":"Approach Mode\n0 Not active or unknown\n1 Active", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Altitude", + "comment":"Altitude in in two’s complement form\n-1300ft <= Altitude <= 100000ft", + "type":"fixed_bits", + "start_bit":0, + "bit_length":13, + "data_type":"int", + "lsb":25.0 + } + ] + } + ] + }, + { + "number":"150", + "name":"Air Speed", + "comment":"Calculated Air Speed (Element of Air Vector).", + "type":"item", + "data_fields":[ + { + "name":"Air Speed", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"IM", + "comment":"0 Air Speed = IAS\n1 Air Speed = Mach", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"Air Speed", + "comment":"Air Speed (IAS or Mach)\nif IAS, LSB = 2^-14 NM/s\nif Mach, LSB = 0.001", + "type":"fixed_bits", + "start_bit":0, + "bit_length":15 + } + ] + } + ] + }, + { + "number":"151", + "name":"True Airspeed", + "comment":"", + "type":"item", + "data_fields":[ + { + "name":"True Airspeed", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":1.0 + } + ] + }, + { + "number":"152", + "name":"Magnetic Heading", + "comment":"Magnetic Heading (Element of Air Vector).", + "type":"item", + "data_fields":[ + { + "name":"Magnetic Heading", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.00549316406 + } + ] + }, + { + "number":"155", + "name":"Barometric Vertical Rate", + "comment":"Barometric Vertical Rate, in two’s complement form.", + "type":"item", + "data_fields":[ + { + "name":"Barometric Vertical Rate", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":6.25 + } + ] + }, + { + "number":"157", + "name":"Geometric Vertical Rate", + "comment":"Geometric Vertical Rate, in two’s complement form, with reference to WGS-84.", + "type":"item", + "data_fields":[ + { + "name":"Geometric Vertical Rate", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":6.25 + } + ] + }, + { + "number":"160", + "name":"Airborne Ground Vector", + "comment":"Ground Speed and Track Angle elements of Airborne Ground Vector.", + "type":"item", + "data_fields":[ + { + "name":"Ground Speed", + "comment":"Ground Speed referenced to WGS-84\n0 ≤ Ground Speed < 2 NM/s", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.00006103515 + }, + { + "name":"Track Angle", + "comment":"Track Angle clockwise reference to \"True North\"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"165", + "name":"Rate Of Turn", + "comment":"Rate of Turn, in twos complement form.", + "type":"item", + "data_fields":[ + { + "name":"Track Angle Rate", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"TI", + "comment":"Turn Indicator\n00 Not available\n01 Left\n10 Right\n11 Straight", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Rate Of Turn First Extension", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"Rate of Turn", + "comment":"Maximum value = 15 deg/s", + "type":"fixed_bits", + "start_bit":1, + "bit_length":7, + "data_type":"int", + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"170", + "name":"Target Identification", + "comment":"Target (aircraft or vehicle) identification in 8 characters, as reported by the target.", + "type":"item", + "data_fields":[ + { + "name":"Target Identification", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"Target Identification", + "comment":"", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + }, + { + "number":"200", + "name":"Target Status", + "comment":"Status of the target", + "type":"item", + "data_fields":[ + { + "name":"Target Status", + "comment":"0 No emergency / not reported\n1 General emergency\n2 Lifeguard / medical\n3 Minimum fuel\n4 No communications\n5 Unlawful interference", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"210", + "name":"Link Technology Indicator", + "comment":"Indication of which ADS link technology has been used to send the target report.", + "type":"item", + "data_fields":[ + { + "name":"Link Technology Indicator", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"DTI", + "comment":"Cockpit Display of Traffic Information\n0 Unknown\n1 Aircraft equiped with CDTI", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"MDS", + "comment":"Mode-S Extended Squitter\n0 Not used\n1 Used", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"UAT", + "comment":"UAT\n0 Not used\n1 Used", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"VDL", + "comment":"VDL Mode 4\n0 Not used\n1 Used", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"OTR", + "comment":"Other Technology\n0 Not used\n1 Used", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"220", + "name":"Met Information", + "comment":"Meteorological information.", + "type":"item", + "data_fields":[ + { + "name":"Met Information", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"WS", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Wind Speed", + "comment":"0 <= Wind Speed <= 300", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":1.0 + } + ] + }, + { + "name":"WD", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"Wind Direction", + "comment":"1 <= Wind Direction <= 360", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":1.0 + } + ] + }, + { + "name":"TMP", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"Temperature", + "comment":"-100 °C <= Temperature <= 100 °C", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "name":"TRB", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"Turbulence", + "comment":"Integer between 0 and 15 inclusive", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + } + ] + } + ] + }, + { + "number":"230", + "name":"Roll Angle", + "comment":"The roll angle, in two’s complement form, of an aircraft executing a turn.", + "type":"item", + "data_fields":[ + { + "name":"Roll Angle", + "comment":"-180 <= Roll Angle <= 180", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.01 + } + ] + } + ] +} diff --git a/definitions/categories/categories.json b/definitions/categories/categories.json index 6c5ba53..ea6e8d0 100755 --- a/definitions/categories/categories.json +++ b/definitions/categories/categories.json @@ -112,10 +112,20 @@ "default_edition":"2.1", "default_mapping":"", "editions":{ + "0.26":{ + "document":"SUR.ET1.ST05.2000-STD-12-01", + "date":"27 June 2005", + "file":"021/cat021_0.26.json" + }, "2.1":{ "document":"SUR.ET1.ST05.2000-STD-12-01", "date":"May 2011", "file":"021/cat021_2.1.json" + }, + "2.4":{ + "document":"EUROCONTROL-SPEC-0149-12", + "date":"15/06/2015", + "file":"021/cat021_2.4.json" } }, "mappings":{ diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index ae0a885..5cf0ef4 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -19,6 +19,7 @@ target_sources( test_categories "${CMAKE_CURRENT_LIST_DIR}/test_cat010_0.31.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat019_1.3.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat020_1.5.cpp" + "${CMAKE_CURRENT_LIST_DIR}/test_cat021_0.26.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat021_2.1.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat030_7.0.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat034_1.26.cpp" diff --git a/src/test/cat021ed0.26.bin b/src/test/cat021ed0.26.bin new file mode 100644 index 0000000000000000000000000000000000000000..4acac61a8eaef66ac27a390125f5a5dc58513d19 GIT binary patch literal 36 scmWe-Q2E^`+`z!+L1cMMN)C@_cu0LG*WqyPW_ literal 0 HcmV?d00001 diff --git a/src/test/test_cat021_0.26.cpp b/src/test/test_cat021_0.26.cpp new file mode 100644 index 0000000..4e3fe22 --- /dev/null +++ b/src/test/test_cat021_0.26.cpp @@ -0,0 +1,279 @@ +/* + * This file is part of ATSDB. + * + * ATSDB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ATSDB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with ATSDB. If not, see . + */ + +#include "catch.hpp" +#include "files.h" +#include "jasterix.h" +#include "logger.h" +#include "string_conv.h" +#include "test_jasterix.h" + +using namespace std; +using namespace nlohmann; + +void test_cat021_026_callback(std::unique_ptr json_data, size_t num_frames, + size_t num_records, size_t num_errors) +{ + loginf << "cat021 test: decoded " << num_frames << " frames, " << num_records << " records, " + << num_errors << " errors" << logendl; + + REQUIRE(num_frames == 0); + REQUIRE(num_records == 1); + REQUIRE(num_errors == 0); + + // { + // "data_blocks": [ + // { + // "category": 21, + // "content": { + // "index": 3, + // "length": 33, + // "records": [ + // { + // "010": { + // "SAC": 0, + // "SIC": 5 + // }, + // "020": { + // "ECAT": 21 + // }, + // "030": { + // "Time of Day": 14418.484375 + // }, + // "040": { + // "ARC": 2, + // "ATP": 1, + // "DCR": 0, + // "GBS": 1, + // "RAB": 0, + // "SAA": 0, + // "SIM": 0, + // "SPI": 0, + // "TST": 0 + // }, + // "080": { + // "Target Address": 4811822 + // }, + // "090": { + // "AC": 0, + // "DC": 0, + // "MN": 0, + // "PA": 8 + // }, + // "130": { + // "Latitude": 38.777323149905996, + // "Longitude": -9.131237217748 + // }, + // "170": { + // "Target Identification": "FM012 " + // }, + // "200": { + // "Target Status": 0 + // }, + // "210": { + // "DTI": 0, + // "MDS": 1, + // "OTR": 0, + // "UAT": 0, + // "VDL": 0 + // }, + // "FSPEC": [ + // true, + // true, + // true, + // true, + // true, + // false, + // true, + // true, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // true, + // false, + // false, + // false, + // true, + // false, + // false, + // true, + // true, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // false + // ], + // "index": 3, + // "length": 33, + // "record_data": "fb811380000540301c293e006e4cc9ffe606d6496c2e00080818dc31ca08200015" + // } + // ] + // }, + // "length": 36 + // } + // ], + // "rec_num": 0 + // } + + loginf << "cat021 test: data block" << logendl; + + REQUIRE(json_data->contains("data_blocks")); + REQUIRE(json_data->at("data_blocks").is_array()); + REQUIRE(json_data->at("data_blocks").size() == 1); + + const json& first_data_block = json_data->at("data_blocks").at(0); + + REQUIRE(first_data_block.contains("category")); + REQUIRE(first_data_block.at("category") == 21); + REQUIRE(first_data_block.contains("length")); + REQUIRE(first_data_block.at("length") == 36); + + loginf << "cat021 test: num records" << logendl; + REQUIRE(first_data_block.contains("content")); + REQUIRE(first_data_block.at("content").contains("records")); + REQUIRE(first_data_block.at("content").at("records").is_array()); + REQUIRE(first_data_block.at("content").at("records").size() == 1); + + const json& record = first_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x fb 81 13 80 + // 11111011 10000001 00010011 10000000 + + loginf << "cat021 test: fspec" << logendl; + REQUIRE(record.at("FSPEC").size() == 4 * 8); + + REQUIRE(record.at("FSPEC") == + std::vector({1,1,1,1,1,0,1,1, 1,0,0,0,0,0,0,1, + 0,0,0,1,0,0,1,1, 1,0,0,0,0,0,0,0})); + + // ; I021/010: =0x 00 05 + // ; Data Source Identifier: 0x0005 (SAC=0; SIC=5) + + loginf << "cat021 test: 010" << logendl; + REQUIRE(record.at("010").at("SAC") == 0); + REQUIRE(record.at("010").at("SIC") == 5); + + // ; I021/040: =0x 40 30 + // ; Target Report Descriptor: + // ; GBS + // ; ATP=1 (24-bit ICAO address) ARC=2 (100 ft) + + loginf << "cat021 test: 040" << logendl; + REQUIRE(record.at("040").at("ARC") == 2); + REQUIRE(record.at("040").at("ATP") == 1); + REQUIRE(record.at("040").at("DCR") == 0); + REQUIRE(record.at("040").at("GBS") == 1); + REQUIRE(record.at("040").at("RAB") == 0); + REQUIRE(record.at("040").at("SAA") == 0); + REQUIRE(record.at("040").at("SIM") == 0); + REQUIRE(record.at("040").at("SPI") == 0); + REQUIRE(record.at("040").at("TST") == 0); + + // ; I021/030: =0x 1c 29 3e + // ; Time of Day: 0x1c293e (1845566; 04:00:18.484 UTC) + + loginf << "cat021 test: 030" << logendl; + REQUIRE(approximatelyEqual(record.at("030").at("Time of Day"), 14418.484375, 10e-6)); + + // ; I021/130: =0x 00 6e 4c c9 ff e6 06 d6 + // ; Position in WGS-84 Co-ordinates: + // ; lat=7228617 (38:46:38.363N); lon=-1702186 (009:07:52.454W) + + loginf << "cat021 test: 130" << logendl; + REQUIRE(approximatelyEqual(record.at("130").at("Latitude"), 38.777323149905996, 10e-15)); + REQUIRE(approximatelyEqual(record.at("130").at("Longitude"), -9.131237217748, 10e-12)); + + // ; I021/080: =0x 49 6c 2e + // ; Aircraft Address: 0x496c2e (4811822) + + loginf << "cat021 test: 080" << logendl; + REQUIRE(record.at("080").at("Target Address") == 4811822); + + // ; I021/090: =0x 00 08 + // ; Figure of Merit: ac=0; mn=0; dc=0; pa=8 + + loginf << "cat021 test: 090" << logendl; + REQUIRE(record.at("090").at("AC") == 0); + REQUIRE(record.at("090").at("DC") == 0); + REQUIRE(record.at("090").at("MN") == 0); + REQUIRE(record.at("090").at("PA") == 8); + + // ; I021/210: =0x 08 + // ; Link Technology Indicator: MDS + + loginf << "cat021 test: 210" << logendl; + REQUIRE(record.at("210").at("DTI") == 0); + REQUIRE(record.at("210").at("MDS") == 1); + REQUIRE(record.at("210").at("OTR") == 0); + REQUIRE(record.at("210").at("UAT") == 0); + REQUIRE(record.at("210").at("VDL") == 0); + + // ; I021/170: =0x 18 dc 31 ca 08 20 + // ; Target Identification: idt=[FM012 ] + + loginf << "cat021 test: 170" << logendl; + REQUIRE(record.at("170").at("Target Identification") == "FM012 "); + + // ; I021/200: =0x 00 + // ; Target Status: 0 + + loginf << "cat021 test: 200" << logendl; + REQUIRE(record.at("200").at("Target Status") == 0); + + // ; I021/020: =0x 15 + // ; Emitter Category: 21 (surface service vehicle) + + loginf << "cat021 test: 020" << logendl; + REQUIRE(record.at("020").at("ECAT") == 21); +} + +TEST_CASE("jASTERIX CAT021 0.26", "[jASTERIX CAT021]") +{ + loginf << "cat021 test: start" << logendl; + + jASTERIX::jASTERIX jasterix(definition_path, true, true, false); + + //; ASTERIX data block at pos 0: cat=21; len=36 + // 150024fb811380000540301c293e006e4cc9ffe606d6496c2e00080818dc31ca08200015 + + // echo -n + // 150024fb811380000540301c293e006e4cc9ffe606d6496c2e00080818dc31ca08200015 + // | xxd -r -p > cat021ed0.26.bin + + REQUIRE(jasterix.hasCategory(21)); + std::shared_ptr cat021 = jasterix.category(21); + REQUIRE(cat021->hasEdition("0.26")); + cat021->setCurrentEdition("0.26"); + cat021->setCurrentMapping(""); + + const std::string filename = "cat021ed0.26.bin"; + + REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 36); + + jasterix.decodeFile(data_path + filename, test_cat021_026_callback); + + loginf << "cat021 test: end" << logendl; +} From 9b4617ec8441eaace1f2ec3e627c652e8b6d4967 Mon Sep 17 00:00:00 2001 From: alex-scp Date: Tue, 22 Dec 2020 23:07:16 +0000 Subject: [PATCH 10/13] added cat252 version 7.0 --- definitions/categories/252/cat252_7.0.json | 2900 ++++++++++++++++++++ definitions/categories/categories.json | 14 + src/test/CMakeLists.txt | 1 + src/test/cat252ed7.0.bin | Bin 0 -> 16 bytes src/test/test_cat252_7.0.cpp | 198 ++ 5 files changed, 3113 insertions(+) create mode 100644 definitions/categories/252/cat252_7.0.json create mode 100644 src/test/cat252ed7.0.bin create mode 100644 src/test/test_cat252_7.0.cpp diff --git a/definitions/categories/252/cat252_7.0.json b/definitions/categories/252/cat252_7.0.json new file mode 100644 index 0000000..4eb1d0f --- /dev/null +++ b/definitions/categories/252/cat252_7.0.json @@ -0,0 +1,2900 @@ +{ + "name":"cat252_7.0_record", + "type":"record", + "field_specification":{ + "name":"FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "uap":[ + "010", + "015", + "020", + "035" + ], + "conditional_uaps": { + "key":"035.FAMILY", + "values": { + "1": [ + "100", + "040", + "045", + "FX", + "050", + "060", + "070", + "080", + "090", + "340", + "RE", + "FX" + ], + "2":[ + "110", + "330", + "210", + "FX", + "220", + "200", + "130", + "140", + "120", + "150", + "160", + "FX", + "060", + "170", + "190", + "230", + "320", + "310", + "240", + "FX", + "270", + "280", + "290", + "260", + "250", + "300", + "255", + "FX", + "265", + "070", + "080", + "135", + "137", + "350", + "360", + "FX", + "370", + "400", + "410", + "420", + "430", + "440", + "450", + "FX", + "460", + "470", + "480", + "-", + "-", + "-", + "-", + "-", + "-", + "-", + "RE", + "FX" + ], + "3":[ + "110", + "330", + "210", + "FX", + "220", + "200", + "130", + "140", + "120", + "150", + "160", + "FX", + "060", + "170", + "190", + "230", + "320", + "310", + "240", + "FX", + "270", + "280", + "290", + "260", + "250", + "300", + "255", + "FX", + "265", + "070", + "080", + "135", + "137", + "350", + "360", + "FX", + "370", + "400", + "410", + "420", + "430", + "440", + "450", + "FX", + "460", + "470", + "480", + "-", + "-", + "-", + "-", + "-", + "-", + "-", + "RE", + "FX" + ], + "4":[ + "110", + "330", + "210", + "FX", + "220", + "200", + "130", + "140", + "120", + "150", + "160", + "FX", + "060", + "170", + "190", + "230", + "320", + "310", + "240", + "FX", + "270", + "280", + "290", + "260", + "250", + "300", + "255", + "FX", + "265", + "070", + "080", + "135", + "137", + "350", + "360", + "FX", + "370", + "400", + "410", + "420", + "430", + "440", + "450", + "FX", + "460", + "470", + "480", + "-", + "-", + "-", + "-", + "-", + "-", + "-", + "RE", + "FX" + ] + } + }, + "items":[ + { + "number":"010", + "name":"SERVER IDENTIFICATION TAG", + "comment":"Identification of the Server of track/sensor information.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"Source Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"Source Identity Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"015", + "name":"USER NUMBER", + "comment":"Identification of the User of track/sensor information", + "type":"item", + "data_fields":[ + { + "name":"USER NUMBER", + "comment":"User number", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"020", + "name":"TIME OF MESSAGE", + "comment":"Absolute time stamping of the message in the form of elapsed time since last midnight.", + "type":"item", + "data_fields":[ + { + "name":"TIME OF MESSAGE", + "comment":"", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"035", + "name":"TYPE OF MESSAGE", + "comment":"This data item allows for a more convenient handling of the message at the receiver side by further defining the type of transaction.", + "type":"item", + "data_fields":[ + { + "name":"TYPE OF MESSAGE", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"FAMILY", + "comment":"FAMILY to which the message belongs", + "type":"fixed_bits", + "start_bit":4, + "bit_length":4 + }, + { + "name":"NATURE", + "comment":"NATURE of the message within its FAMILY", + "type":"fixed_bits", + "start_bit":0, + "bit_length":4 + } + ] + } + ] + }, + { + "number":"040", + "name":"ACCESS KEY", + "comment":"User password to be sent in the Connection Request.", + "type":"item", + "data_fields":[ + { + "name":"ACCESS KEY", + "type":"fixed_bitfield", + "length":8, + "items":[ + { + "name":"ACCESS KEY", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":64, + "num_characters":8, + "character_bit_length":8 + } + ] + } + ] + }, + { + "number":"045", + "name":"ROLE AND VERSION", + "comment":"Identification of the ROLE of a system and of the VERSION of interface.", + "type":"item", + "data_fields":[ + { + "name":"ROLE AND VERSION", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"ROLE", + "comment":"11 OPERATIONAL\n10 EVALUATION\n01 DEVELOPMENT\n00 undefined", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"VERSION", + "comment":"identification number of the version of system interface (from 0 to 63)", + "type":"fixed_bits", + "start_bit":0, + "bit_length":6 + } + ] + } + ] + }, + { + "number":"050", + "name":"DEFAULT CONNECTION OPTIONS", + "comment":"This item is used to indicate that the default values of parameters required to set a connection are selected.", + "type":"item", + "data_fields":[ + { + "name":"DEFAULT CONNECTION OPTIONS", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"UDI", + "comment":"0 the domain of interest shall be the default one in the ARTAS geographical database\n1 the domain of interest of the User shall be the Domain of interest of the ARTAS Unit to which this User is connected\n2 the domain of interest is specified in the connection request", + "type":"fixed_bits", + "start_bit":6, + "bit_length":2 + }, + { + "name":"UPP", + "comment":"0 No upper limitation of the domain of interest\n1 an upper limit is specified in the request.", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"LOW", + "comment":"0 No lower limitation of the Domain of Interest\nA lower limit is specified in the request.", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"FPP", + "comment":"0 Default\n1 A preferred FPPS is specified in the connection request.", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"060", + "name":"GEOGRAPHICAL AREA", + "comment":"Definition of geographical area in the form of a sequence of geographical points.", + "type":"item", + "data_fields":[ + { + "name":"GEOGRAPHICAL AREA", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"GEOGRAPHICAL AREA", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"NS", + "comment":"0 North Latitude\n1 South Latitude", + "type":"fixed_bits", + "start_bit":47, + "bit_length":1 + }, + { + "name":"Latitude (degrees)", + "comment":"0 to 90", + "type":"fixed_bits", + "start_bit":40, + "bit_length":7 + }, + { + "name":"Latitude (minutes)", + "comment":"0 to 59", + "type":"fixed_bits", + "start_bit":32, + "bit_length":6 + }, + { + "name":"Latitude (seconds)", + "comment":"0 to 59", + "type":"fixed_bits", + "start_bit":24, + "bit_length":6 + }, + { + "name":"Longitude (degrees)", + "comment":"0 to 180", + "type":"fixed_bits", + "start_bit":16, + "bit_length":8 + }, + { + "name":"EW", + "comment":"0 East Longitude\n1 West Longitude", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"Longitude (minutes)", + "comment":"0 to 59", + "type":"fixed_bits", + "start_bit":8, + "bit_length":6 + }, + { + "name":"Longitude (seconds)", + "comment":"0 to 59", + "type":"fixed_bits", + "start_bit":0, + "bit_length":6 + } + ] + } + ] + } + ] + }, + { + "number":"070", + "name":"LOWER LIMIT", + "comment":"Definition of the Lower limit of a Domain of Interest", + "type":"item", + "data_fields":[ + { + "name":"LOWER DOMAIN LIMIT", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"LOWER DOMAIN LIMIT", + "comment":"Vmin = -15 FL = -1500 ft\nVmax = 1500 FL = 150000 ft", + "type":"fixed_bits", + "start_bit":0, + "bit_length":14, + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"080", + "name":"UPPER LIMIT", + "comment":"Definition of the Upper limit of a Domain of Interest", + "type":"item", + "data_fields":[ + { + "name":"UPPER DOMAIN LIMIT", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"UPPER DOMAIN LIMIT", + "comment":"Vmin = -15 FL = -1500 ft\nVmax = 1500 FL = 150000 ft", + "type":"fixed_bits", + "start_bit":0, + "bit_length":14, + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"090", + "name":"PREFERRED FPPS IDENTIFICATION TAG", + "comment":"Identification of the Flight Plan Data Processing System from which Flight-Plan related information shall preferably be sent to the User.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"Source Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"Source Identity Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"100", + "name":"CONNECTION RELATED REPORT", + "comment":"Report message sent by the Server to the User in relation to a connection.", + "type":"item", + "data_fields":[ + { + "name":"CONNECTION RELATED REPORT", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"CONNECTION RELATED REPORT", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"NATURE", + "comment":"NATURE of the message to which the Report refers (0 to 7)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":3 + }, + { + "name":"CODE", + "comment":"Report CODE (0 to 31)", + "type":"fixed_bits", + "start_bit":0, + "bit_length":5 + } + ] + } + ] + } + ] + }, + { + "number":"110", + "name":"SERVICE IDENTIFICATION", + "comment":"Identification of a service.", + "type":"item", + "data_fields":[ + { + "name":"SERVICE IDENTIFICATION", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"BS", + "comment":"Background service", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"C1", + "comment":"Complementary service 1", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"SERVICE IDENTIFICATION First Extent", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"C2", + "comment":"Complementary service 2", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"C3", + "comment":"Complementary service 3", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"C4", + "comment":"Complementary service 4", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"C5", + "comment":"Complementary service 5", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"120", + "name":"CALLSIGN SELECTOR", + "comment":"List of aircraft Callsigns indicated as Track Selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"CALLSIGN SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"CALLSIGN SELECTOR", + "type":"fixed_bitfield", + "length":7, + "items":[ + { + "name":"CALLSIGN", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":56, + "num_characters":7, + "character_bit_length":8 + } + ] + } + + ] + } + ] + }, + { + "number":"130", + "name":"TRACK NUMBER SELECTOR", + "comment":"List of Track numbers indicated as Track Selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"TRACK NUMBER SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"TRACK NUMBER", + "comment":"0 to 4095", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + } + ] + }, + { + "number":"135", + "name":"AIRCRAFT ADDRESS SELECTOR", + "comment":"List of Aircraft Addresses indicated as Track Selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"AIRCRAFT ADDRESS SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"AIRCRAFT ADDRESS", + "comment":"24 bits Aircraft address", + "type":"fixed_bytes", + "length":3, + "data_type":"uint" + } + ] + } + ] + }, + { + "number":"137", + "name":"TARGET IDENTIFICATION SELECTOR", + "comment":"List of Target Identification items indicated as Track Selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"TARGET IDENTIFICATION SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"TARGET IDENTIFICATION SELECTOR", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"TARGET IDENTIFICATION", + "comment":"", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + } + ] + }, + { + "number":"140", + "name":"CODE FAMILY SELECTOR", + "comment":"List of families of Mode 3/A replies indicated as track selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"CODE FAMILY SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"CODE FAMILY SELECTOR", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"W1", + "comment":"0 Wildcard not set\n1 Wildcard is set", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"W2", + "comment":"0 Wildcard not set\n1 Wildcard is set", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"W3", + "comment":"0 Wildcard not set\n1 Wildcard is set", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"W4", + "comment":"0 Wildcard not set\n1 Wildcard is set", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"Mode 3/A Code", + "comment":"Mode 3/A Code under the form of 4 digits in octal representation", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + } + ] + }, + { + "number":"150", + "name":"DEPARTURE AIRPORT SELECTOR", + "comment":"List of Departure Airports indicated as Track Selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"DEPARTURE AIRPORT SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"DEPARTURE AIRPORT SELECTOR", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"DEPARTURE AIRPORT", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":32, + "num_characters":4, + "character_bit_length":8 + } + ] + } + ] + } + ] + }, + { + "number":"160", + "name":"DESTINATION AIRPORT SELECTOR", + "comment":"List of Destination Airports indicated as Track Selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"DESTINATION AIRPORT SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"DESTINATION AIRPORT SELECTOR", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"DESTINATION AIRPORT", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":32, + "num_characters":4, + "character_bit_length":8 + } + ] + } + ] + } + ] + }, + { + "number":"170", + "name":"AIRCRAFT TYPE SELECTOR", + "comment":"List of Aircraft Types indicated as Track Selection elements in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"AIRCRAFT TYPE SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"AIRCRAFT TYPE SELECTOR", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"AIRCRAFT TYPE", + "comment":"", + "type":"fixed_bits", + "data_type":"ascii_characters", + "start_bit":0, + "bit_length":32, + "num_characters":4, + "character_bit_length":8 + } + ] + } + ] + } + ] + }, + { + "number":"190", + "name":"CURRENT CONTROL POSITION SELECTOR", + "comment":"Identification of the Current Control Position to be used as track selector element in a Service Request.", + "type":"item", + "data_fields":[ + { + "name":"CENTRE", + "comment":"8-bit group identification code (0 to 255)", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"POSITION", + "comment":"8-bit Control Position identification code (0 to 255)", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"200", + "name":"TRACK/FLIGHT CATEGORIES SELECTOR", + "comment":"This item defines which categories of tracks and/or flights shall be served.", + "type":"item", + "data_fields":[ + { + "name":"TRACK/FLIGHT CATEGORIES SELECTOR", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"TYP", + "comment":"0 tracks from live surveillance reports\n1 tracks from simulated surveillance reports\n2 tracks from both live and simulated surveillance reports", + "type":"fixed_bits", + "start_bit":30, + "bit_length":2 + }, + { + "name":"DETECT", + "comment":"DETECT is used to filter out tracks depending on which type of surveillance report(s) have been recently processed for the track", + "type":"fixed_bits", + "start_bit":25, + "bit_length":5 + }, + { + "name":"VALTI", + "comment":"0 Default. All tracks are selected.\n1 All tracks that have a calculated track barometric altitude (I062/135) or a measured flight level (I062/136) are selected.\n2 All tracks having a calculated track geometric altitude (I062/130) computed using assumed height are selected.", + "type":"fixed_bits", + "start_bit":23, + "bit_length":2 + }, + { + "name":"STCOR", + "comment":"0 default\n1 tracks correlated to Flight Plan(s) only\n2 tracks not correlated to Flight Plan(s) only", + "type":"fixed_bits", + "start_bit":21, + "bit_length":2 + }, + { + "name":"TNT", + "comment":"0 tentative tracks shall be sent\n1 tentative tracks shall not be sent", + "type":"fixed_bits", + "start_bit":20, + "bit_length":1 + }, + { + "name":"SPI", + "comment":"0 tracks with SPI flag shall be sent\n1 tracks with SPI flag shall not be sent", + "type":"fixed_bits", + "start_bit":19, + "bit_length":1 + }, + { + "name":"ME", + "comment":"0 tracks with ME flag shall be sent\n1 tracks with ME flag shall not be sent", + "type":"fixed_bits", + "start_bit":18, + "bit_length":1 + }, + { + "name":"TRAF", + "comment":"0 all traffic\n1 General Air Traffic\n2 Operational Air Traffic", + "type":"fixed_bits", + "start_bit":16, + "bit_length":2 + }, + { + "name":"FCAT", + "comment":"100 = IFR selected\n010 = VFR selected\n001 = CVFR selected", + "type":"fixed_bits", + "start_bit":13, + "bit_length":3 + }, + { + "name":"NVD", + "comment":"0 No filtering applied\n1 No VDL 4 tracks", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"NUA", + "comment":"0 No filtering applied\n1 No UAT tracks", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"NES", + "comment":"0 No filtering applied\n1 No Extended Squitter tracks", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"SBL", + "comment":"0 No filtering applied\n1 Send Blunders", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"210", + "name":"ITEM SELECTOR", + "comment":"The Item Selector is used to define the composition of the track information messages. The bits that compose the Item Selector identify the data items, and in some cases the subfields of data items that are to be included in each track update.", + "type":"item", + "data_fields":[ + { + "name":"ITEM SELECTOR", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"DSI", + "comment":"Data Source Identifier (I062/010)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"SI", + "comment":"Service Identification (I062/015)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"TN", + "comment":"Track Number (I062/040)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"TM3", + "comment":"Track Mode 3/A Code (I062/060)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"TTI", + "comment":"Time Of Track Information (I062/070)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"TS", + "comment":"Track Status (I062/080)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"CTP", + "comment":"Calculated Track Position (Cartesian) (I062/100)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"CTW", + "comment":"Calculated Track Position WGS 84 (I062/105)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"TM5", + "comment":"Mode 5 Data Reports & Extended Mode 1 Code (I062/110)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"TM2", + "comment":"Track Mode 2 Code (I062/120)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"CGA", + "comment":"Calculated Track Geometric Altitude (I062/130)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"CBA", + "comment":"Calculated Track Barometric Altitude (I062/135)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"MFL", + "comment":"Measured Flight Level (I062/136)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"CTC", + "comment":"Calculated Track Velocity (Cartesian) (I062/185)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"MM", + "comment":"Mode Of Movement (I062/200)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR First Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"CAC", + "comment":"Calculated Acceleration (Cartesian) (I062/210)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"CRC", + "comment":"Calculated Rate Of Climb/Descent (I062/220)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"TI", + "comment":"Target Identification (I062/245)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"TSO", + "comment":"Target Size & Orientation (I062/270)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"TA", + "comment":"Track Age (I062/290 sf1)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"PSR", + "comment":"PSR Age (I062/290 sf2)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"SSR", + "comment":"SSR Age (I062/290 sf3)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"MDS", + "comment":"Mode S Age (I062/290 sf4)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"ADS", + "comment":"ADS-C Age (I062/290 sf5)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"ES", + "comment":"ADS-B Extended Squitter Age (I062/290 sf6)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"VDL", + "comment":"ADS-B VDL Mode 4 Age (I062/290 sf7)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"UAT", + "comment":"ADS-B UAT Age (I062/290 sf8)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"LOP", + "comment":"Loop Age (I062/290 sf9)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"MLT", + "comment":"Multilateration Age (I062/290 sf10)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"MFL", + "comment":"Measured Flight Level Age (I062/295 sf1)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR Second Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX2", + "optional_variable_value":1, + "items":[ + { + "name":"MD1", + "comment":"Mode 1 Age (I062/295 sf2)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"MD2", + "comment":"Mode 2 Age (I062/295 sf3)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"MDA", + "comment":"Mode 3/A Age (I062/295 sf4)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"MD4", + "comment":"Mode 4 Age (I062/295 sf5)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"MD5", + "comment":"Mode 5 Age (I062/295 sf6)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"MHA", + "comment":"Magnetic Heading Age (I062/295 sf7)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"IAA", + "comment":"Indicated Airspeed/Mach No Age (I062/295 sf8)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"TSA", + "comment":"True Airspeed Age (I062/295 sf9)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"SAA", + "comment":"Selected Altitude Age (I062/295 sf10)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"FSA", + "comment":"Final Selected Altitude Age (I062/295 sf11)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"TIA", + "comment":"Trajectory Intent Age (I062/295 sf12)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"COA", + "comment":"Communications / ACAS Capability and Flight Status Age (I062/295 sf13)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"SBA", + "comment":"Status Reported by ADS-B Age (I062/295 sf14)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"ACA", + "comment":"ACAS Resolution Advisory Report Age (I062/295 sf15)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"BVA", + "comment":"Barometric Vertical Rate Age (I062/295 sf16)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX3", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR Third Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX3", + "optional_variable_value":1, + "items":[ + { + "name":"GVA", + "comment":"Geometric Vertical Rate Age (I062/295 sf17)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"RAA", + "comment":"Roll Angle Age (I062/295 sf18)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"TRA", + "comment":"Track Angle Rate Age (I062/295 sf19)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"TAA", + "comment":"Track Angle Age (I062/295 sf20)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"GSA", + "comment":"Ground Speed Age (I062/295 sf21)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"VUA", + "comment":"Velocity Uncertainty Age (I062/295 sf22)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"MEA", + "comment":"Meteorological Data Age (I062/295 sf23)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"EMA", + "comment":"Emitter Category Age (I062/295 sf24)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"PBA", + "comment":"Position Data Age (I062/295 sf25)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"GAA", + "comment":"Geometric Altitude Data Age (I062/295 sf26)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"PUA", + "comment":"Position Uncertainty Data Age (I062/295 sf27)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"MBA", + "comment":"Mode S MB Data Age (I062/295 sf28)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"IAR", + "comment":"Indicated Airspeed Data Age (I062/295 sf29)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"MAC", + "comment":"Mach Number Data Age (I062/295 sf30)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"MCP", + "comment":"MCP/FCU Selected Altitude Data Age (I062/295 sf31)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX4", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR Fourth Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX4", + "optional_variable_value":1, + "items":[ + { + "name":"FMS", + "comment":"FMS Selected Altitude Data Age (I062/295 sf32)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"BPS", + "comment":"Barometric Pressure Setting Data Age (I062/295 sf33)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"TAL", + "comment":"Target Altitude Source Data Age (I062/295 sf34)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"MFM", + "comment":"MCP/FCU Mode Data Age (I062/295 sf35)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"VFI", + "comment":"Vehicle Fleet Identification (I062/300)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"MI", + "comment":"Measured Information (I062/340)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"BDS", + "comment":"Mode S BDS Registers (I062/350)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"BDA", + "comment":"Mode S BDS Register Ages (I062/360)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"TA", + "comment":"Target Address (I062/380 sf1)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"TI", + "comment":"Target Identification (I062/380 sf2)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"MHG", + "comment":"Magnetic Heading (I062/380 sf3)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"TAS", + "comment":"True Airspeed (I062/380 sf5)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"SAL", + "comment":"Selected Altitude (I062/380 sf6)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"FSS", + "comment":"Final State Selected Altitude (I062/380 sf7)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"TIS", + "comment":"Trajectory Intent Status (I062/380 sf8)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX5", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR Fifth Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX5", + "optional_variable_value":1, + "items":[ + { + "name":"TID", + "comment":"Trajectory Intent Data (I062/380 sf9)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"COM", + "comment":"Communications / ACAS Capability and Flight Status (I062/380 sf10)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"SAB", + "comment":"Status reported by ADS-B (I062/380 sf11)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"ACS", + "comment":"ACAS Resolution Advisory Report (I062/380 sf12)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"BVR", + "comment":"Barometric Vertical Rate (I062/380 sf13)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"GVR", + "comment":"Geometric Vertical Rate (I062/380 sf14)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"RAN", + "comment":"Roll Angle (I062/380 sf15)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"TAR", + "comment":"Track Angle Rate (I062/380 sf16)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"TAN", + "comment":"Track Angle (I062/380 sf17)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"GSP", + "comment":"Ground Speed (I062/380 sf18)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"VUN", + "comment":"Velocity Uncertainty (I062/380 sf19)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"MET", + "comment":"Meteorological Data (I062/380 sf20)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"EMC", + "comment":"Emitter Category (I062/380 sf21)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"PD", + "comment":"Position Data (I062/380 sf22)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"GAD", + "comment":"Geometric Altitude Data (I062/380 sf23)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX6", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR Sixth Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX6", + "optional_variable_value":1, + "items":[ + { + "name":"PUD", + "comment":"Position Uncertainty Data (I062/380 sf24)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"MB", + "comment":"Mode S MB Data (I062/380 sf25)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"IAR", + "comment":"Indicated Airspeed (I062/380 sf26)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"MAC", + "comment":"Mach Number (I062/380 sf27)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"MCU", + "comment":"MCP/FCU Selected Altitude (I062/380 sf28)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"FMS", + "comment":"FMS Selected Altitude (I062/380 sf29)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"BPS", + "comment":"Barometric Pressure Setting (I062/380 sf30)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"TAL", + "comment":"Target Altitude Source (I062/380 sf31)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"MFM", + "comment":"MCP/FCU Mode (I062/380 sf32)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"TAG", + "comment":"FPPS Identification Tag (I062/390 sf1)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"CSN", + "comment":"Callsign (I062/390 sf2)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"IFI", + "comment":"IFPS_FLIGHT_ID (I062/390 sf3)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"FCT", + "comment":"Flight Category (I062/390 sf4)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"TAC", + "comment":"Type of Aircraft (I062/390 sf5)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"WTC", + "comment":"Wake Turbulence Category (I062/390 sf6)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX7", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR Seventh Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX7", + "optional_variable_value":1, + "items":[ + { + "name":"DEP", + "comment":"Departure Airport (I062/390 sf7)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"DST", + "comment":"Destination Airport (I062/390 sf8)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"RDS", + "comment":"Runway Designation (I062/390 sf9)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"CFL", + "comment":"Current Cleared Flight Level (I062/390 sf10)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"CTL", + "comment":"Current Control Position (I062/390 sf11)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"TOD", + "comment":"Time of Departure / Arrival (I062/390 sf12)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"AST", + "comment":"Aircraft Stand (I062/390 sf13)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"STS", + "comment":"Stand Status (I062/390 sf14)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"STD", + "comment":"Standard Instrument Departure (I062/390 sf15)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"STA", + "comment":"STandard Instrument Arrival (I062/390 sf16)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"APC", + "comment":"Estimated Accuracy Of Track Position (Cartesian) (I062/500 sf1)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"XYC", + "comment":"XY Covariance (I062/500 sf2)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"APW", + "comment":"Estimated Accuracy Of Track Position (WGS-84) (I062/500 sf3)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"AGA", + "comment":"Estimated Accuracy Of Calculated Track Geometric Altitude (I062/500 sf4)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"ABA", + "comment":"Estimated Accuracy Of Calculated Track Barometric Altitude (I062/500sf5)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX8", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"ITEM SELECTOR Eigth Extent", + "type":"fixed_bitfield", + "length":2, + "optional":true, + "optional_variable_name":"FX8", + "optional_variable_value":1, + "items":[ + { + "name":"ATV", + "comment":"Estimated Accuracy Of Track Velocity (Cartesian) (I062/500 sf6)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"AA", + "comment":"Estimated Accuracy Of Acceleration (Cartesian) (I062/500 sf7)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"ARC", + "comment":"Estimated Accuracy Of Rate Of Climb/Descent (I062/500 sf8)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"CTN", + "comment":"Composed Track Number (I062/510)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"RE", + "comment":"Reserved Expansion Field (I062/RE)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"SP", + "comment":"Special Purpose Field (I062/SP)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"FX9", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"220", + "name":"CYCLICAL UPDATE CHARACTERISTICS", + "comment":"Definition of the Scanning Period, Update Period, Max Data Flow and Extra Delay (to be considered for the track extrapolation) in case of cyclical service.", + "type":"item", + "data_fields":[ + { + "name":"CYCLICAL UPDATE CHARACTERISTICS", + "type":"fixed_bitfield", + "length":5, + "items":[ + { + "name":"MSD", + "comment":"0 scanning by column\n1 scanning by row", + "type":"fixed_bits", + "start_bit":38, + "bit_length":1 + }, + { + "name":"SCANNING PERIOD", + "comment":"time for scanning the mosaic:\nrange : from 6 to 32 batch periods\n3 sec <= SCANNING PERIOD <= 16 sec", + "type":"fixed_bits", + "start_bit":32, + "bit_length":6 + }, + { + "name":"BATCH PERIOD", + "comment":"time period between two consecutive batches:\nrange : from 1 to 15 steps of 100 ms", + "type":"fixed_bits", + "start_bit":28, + "bit_length":4 + }, + { + "name":"UPDATE PERIOD", + "comment":"time period between the same batch of two consecutive scans:\nrange : from 6 to 3000 batch periods\nSCANNING PERIOD <= UPDATE PERIOD <= 5 minutes", + "type":"fixed_bits", + "start_bit":16, + "bit_length":12 + }, + { + "name":"EXTRA DELAY", + "comment":"range : 0 to 35 steps of 100 ms (i.e. 0 <= DELAY <= 3.5 seconds)", + "type":"fixed_bits", + "start_bit":0, + "bit_length":7 + }, + { + "name":"MAXFLOW", + "comment":"Maximum User input Data Flow:\nrange : 1 to 127 Kbytes/second", + "type":"fixed_bits", + "start_bit":0, + "bit_length":7 + } + ] + } + ] + }, + { + "number":"230", + "name":"RADAR SYNCHRONISATION CHARACTERISTICS", + "comment":"Transmission Characteristics for a service of the type radar synchronised.", + "type":"item", + "data_fields":[ + { + "name":"Main Radar Identification Tag", + "type":"fixed_bitfield", + "length":3, + "items":[ + { + "name":"MSAC", + "comment":"Source Area Code", + "type":"fixed_bits", + "start_bit":16, + "bit_length":8 + }, + { + "name":"MSIC", + "comment":"Source Identity Code", + "type":"fixed_bits", + "start_bit":8, + "bit_length":8 + }, + { + "name":"NOP", + "comment":"0 no information shall be sent\n1 a track update shall be sent after the time-window for the plot-to-track association is passed without a plot has been associated", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"Backup Radar Identification Tag (First Extent)", + "type":"fixed_bitfield", + "length":3, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"BSAC", + "comment":"Source Area Code", + "type":"fixed_bits", + "start_bit":16, + "bit_length":8 + }, + { + "name":"BSIC", + "comment":"Source Identity Code", + "type":"fixed_bits", + "start_bit":8, + "bit_length":8 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"240", + "name":"DISCRETE PARAMETERS FLAGS", + "comment":"This item contains a number of flags to indicate which category(ies) of discrete events shall be considered for triggering the track information transmission (a- periodical way of transmission).", + "type":"item", + "data_fields":[ + { + "name":"DISCRETE PARAMETERS FLAGS", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"TLF", + "comment":"Track Life events (Birth, Death, no radar update)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"TNB", + "comment":"ARTAS Track Number changes (switch Master/Slave Track Number)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"TQY", + "comment":"Modifications of Track Quality", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"PLN", + "comment":"Modification of Flight Plan related information (i.e. in the Miniplan)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"M3A", + "comment":"Change of Mode 3/A identity", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"MO2", + "comment":"Change of Mode 2 identification", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"COR", + "comment":"Flight-plan to Track correlation/end of correlation", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"SPE", + "comment":"Special Mode 3/A transponding (7500, 7600 and 7700)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"MOF", + "comment":"Change of Mode-of-Flight", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"ETU", + "comment":"Each Track Update", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"250", + "name":"MOF PROBABILITY CRITERION", + "comment":"Variation step of Mode-of-Flight Probabilities to trigger the transmission of track information updates (i.e. an update will be sent each time the variation between the current and the last transmitted MOF probability assessment for a given track exceeds the indicated threshold value).", + "type":"item", + "data_fields":[ + { + "name":"MOF PROBABILITY CRITERION", + "comment":"Maximum value : 64%", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.25 + } + ] + }, + { + "number":"255", + "name":"RATE OF CLIMB/DESCENT CRITERION", + "comment":"Variation step of the calculated rate of climb/descent to trigger the transmission of track information updates (i.e. an update will be sent each time the variation between the current and the last transmitted assessment of the rate of climb/ descent for a given track exceeds the indicated threshold value).", + "type":"item", + "data_fields":[ + { + "name":"RATE OF C/D", + "comment":"LSB = (2E-10)FL/s = 5.86 feet/minute", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.0009765625 + } + ] + }, + { + "number":"260", + "name":"POSITION CRITERION", + "comment":"Variation step of Track positional information to trigger the transmission of track updates. An update will be sent each time the variation between the current track position and the extrapolated position based on the previously sent information exceeds the indicated threshold.", + "type":"item", + "data_fields":[ + { + "name":"POSITION CRITERION", + "comment":"Maximum value = 4 NM\nLSB = (2E-6)NM = 1/64 NM", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.015625 + } + ] + }, + { + "number":"265", + "name":"RATE OF TURN CRITERION", + "comment":"Variation step of the calculated rate of turn to trigger the transmission of track information updates (i.e. an update will be sent each time the variation between the current and the last transmitted assessment of the rate of turn for a given track exceeds the indicated threshold value).", + "type":"item", + "data_fields":[ + { + "name":"RATE OF TURN CRITERION", + "comment":"Maximum value = 64 deg/s\nLSB = (2E-2) deg/s = 1/4 deg/s", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"270", + "name":"HEADING CRITERION", + "comment":"Variation step of heading (i.e. Speed Vector) to trigger the transmission of track information updates (i.e. an update will be sent each time the variation between the current and the last transmitted Track Heading assessment for a given track exceeds the indicated threshold value).", + "type":"item", + "data_fields":[ + { + "name":"HEADING CRITERION", + "comment":"Maximum value = 5.6 deg\nLSB = 360deg/(2E14) = 0.02197 deg", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.02197265625 + } + ] + }, + { + "number":"280", + "name":"SPEED MODULE CRITERION", + "comment":"Variation step of Speed Module to trigger the transmission of track information updates (i.e. an update will be sent each time the variation between the current and the last transmitted Speed Module assessment for a given track exceed the indicated threshold value).", + "type":"item", + "data_fields":[ + { + "name":"SPEED MODULE CRITERION", + "comment":"Maximum value = 255 kt", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":1.0 + } + ] + }, + { + "number":"290", + "name":"ALTITUDE CRITERION", + "comment":"A threshold for triggering the transmission of a track. A track update will be sent each time the calculated track altitude or calculated track flight level has changed by more than the indicated amount since the last track update.", + "type":"item", + "data_fields":[ + { + "name":"ALTITUDE CRITERION", + "comment":"Maximum value = FL 32", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.25 + } + ] + }, + { + "number":"300", + "name":"FACTOR K", + "comment":"The so-called factor K is used to trigger the data transmission as a function of the internal accuracy by which the ARTAS Tracker has estimated the state vector elements. An update will be sent each time one of the state vector elements has varied from more than K time the standard deviation associated to this element.", + "type":"item", + "data_fields":[ + { + "name":"FACTOR K", + "comment":"Maximum value =~ 32", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.125 + } + ] + }, + { + "number":"310", + "name":"REFRESHMENT PERIOD", + "comment":"In relation to a service applying the a-periodical mode of transmission, the Refreshment Period concerns the systematic transmission of track updates for those tracks for which no changes have been detected.", + "type":"item", + "data_fields":[ + { + "name":"REFRESHMENT PERIOD", + "comment":"Maximum value = 255 seconds (4 mn 15 s)", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":1.0 + } + ] + }, + { + "number":"320", + "name":"MINIMAL PERIOD", + "comment":"In relation to a service applying the a-periodical mode of transmission, a Minimal Period shall be specified to avoid that too close transmission intervals are applied when highly manoeuvring aircraft are tracked.", + "type":"item", + "data_fields":[ + { + "name":"MINIMAL PERIOD", + "comment":"Maximum value = 255 seconds (4 mn 15 s)", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":1.0 + } + ] + }, + { + "number":"330", + "name":"SERVICE RELATED REPORT", + "comment":"Report message sent by the Server to the User in relation to a connection or a service.", + "type":"item", + "data_fields":[ + { + "name":"SERVICE RELATED REPORT", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"SERVICE RELATED REPORT", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"NATURE", + "comment":"NATURE of the message to which the Report refers (0 to 31)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":5 + }, + { + "name":"CODE", + "comment":"Report CODE", + "type":"fixed_bits", + "start_bit":0, + "bit_length":11 + } + ] + } + ] + } + ] + }, + { + "number":"340", + "name":"SCALING FACTOR", + "comment":"This item is used to select the precision by which will be coded a cartesian track position.", + "type":"item", + "data_fields":[ + { + "name":"SCALING FACTOR", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"SF", + "comment":"0 Track Position coding precision = 1/64 NM\n1 Track Position coding precision = 1/32 NM", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"350", + "name":"SENSOR SELECTOR", + "comment":"List of Sensor SIC/SAC identifications for which Sensor information are to be provided.", + "type":"item", + "data_fields":[ + + { + "name":"SENSOR SELECTOR", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"SAC", + "comment":"Source Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"Source Identity Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + } + ] + }, + { + "number":"360", + "name":"SENSOR ITEM SELECTOR", + "comment":"This item is used to define the composition of the Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"SENSOR ITEM SELECTOR", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"DSI", + "comment":"Data Source Identifier (I063/010)", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"SID", + "comment":"Service Identifier (I063/015)", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"LMT", + "comment":"Time of message (I063/030)", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"SI", + "comment":"Sensor Identifier (I063/050)", + "type":"fixed_bits", + "start_bit":12, + "bit_length":1 + }, + { + "name":"SCS", + "comment":"Sensor Configuration and Status(I063/060)", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"TSB", + "comment":"Time Stamping Bias (I063/070)", + "type":"fixed_bits", + "start_bit":10, + "bit_length":1 + }, + { + "name":"SRB", + "comment":"SSR/Mode S Range gain and Bias (I063/080)", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"SAB", + "comment":"SSR/Mode S Azimuth Bias (I063/081)", + "type":"fixed_bits", + "start_bit":8, + "bit_length":1 + }, + { + "name":"PRB", + "comment":"PSR Range gain and Bias (I063/090)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"PAB", + "comment":"PSR Azimuth Bias (I063/091)", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"PEB", + "comment":"PSR Elevation Bias (I063/092)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"370", + "name":"PERIODICAL CHARACTERISTICS OF SENSOR INFORMATION SERVICE", + "comment":"Update period of a periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"UPDATE PERIOD", + "comment":"range : from 4 to 3600 s", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":1.0 + } + ] + }, + { + "number":"400", + "name":"REFRESHMENT PERIOD OF SENSOR INFORMATION SERVICE", + "comment":"Refreshment period of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"REFRESH PERIOD", + "comment":"period of refresh when no change is detected\nrange : from 4 to 3600 s", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":1.0 + } + ] + }, + { + "number":"410", + "name":"DISCRETE PARAMETERS OF SENSOR INFORMATION SERVICE", + "comment":"Discrete parameters of an a-periodical service of Sensor Information messages. It defines which event(s) shall trigger a message to be sent.", + "type":"item", + "data_fields":[ + { + "name":"DISCRETE PARAMETERS OF SENSOR INFORMATION SERVICE", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"SSC", + "comment":"Sensor Status Change", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"420", + "name":"TIME STAMPING CRITERION OF SENSOR INFORMATION SERVICE", + "comment":"Time stamping bias criterion of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"TIME STAMPING CRITERION OF SENSOR INFORMATION SERVICE", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"TIME STAMPING BIAS", + "comment":"variation threshold of the time stamping bias\nVmin = 0s\nVmax = 10s", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":14 + } + ] + } + ] + }, + { + "number":"430", + "name":"SSR RANGE BIAS CRITERION OF SENSOR INFORMATION SERVICE", + "comment":"SSR range bias criterion of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"SSR RANGE BIAS CRITERION OF SENSOR INFORMATION SERVICE", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"SSR RANGE BIAS", + "comment":"variation threshold of the SSR range bias\nVmin = 0 NM\nVmax = +10.8 NM", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":11, + "lsb":0.0078125 + } + ] + } + ] + }, + { + "number":"440", + "name":"SSR RANGE GAIN CRITERION OF SENSOR INFORMATION SERVICE", + "comment":"SSR range gain criterion of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"SSR RANGE GAIN CRITERION OF SENSOR INFORMATION SERVICE", + "type":"fixed_bitfield", + "length":3, + "items":[ + { + "name":"SSR RANGE GAIN", + "comment":"variation threshold of the SSR range gain\nVmin = 0\nVmax = 1", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":20, + "lsb":0.000001 + } + ] + } + ] + }, + { + "number":"450", + "name":"SSR AZIMUTH BIAS CRITERION OF SENSOR INFORMATION SERVICE", + "comment":"SSR azimuth bias criterion of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"SSR AZIMUTH BIAS", + "comment":"variation threshold of the SSR azimuth bias\nVmin = 0deg\nVmax = 360deg - (360deg/2^16)", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"460", + "name":"PR RANGE BIAS CRITERION OF SENSOR INFORMATION SERVICE", + "comment":"Primary range bias criterion of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"PR RANGE BIAS CRITERION OF SENSOR INFORMATION SERVICE", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"PR RANGE BIAS", + "comment":"variation threshold of the PR range bias\nVmin = 0 NM\nVmax = +10.8 NM", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":11, + "lsb":0.0078125 + } + ] + } + ] + }, + { + "number":"470", + "name":"PR RANGE GAIN CRITERION OF SENSOR INFORMATION SERVICE", + "comment":"Primary range gain criterion of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"PR RANGE GAIN CRITERION OF SENSOR INFORMATION SERVICE", + "type":"fixed_bitfield", + "length":3, + "items":[ + { + "name":"PR RANGE GAIN", + "comment":"variation threshold of the PR range gain\nVmin = 0\nVmax = 1", + "type":"fixed_bits", + "data_type":"uint", + "start_bit":0, + "bit_length":20, + "lsb":0.000001 + } + ] + } + ] + }, + { + "number":"480", + "name":"PR AZIMUTH BIAS CRITERION OF SENSOR INFORMATION SERVICE", + "comment":"Primary azimuth bias criterion of an a-periodical service of Sensor Information messages.", + "type":"item", + "data_fields":[ + { + "name":"PR AZIMUTH BIAS", + "comment":"variation threshold of the PR azimuth bias\nVmin = 0deg\nVmax = 360deg - (360deg/2^16)", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + } + ] +} diff --git a/definitions/categories/categories.json b/definitions/categories/categories.json index ea6e8d0..4ea1b57 100755 --- a/definitions/categories/categories.json +++ b/definitions/categories/categories.json @@ -293,5 +293,19 @@ }, "mappings":{ } + }, + "252":{ + "comment":"Category 252 APPLICATION OF ASTERIX TO ARTAS", + "default_edition":"7.0", + "default_mapping":"", + "editions":{ + "7.0":{ + "document":"DIS/SUR/ARTAS/ASTX.015", + "date":"06/01/2009", + "file":"252/cat252_7.0.json" + } + }, + "mappings":{ + } } } diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 5cf0ef4..7d3f670 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -29,6 +29,7 @@ target_sources( test_categories "${CMAKE_CURRENT_LIST_DIR}/test_cat063_1.0.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat065_1.3.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat247_1.2.cpp" + "${CMAKE_CURRENT_LIST_DIR}/test_cat252_7.0.cpp" ) target_sources( test_limits diff --git a/src/test/cat252ed7.0.bin b/src/test/cat252ed7.0.bin new file mode 100644 index 0000000000000000000000000000000000000000..1b6744367393582972b370c04140661d1c13282f GIT binary patch literal 16 XcmeyvAn=EQok1n*ABzzSqXRbpD*pr` literal 0 HcmV?d00001 diff --git a/src/test/test_cat252_7.0.cpp b/src/test/test_cat252_7.0.cpp new file mode 100644 index 0000000..d18b9b8 --- /dev/null +++ b/src/test/test_cat252_7.0.cpp @@ -0,0 +1,198 @@ +/* + * This file is part of COMPASS. + * + * COMPASS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * COMPASS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with COMPASS. If not, see . + */ + +#include "catch.hpp" +#include "files.h" +#include "jasterix.h" +#include "logger.h" +#include "string_conv.h" +#include "test_jasterix.h" + +using namespace std; +using namespace nlohmann; + +void test_cat252_callback(std::unique_ptr json_data, size_t num_frames, + size_t num_records, size_t num_errors) +{ + loginf << "cat252 test: decoded " << num_frames << " frames, " << num_records << " records, " + << num_errors << " errors" << logendl; + + REQUIRE(num_frames == 0); + REQUIRE(num_records == 1); + REQUIRE(num_errors == 0); + + // { + // "data_blocks": [ + // { + // "category": 252, + // "content": { + // "index": 3, + // "length": 13, + // "records": [ + // { + // "010": { + // "SAC": 0, + // "SIC": 7 + // }, + // "015": { + // "USER NUMBER": 36 + // }, + // "020": { + // "TIME OF MESSAGE": 54780.03125 + // }, + // "035": { + // "FAMILY": 3, + // "NATURE": 2 + // }, + // "110": { + // "BS": 1, + // "C1": 0, + // "FX": 0 + // }, + // "330": { + // "REP": 1, + // "SERVICE RELATED REPORT": [ + // { + // "CODE": 11, + // "NATURE": 8 + // } + // ] + // }, + // "FSPEC": [ + // true, + // true, + // true, + // true, + // true, + // true, + // false, + // false + // ], + // "index": 3, + // "length": 13, + // "record_data": "fc000700246afe04320401400b" + // } + // ] + // }, + // "length": 16 + // } + // ], + // "rec_num": 0 + // } + + loginf << "cat252 test: data block" << logendl; + + REQUIRE(json_data->contains("data_blocks")); + REQUIRE(json_data->at("data_blocks").is_array()); + REQUIRE(json_data->at("data_blocks").size() == 1); + + const json& first_data_block = json_data->at("data_blocks").at(0); + + REQUIRE(first_data_block.contains("category")); + REQUIRE(first_data_block.at("category") == 252); + REQUIRE(first_data_block.contains("length")); + REQUIRE(first_data_block.at("length") == 16); + + loginf << "cat252 test: num records" << logendl; + REQUIRE(first_data_block.contains("content")); + REQUIRE(first_data_block.at("content").contains("records")); + REQUIRE(first_data_block.at("content").at("records").is_array()); + REQUIRE(first_data_block.at("content").at("records").size() == 1); + + const json& record = first_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x fc + // 11111100 + + loginf << "cat252 test: fspec" << logendl; + REQUIRE(record.at("FSPEC").size() == 1 * 8); + + REQUIRE(record.at("FSPEC") == + std::vector({1, 1, 1, 1, 1, 1, 0, 0})); + + // ; I252/010: =0x 00 07 + // ; Server Identification Tag: 0x0007 (SAC=0; SIC=7) + + loginf << "cat252 test: 010" << logendl; + REQUIRE(record.at("010").at("SAC") == 0); + REQUIRE(record.at("010").at("SIC") == 7); + + // ; I252/015: =0x 00 24 + // ; User Number: 36 + + loginf << "cat252 test: 015" << logendl; + REQUIRE(record.at("015").at("USER NUMBER") == 36); + + // ; I252/020: =0x 6a fe 04 + // ; Time of Message: 0x6afe04 (7011844; 15:13:00.031 UTC) + + loginf << "cat252 test: 020" << logendl; + REQUIRE(approximatelyEqual(record.at("020").at("TIME OF MESSAGE"), 54780.03125, 10e-5)); + + // ; I252/035: =0x 32 + // ; Type of Message: family=3; nature=2 + // ; Server messages: track service related report + + loginf << "cat252 test: 035" << logendl; + REQUIRE(record.at("035").at("FAMILY") == 3); + REQUIRE(record.at("035").at("NATURE") == 2); + + // ; I252/110: =0x 04 + // ; Service Identification: BS + + loginf << "cat252 test: 110" << logendl; + REQUIRE(record.at("110").at("BS") == 1); + REQUIRE(record.at("110").at("C1") == 0); + REQUIRE(record.at("110").at("FX") == 0); + + // ; I252/330: =0x 01 40 0b + // ; Service Related Report: nature=8; code=11 + // ; Service synchronisation report: batch/sector 11 + + loginf << "cat252 test: 330" << logendl; + REQUIRE(record.at("330").at("REP") == 1); + REQUIRE(record.at("330").at("SERVICE RELATED REPORT").size() == 1); + REQUIRE(record.at("330").at("SERVICE RELATED REPORT")[0].at("CODE") == 11); + REQUIRE(record.at("330").at("SERVICE RELATED REPORT")[0].at("NATURE") == 8); +} + +TEST_CASE("jASTERIX cat252 7.0", "[jASTERIX cat252]") +{ + loginf << "cat252 test: start" << logendl; + + jASTERIX::jASTERIX jasterix(definition_path, true, true, false); + + // fc0010fc000700246afe04320401400b + // echo -n + // fc0010fc000700246afe04320401400b + // | xxd -r -p > cat252ed7.0.bin + + REQUIRE(jasterix.hasCategory(252)); + std::shared_ptr cat252 = jasterix.category(252); + REQUIRE(cat252->hasEdition("7.0")); + cat252->setCurrentEdition("7.0"); + cat252->setCurrentMapping(""); + + const std::string filename = "cat252ed7.0.bin"; + + REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 16); + + jasterix.decodeFile(data_path + filename, test_cat252_callback); + + loginf << "cat252 ed 7.0 test: end" << logendl; +} From b291b5ff9f9364ad2ed2e771a49f50d2d566cc9d Mon Sep 17 00:00:00 2001 From: alex-scp Date: Thu, 14 Jan 2021 22:30:44 +0000 Subject: [PATCH 11/13] adding cat048 ref v1.9; adding test to cat048 v1.23 --- definitions/categories/048/cat048_1.15.json | 2 +- definitions/categories/048/cat048_1.23.json | 1120 +++++++++++++++++ .../categories/048/cat048_ref_1.9.json | 775 ++++++++++++ definitions/categories/categories.json | 15 +- src/test/CMakeLists.txt | 1 + src/test/cat048ed1.23.bin | Bin 0 -> 66 bytes src/test/test_cat048_1.15.cpp | 4 +- src/test/test_cat048_1.23.cpp | 363 ++++++ 8 files changed, 2276 insertions(+), 4 deletions(-) create mode 100644 definitions/categories/048/cat048_1.23.json create mode 100644 definitions/categories/048/cat048_ref_1.9.json create mode 100644 src/test/cat048ed1.23.bin create mode 100644 src/test/test_cat048_1.23.cpp diff --git a/definitions/categories/048/cat048_1.15.json b/definitions/categories/048/cat048_1.15.json index cca3a2b..e4db072 100644 --- a/definitions/categories/048/cat048_1.15.json +++ b/definitions/categories/048/cat048_1.15.json @@ -1024,7 +1024,7 @@ "type":"fixed_bits", "data_type":"icao_characters", "start_bit":0, - "bit_length":47, + "bit_length":48, "num_characters":8, "character_bit_length":6 } diff --git a/definitions/categories/048/cat048_1.23.json b/definitions/categories/048/cat048_1.23.json new file mode 100644 index 0000000..a9a7c5f --- /dev/null +++ b/definitions/categories/048/cat048_1.23.json @@ -0,0 +1,1120 @@ +{ + "name":"cat048_1.23_record", + "type":"record", + "field_specification":{ + "name":"FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "uap":[ + "010", + "140", + "020", + "040", + "070", + "090", + "130", + "FX", + "220", + "240", + "250", + "161", + "042", + "200", + "170", + "FX", + "210", + "030", + "080", + "100", + "110", + "120", + "230", + "FX", + "260", + "055", + "050", + "065", + "060", + "SP", + "RE", + "FX" + ], + "items":[ + { + "number":"010", + "name":"Data Source Identifier", + "comment":"Identification of the radar station from which the data are received.", + "type":"item", + "data_fields":[ + { + "name":"SAC", + "comment":"System Area Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + { + "name":"SIC", + "comment":"System Identification Code", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"020", + "name":"Target Report Descriptor", + "comment":"Type and properties of the target report.", + "type":"item", + "data_fields":[ + { + "name":"target_report_descriptor", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"TYP", + "comment":"000 No detection\n001 Single PSR detection\n010 Single SSR detection\n011 SSR + PSR detection\n100 Single ModeS All-Call\n101 Single ModeS Roll-Call\n110 ModeS All-Call + PSR\n111 ModeS Roll-Call +PSR", + "type":"fixed_bits", + "start_bit":5, + "bit_length":3 + }, + { + "name":"SIM", + "comment":"0 Actual target report\n1 Simulated target report", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"RDP", + "comment":"0 Report from RDP Chain 1\n1 Report from RDP Chain 2", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"SPI", + "comment":"0 Absence of SPI\n1 Special Position Identification", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"RAB", + "comment":"0 Report from aircraft transponder\n1 Report from field monitor(fixed transponder)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"target_report_descriptor_first_extend", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"TST", + "comment":"0 Real target report\n1 Test target report", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"ERR", + "comment":"0 No Extended Range\n1 Extended Range present", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"XPP", + "comment":"0 No X-Pulse present\n1 X-Pulse present", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"ME", + "comment":"0 No military emergency\n1 Military emergency", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"MI", + "comment":"0 No military identification\n1 Military identification", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"FOE/FRI", + "comment":"00 No Mode 4 interrogation\n01 Friendly target\n10 Unknown target\n11 No reply", + "type":"fixed_bits", + "start_bit":1, + "bit_length":2 + }, + { + "name":"FX2", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"030", + "name":"Warning/Error Conditions", + "comment":"Warning/error conditions detected by a radar station for the target report involved.", + "type":"item", + "data_fields":[ + { + "name":"Warning/Error Conditions", + "type":"extendable", + "items":[ + { + "name":"warning/error_condition", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"W/E Value", + "comment":"0 Not defined; never used.\n1 Multipath Reply (Reflection)\n2 Reply due to sidelobe interrogation/reception\n3 Split plot\n4 Second time around reply\n5 Angel\n6 Slow moving target correlated with road infrastructure (terrestrial vehicle)\n7 Fixed PSR plot\n8 Slow PSR target\n9 Low quality PSR plot\n10 Phantom SSR plot\n11 Non-Matching Mode-3/A Code\n12 Mode C code / Mode S altitude code abnormal value compared to the track\n13 Target in Clutter Area\n14 Maximum Doppler Response in Zero Filter\n15 Transponder anomaly detected\n16 Duplicated or Illegal Mode S Aircraft Address\n17 Mode S error correction applied\n18 Undecodable Mode C code / Mode S altitude code\n19 Birds\n20 Flock of Birds\n21 Mode 1 was present in original reply\n22 Mode 2 was present in original reply\n23 Plot potentially caused by Wind Turbine", + "type":"fixed_bits", + "start_bit":1, + "bit_length":7 + }, + { + "name":"extend", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + } + ] + }, + { + "number":"040", + "name":"Measured Position in Polar Co-ordinates", + "comment":"Measured position of an aircraft in local polar co-ordinates", + "type":"item", + "data_fields":[ + { + "name":"RHO", + "comment":"Max. range = 256 NM", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00390625 + }, + { + "name":"THETA", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"042", + "name":"Calculated Position in Cartesian Co-ordinates", + "comment":"Calculated position of an aircraft in Cartesian co-ordinates.", + "type":"item", + "data_fields":[ + { + "name":"X-Component", + "comment":"Max. range = +/-256 NM", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.0078125 + }, + { + "name":"Y-Component", + "comment":"Max. range = +/-256 NM", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.0078125 + } + ] + }, + { + "number":"050", + "name":"Mode-2 Code in Octal Representation", + "comment":"Reply to Mode-2 interrogation.", + "type":"item", + "data_fields":[ + { + "name":"mode_2", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 Mode-2 code as derived from the reply of the transponder\n1 Smoothed Mode-2 code as provided by a local tracker", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Mode-2 code", + "comment":"", + "type":"fixed_bits", + "start_bit":0, + "bit_length":12 + } + ] + } + ] + }, + { + "number":"055", + "name":"Mode-1 Code in Octal Representation", + "comment":"Reply to Mode-1 interrogation", + "type":"item", + "data_fields":[ + { + "name":"mode_1", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled Code", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 Mode-1 code as derived from the reply of the transponder.\n1 Smoothed Mode-1 code as provided by a local tracker.", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"Mode-1 code", + "comment":"", + "type":"fixed_bits", + "start_bit":0, + "bit_length":5 + } + ] + } + ] + }, + { + "number":"060", + "name":"Mode-2 Code Confidence Indicator", + "comment":"Confidence level for each bit of a Mode-2 reply as provided by a monopulse SSR station.", + "type":"item", + "data_fields":[ + { + "name":"QXi", + "comment":"0 High quality pulse Xi\n1 Low quality pulse Xi", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"065", + "name":"Mode-1 Code Confidence Indicator", + "comment":"Confidence level for each bit of a Mode-1 reply as provided by a monopulse SSR station.", + "type":"item", + "data_fields":[ + { + "name":"QXi", + "comment":"0 High quality pulse Xi\n1 Low quality pulse Xi", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "number":"070", + "name":"Mode-3/A Code in Octal Representation", + "comment":"Mode-3/A code converted into octal representation.", + "type":"item", + "data_fields":[ + { + "name":"mode-3/a", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 Mode-3/A code derived from the reply of the transponder\n1 Mode-3/A code not extracted during the last scan", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"Mode-3/A reply", + "comment":"", + "type":"fixed_bits", + "data_type":"digits", + "start_bit":0, + "bit_length":12, + "num_digits":4, + "digit_bit_length":3 + } + ] + } + ] + }, + { + "number":"080", + "comment":"Confidence level for each bit of a Mode-3/A reply as provided by a monopulse SSR station.", + "name":"Mode-3/A Code Confidence Indicator", + "type":"item", + "data_fields":[ + { + "name":"QXi", + "comment":"0 High quality pulse Xi\n1 Low quality pulse Xi", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"090", + "name":"Flight Level in Binary Representation", + "comment":"Flight Level converted into binary representation.", + "type":"item", + "data_fields":[ + { + "name":"flight_level", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"Flight Level", + "comment":"", + "type":"fixed_bits", + "start_bit":0, + "bit_length":14, + "data_type":"int", + "lsb":0.25 + } + ] + } + ] + }, + { + "number":"100", + "name":"Mode-C Code and Code Confidence Indicator", + "comment":"Mode-C height in Gray notation as received from the transponder together with the confidence level for each reply bit as provided by a MSSR/Mode S station.", + "type":"item", + "data_fields":[ + { + "name":"mode_c_code", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code validated\n1 Code not validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"Mode-C reply", + "comment":"Mode-C reply in Gray notation", + "type":"fixed_bits", + "start_bit":0, + "bit_length":12 + } + ] + }, + { + "name":"QXi", + "comment":"0 High quality pulse Xi\n1 Low quality pulse Xi", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"110", + "name":"Height Measured by a 3D Radar", + "comment":"Height of a target as measured by a 3D radar. The height shall use mean sea level as the zero reference level.", + "type":"item", + "data_fields":[ + { + "name":"3D-Height", + "comment":"3D height, in binary notation. Negative values are expressed in two’s complement", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":25.0 + } + ] + }, + { + "number":"120", + "name":"Radial Doppler Speed", + "comment":"Information on the Doppler Speed of the target report.", + "type":"item", + "data_fields":[ + { + "name":"120", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"CAL", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Calculated Doppler Speed", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"D", + "comment":"0 Doppler speed is valid\n1 Doppler speed is doubtful", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"CAL", + "comment":"Calculated Doppler Speed, coded in two’s complement", + "type":"fixed_bits", + "start_bit":0, + "bit_length":10, + "data_type":"int" + } + ] + } + ] + }, + { + "name":"RDS", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"Raw Doppler Speed", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"DOP", + "comment":"Doppler Speed", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + }, + { + "name":"AMB", + "comment":"Ambiguity Range", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + }, + { + "name":"FRQ", + "comment":"Transmitter Frequency", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + } + ] + } + ] + } + ] + }, + { + "number":"130", + "name":"Radar Plot Characteristics", + "comment":"", + "type":"item", + "data_fields":[ + { + "name":"130", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"SRL", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"value", + "comment":"SSR plot runlength, expressed as a positive binary value.", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.0439453125 + } + ] + }, + { + "name":"SRR", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"value", + "comment":"Number of received replies for (M)SSR", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "name":"SAM", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"value", + "comment":"Amplitude of (M)SSR reply", + "type":"fixed_bytes", + "length":1, + "data_type":"int" + } + ] + }, + { + "name":"PRL", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"value", + "comment":"Primary Plot Runlength, expressed as positive binary value", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.0439453125 + } + ] + }, + { + "name":"PAM", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"value", + "comment":"Amplitude of Primary Plot", + "type":"fixed_bytes", + "length":1, + "data_type":"int" + } + ] + }, + { + "name":"RPD", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":5, + "data_fields":[ + { + "name":"value", + "comment":"Range (PSR-SSR)", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.00390625 + } + ] + }, + { + "name":"APD", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":6, + "data_fields":[ + { + "name":"value", + "comment":"Azimuth (PSR-SSR)", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.02197265625 + } + ] + } + ] + } + ] + }, + { + "number":"140", + "name":"Time of Day", + "comment":"Absolute time stamping expressed as Co-ordinated Universal Time (UTC).", + "type":"item", + "data_fields":[ + { + "name":"Time-of-Day", + "comment":"Acceptable Range of values: 0<= Time-of-Day<=24 hrs", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.0078125 + } + ] + }, + { + "number":"161", + "name":"Track Number", + "comment":"An integer value representing a unique reference to a track record within a particular track file.", + "type":"item", + "data_fields":[ + { + "name":"TRACK NUMBER", + "type":"fixed_bytes", + "length":2, + "data_type":"uint" + } + ] + }, + { + "number":"170", + "name":"Track Status", + "comment":"Status of monoradar track (PSR and/or SSR updated).", + "type":"item", + "data_fields":[ + { + "name":"track_status", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"CNF", + "comment":"Confirmed vs. Tentative Track\n0 Confirmed Track\n1 Tentative Track", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"RAD", + "comment":"Type of Sensor(s) maintaining Track\n00 Combined Track\n01 PSR Track\n10 SSR/Mode S Track\n11 Invalid", + "type":"fixed_bits", + "start_bit":5, + "bit_length":2 + }, + { + "name":"DOU", + "comment":"Signals level of confidence in plot to track association process\n0 Normal confidence\n1 Low confidence in plot to track association.", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"MAH", + "comment":"Manoeuvre detection in Horizontal Sense\n0 No horizontal man.sensed\n1 Horizontal man. sensed", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"CDM", + "comment":"Climbing / Descending Mode\n00 Maintaining\n01 Climbing\n10 Descending\n11 Unknown", + "type":"fixed_bits", + "start_bit":1, + "bit_length":2 + }, + { + "name":"FX", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + }, + { + "name":"track_status_first_extend", + "type":"fixed_bitfield", + "length":1, + "optional":true, + "optional_variable_name":"FX", + "optional_variable_value":1, + "items":[ + { + "name":"TRE", + "comment":"Signal for End_of_Track\n0 Track still alive\n1 End of track lifetime(last report for this track)", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"GHO", + "comment":"Ghost vs. true target\n0 True target track.\n1 Ghost target track.", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"SUP", + "comment":"Track maintained with track information from neighbouring Node B on the cluster, or network\n0 no\n1 yes", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"TCC", + "comment":"Type of plot coordinate transformation mechanism: 0 Tracking performed in so-called 'Radar Plane', i.e. neither slant range correction nor stereographical projection was applied.\n1 Slant range correction and a suitable projection technique are used to track in a 2D.reference plane, tangential to the earth model at the Radar Site co-ordinates.", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + } + ] + } + ] + }, + { + "number":"200", + "name":"Calculated Track Velocity in Polar Co-ordinates", + "comment":"Calculated track velocity expressed in polar co-ordinates.", + "type":"item", + "data_fields":[ + { + "name":"CALCULATED GROUNDSPEED", + "comment":"(max. 2 NM/s)", + "type":"fixed_bytes", + "length":2, + "data_type":"int", + "lsb":0.2197265401898285 + }, + { + "name":"CALCULATED HEADING", + "comment":"", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00549316406 + } + ] + }, + { + "number":"210", + "name":"Track Quality", + "comment":"Track quality in the form of a vector of standard deviations.", + "type":"item", + "data_fields":[ + { + "name":"Sigma (X)", + "comment":"Standard Deviation on the horizontal axis of the local grid system\n0<= Sigma(X)<2 NM", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.0078125 + }, + { + "name":"Sigma (Y)", + "comment":"Standard Deviation on the vertical axis of the local grid system\n0<= Sigma(Y)<2 NM", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.0078125 + }, + { + "name":"Sigma (V)", + "comment":"Standard Deviation on the groundspeed within the local grid system\n0<=Sigma (V)<56.25 Kt", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.2197265401898285 + }, + { + "name":"Sigma (H)", + "comment":"Standard Deviation on the heading within the local grid system\n0 <= sigma(H) < 22.5 degrees", + "type":"fixed_bytes", + "length":1, + "data_type":"uint", + "lsb":0.087890625 + } + ] + }, + { + "number":"220", + "name":"Aircraft Address", + "comment":"Aircraft address (24-bits Mode S address) assigned uniquely to each aircraft.", + "type":"item", + "data_fields":[ + { + "name":"AIRCRAFT ADDRESS", + "comment":"24-bits Mode S address", + "type":"fixed_bytes", + "length":3, + "data_type":"uint" + } + ] + }, + { + "number":"230", + "name":"Communications/ACAS Capability and Flight Status", + "comment":"Communications capability of the transponder, capability of the on-board ACAS equipment and flight status.", + "type":"item", + "data_fields":[ + { + "name":"communication/acas_capability_and_flight_status", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"COM", + "comment":"Communications capability of the transponder\n0 No communications capability (surveillance only)\n1 Comm. A and Comm. B capability\n2 Comm. A, Comm. B and Uplink ELM\n3 Comm. A, Comm. B, Uplink ELM and Downlink ELM\n4 Level 5 Transponder capability\n5 to 7 Not assigned", + "type":"fixed_bits", + "start_bit":13, + "bit_length":3 + }, + { + "name":"STAT", + "comment":"Flight Status\n0 No alert, no SPI, aircraft airborne\n1 No alert, no SPI, aircraft on ground\n2 Alert, no SPI, aircraft airborne\n3 Alert, no SPI, aircraft on ground\n4 Alert, SPI, aircraft airborne or on ground\n5 No alert, SPI, aircraft airborne or on ground\n6 Not assigned\n7 Unknown", + "type":"fixed_bits", + "start_bit":10, + "bit_length":3 + }, + { + "name":"SI", + "comment":"SI/II Transponder Capability\n0 No\n1 Yes", + "type":"fixed_bits", + "start_bit":9, + "bit_length":1 + }, + { + "name":"MSSC", + "comment":"Mode-S Specific Service Capability\n0 No\n1 Yes", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"ARC", + "comment":"Altitude reporting capability\n0 100 ft resolution\n1 25 ft resolution", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"AIC", + "comment":"Aircraft identification capability\n0 No\n1 Yes", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"B1A", + "comment":"BDS 1,0 bit 16", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"B1B", + "comment":"BDS 1,0 bits 37/40", + "type":"fixed_bits", + "start_bit":0, + "bit_length":4 + } + ] + } + ] + }, + { + "number":"240", + "name":"Aircraft Identification", + "comment":"Aircraft identification (in 8 characters) obtained from an aircraft equipped with a Mode S transponder.", + "type":"item", + "data_fields":[ + { + "name":"aircraft_identification", + "type":"fixed_bitfield", + "length":6, + "items":[ + { + "name":"Aircraft Identification", + "comment":"", + "type":"fixed_bits", + "data_type":"icao_characters", + "start_bit":0, + "bit_length":48, + "num_characters":8, + "character_bit_length":6 + } + ] + } + ] + }, + { + "number":"250", + "name":"Mode S MB Data", + "comment":"Mode S Comm B data as extracted from the aircraft transponder.", + "type":"item", + "data_fields":[ + { + "name":"Mode S MB Data", + "type":"repetitive", + "repetition_item":{ + "name":"REP", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + }, + "items":[ + { + "name":"MB Data", + "comment":"56-bit message conveying Mode S Comm B message data", + "type":"fixed_bytes", + "length":7, + "data_type":"bin" + }, + { + "name":"address", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"BDS1", + "comment":"Comm B Data Buffer Store 1 Address", + "type":"fixed_bits", + "start_bit":4, + "bit_length":4 + }, + { + "name":"BDS2", + "comment":"Comm B Data Buffer Store 2 Address", + "type":"fixed_bits", + "start_bit":0, + "bit_length":4 + } + ] + } + ] + } + ] + }, + { + "number":"260", + "name":"ACAS Resolution Advisory Report", + "comment":"Currently active Resolution Advisory (RA), if any, generated by the ACAS associated with the transponder transmitting the report and threat identity data.", + "type":"item", + "data_fields":[ + { + "name":"MB DATA", + "comment":"56-bit message conveying Mode S Comm B message data of BDS Register 3,0.", + "type":"fixed_bytes", + "length":7, + "data_type":"bin" + } + ] + } + ] +} diff --git a/definitions/categories/048/cat048_ref_1.9.json b/definitions/categories/048/cat048_ref_1.9.json new file mode 100644 index 0000000..0c3e815 --- /dev/null +++ b/definitions/categories/048/cat048_ref_1.9.json @@ -0,0 +1,775 @@ +{ + "name":"cat048_ref_1.9", + "type":"ReservedExpansionField", + "field_specification":{ + "name":"REF_FSPEC", + "type":"extendable_bits", + "reverse_bits":true, + "data_type":"bitfield" + }, + "items_indicator":[ + "MD5", + "M5N", + "M4E", + "RPC", + "ERR", + "-", + "-", + "-" + ], + "items":[ + { + "number":"MD5", + "name":"Mode 5 Reports", + "comment":"Mode 5 Data/Reports, Extended Mode 1 Code and X pulse", + "type":"item", + "data_fields":[ + { + "name":"MD5", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"SUM", + "comment":"Mode 5 Summary", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Mode 5 Summary", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"M5", + "comment":"0 No Mode 5 interrogation\n1 Mode 5 interrogation", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"ID", + "comment":"0 No authenticated Mode 5 ID reply/report\n1 Authenticated Mode 5 ID reply/report", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"DA", + "comment":"0 No authenticated Mode 5 Data reply/report\n1 Authenticated Mode 5 Data reply/report (i.e any valid Mode 5 reply type other than ID)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"M1", + "comment":"0 Mode 1 code not present or not from Mode 5 reply/report\n1 Mode 1 code from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"M2", + "comment":"0 Mode 2 code not present or not from Mode 5 reply/report\n1 Mode 2 code from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"M3", + "comment":"0 Mode 3 code not present or not from Mode 5 reply/report\n1 Mode 3 code from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"MC", + "comment":"0 Mode C altitude not present or not from Mode 5 reply/report\n1 Mode C altitude from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"PMN", + "comment":"Mode 5 PIN/National Origin/Mission Code", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"Mode 5 PIN/National Origin/Mission Code", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"PIN", + "comment":"PIN Code", + "type":"fixed_bits", + "start_bit":16, + "bit_length":14 + }, + { + "name":"NAV", + "comment":"0 National Origin is valid\n1 National Origin is invalid", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"NAT", + "comment":"National Origin", + "type":"fixed_bits", + "start_bit":7, + "bit_length":5 + }, + { + "name":"MIS", + "comment":"Mission Code", + "type":"fixed_bits", + "start_bit":0, + "bit_length":6 + } + ] + } + ] + }, + { + "name":"POS", + "comment":"Mode 5 Reported Position", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"LAT", + "comment":"Latitude in WGS 84\nRange -90 <= latitude <= 90", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.00002145767 + }, + { + "name":"LON", + "comment":"Longitude in WGS 84\nRange -180 <= latitude <= 180", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.00002145767 + } + ] + }, + { + "name":"GA", + "comment":"Mode 5 GNSS-derived Altitude", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"GA", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"RES", + "comment":"Resolution with which the GNSS-derived Altitude (GA) is reported\n0 GA reported in 100 ft increments\n1 GA reported in 25 ft increments", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"GA", + "comment":"GNSS-derived Altitude of target, expressed as height above WGS 84 ellipsoid", + "type":"fixed_bits", + "data_type":"int", + "lsb":25, + "start_bit":0, + "bit_length":14 + } + ] + } + ] + }, + { + "name":"EM1", + "comment":"Subfield #5: Extended Mode 1 Code in Octal Representation", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"extended_mode_1", + "comment":"", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code not validated\n1 Code validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 Mode-1 code derived from the reply of the transponder\n1 Mode-1 code not extracted during the last scan", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"EM1", + "comment":"Extended Mode 1 Code in octal representation", + "type":"fixed_bits", + "start_bit":0, + "bit_length":12 + } + ] + } + ] + }, + { + "name":"TOS", + "comment":"Subfield #6: Time Offset for POS and GA", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":5, + "data_fields":[ + { + "name":"TOS", + "comment":"The time at which the Mode 5 Reported Position (Subfield #3) and Mode 5 GNSS-derived Altitude (Subfield #4) are valid is given by Time of Day (I048/140) plus Time Offset", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.0078125 + } + ] + }, + { + "name":"XP", + "comment":"X Pulse Presence", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":6, + "data_fields":[ + { + "name":"X Pulse Presence", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"XP", + "comment":"X-pulse from Mode 5 PIN reply/report\n0 X-Pulse not present\n1 X-pulse present", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"X5", + "comment":"X-pulse from Mode 5 Data reply or Report\n0 X-pulse set to zero or no authenticated Data reply or Report received\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"XC", + "comment":"X-pulse from Mode C reply\n0 X-pulse set to zero or no Mode C reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"X3", + "comment":"X-pulse from Mode 3/A reply\n0 X-pulse set to zero or no Mode 3/A reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"X2", + "comment":"X-pulse from Mode 2 reply\n0 X-pulse set to zero or no Mode 2 reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"X1", + "comment":"X-pulse from Mode 1 reply\n0 X-pulse set to zero or no Mode 1 reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + } + ] + } + ] + }, + { + "number":"M5N", + "name":"Mode 5 Reports, New Format", + "comment":"Mode 5 Data/Reports, Extended Mode 1 Code and X pulse following the updated NATO format for the National Origin code", + "type":"item", + "data_fields":[ + { + "name":"M5N", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"SUM", + "comment":"Mode 5 Summary", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"Mode 5 Summary", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"M5", + "comment":"0 No Mode 5 interrogation\n1 Mode 5 interrogation", + "type":"fixed_bits", + "start_bit":7, + "bit_length":1 + }, + { + "name":"ID", + "comment":"0 No authenticated Mode 5 ID reply/report\n1 Authenticated Mode 5 ID reply/report", + "type":"fixed_bits", + "start_bit":6, + "bit_length":1 + }, + { + "name":"DA", + "comment":"0 No authenticated Mode 5 Data reply/report\n1 Authenticated Mode 5 Data reply/report (i.e any valid Mode 5 reply type other than ID)", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"M1", + "comment":"0 Mode 1 code not present or not from Mode 5 reply/report\n1 Mode 1 code from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"M2", + "comment":"0 Mode 2 code not present or not from Mode 5 reply/report\n1 Mode 2 code from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"M3", + "comment":"0 Mode 3 code not present or not from Mode 5 reply/report\n1 Mode 3 code from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"MC", + "comment":"0 Mode C altitude not present or not from Mode 5 reply/report\n1 Mode C altitude from Mode 5 reply/report", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"PMN", + "comment":"Mode 5 PIN/ National Origin", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"Mode 5 PIN/National Origin/Mission Code", + "type":"fixed_bitfield", + "length":4, + "items":[ + { + "name":"PIN", + "comment":"PIN Code", + "type":"fixed_bits", + "start_bit":16, + "bit_length":14 + }, + { + "name":"NOV", + "comment":"0 National Origin is valid\n1 National Origin is invalid", + "type":"fixed_bits", + "start_bit":11, + "bit_length":1 + }, + { + "name":"NO", + "comment":"National Origin Code", + "type":"fixed_bits", + "start_bit":0, + "bit_length":11 + } + ] + } + ] + }, + { + "name":"POS", + "comment":"Mode 5 Reported Position", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"LAT", + "comment":"Latitude in WGS 84\nRange -90 <= latitude <= 90", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.00002145767 + }, + { + "name":"LON", + "comment":"Longitude in WGS 84\nRange -180 <= latitude <= 180", + "type":"fixed_bytes", + "length":3, + "data_type":"int", + "lsb":0.00002145767 + } + ] + }, + { + "name":"GA", + "comment":"Mode 5 GNSS-derived Altitude", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"GA", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"RES", + "comment":"Resolution with which the GNSS-derived Altitude (GA) is reported\n0 GA reported in 100 ft increments\n1 GA reported in 25 ft increments", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"GA", + "comment":"GNSS-derived Altitude of target, expressed as height above WGS 84 ellipsoid", + "type":"fixed_bits", + "data_type":"int", + "lsb":25, + "start_bit":0, + "bit_length":14 + } + ] + } + ] + }, + { + "name":"EM1", + "comment":"Extended Mode 1 Code in Octal Representation", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":4, + "data_fields":[ + { + "name":"extended_mode_1", + "comment":"", + "type":"fixed_bitfield", + "length":2, + "items":[ + { + "name":"V", + "comment":"0 Code not validated\n1 Code validated", + "type":"fixed_bits", + "start_bit":15, + "bit_length":1 + }, + { + "name":"G", + "comment":"0 Default\n1 Garbled code", + "type":"fixed_bits", + "start_bit":14, + "bit_length":1 + }, + { + "name":"L", + "comment":"0 Mode-1 code derived from the reply of the transponder\n1 Mode-1 code not extracted during the last scan", + "type":"fixed_bits", + "start_bit":13, + "bit_length":1 + }, + { + "name":"EM1", + "comment":"Extended Mode 1 Code in octal representation", + "type":"fixed_bits", + "start_bit":0, + "bit_length":12 + } + ] + } + ] + }, + { + "name":"TOS", + "comment":"Time Offset for POS and GA", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":5, + "data_fields":[ + { + "name":"TOS", + "comment":"The time at which the Mode 5 Reported Position (Subfield #3) and Mode 5 GNSS-derived Altitude (Subfield #4) are valid is given by Time of Day (I048/140) plus Time Offset", + "type":"fixed_bytes", + "length":1, + "data_type":"int", + "lsb":0.0078125 + } + ] + }, + { + "name":"XP", + "comment":"X Pulse Presence", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":6, + "data_fields":[ + { + "name":"X Pulse Presence", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"XP", + "comment":"X-pulse from Mode 5 PIN reply/report\n0 X-Pulse not present\n1 X-pulse present", + "type":"fixed_bits", + "start_bit":5, + "bit_length":1 + }, + { + "name":"X5", + "comment":"X-pulse from Mode 5 Data reply or Report\n0 X-pulse set to zero or no authenticated Data reply or Report received\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":4, + "bit_length":1 + }, + { + "name":"XC", + "comment":"X-pulse from Mode C reply\n0 X-pulse set to zero or no Mode C reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":3, + "bit_length":1 + }, + { + "name":"X3", + "comment":"X-pulse from Mode 3/A reply\n0 X-pulse set to zero or no Mode 3/A reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":2, + "bit_length":1 + }, + { + "name":"X2", + "comment":"X-pulse from Mode 2 reply\n0 X-pulse set to zero or no Mode 2 reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":1, + "bit_length":1 + }, + { + "name":"X1", + "comment":"X-pulse from Mode 1 reply\n0 X-pulse set to zero or no Mode 1 reply\n1 X-pulse set to one (present)", + "type":"fixed_bits", + "start_bit":0, + "bit_length":1 + } + ] + } + ] + }, + { + "name":"FOM", + "comment":"Figure of Merit", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":8, + "data_fields":[ + { + "name":"Figure of Merit", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"FOM", + "comment":"Figure of Merit", + "type":"fixed_bits", + "start_bit":0, + "bit_length":5 + } + ] + } + ] + } + ] + } + ] + }, + { + "number":"M4E", + "name":"Extended Mode 4 Report", + "comment":"Extended encoding of the Mode 4 interrogation result", + "type":"item", + "data_fields":[ + { + "name":"M4E", + "type":"fixed_bitfield", + "length":1, + "items":[ + { + "name":"FOE/FRI", + "comment":"Indication Foe/Friend (Mode4)\n00 No Mode 4 identification\n01 possibly friendly target\n10 probably friendly target\n11 friendly target", + "type":"fixed_bits", + "start_bit":1, + "bit_length":2 + } + ] + } + ] + }, + { + "number":"RPC", + "name":"Radar Plot Characteristics", + "comment":"Extension to data item I048/130 for primary reports", + "type":"item", + "data_fields":[ + { + "name":"RPC", + "type":"compound", + "field_specification":{ + "name":"available", + "type":"extendable_bits", + "data_type":"bitfield", + "reverse_bits":true + }, + "items":[ + { + "name":"SCO", + "comment":"Score", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":0, + "data_fields":[ + { + "name":"SCO", + "comment":"The score describes the number of raw responses used to create the plot", + "type":"fixed_bytes", + "length":1, + "data_type":"uint" + } + ] + }, + { + "name":"SCR", + "comment":"Signal/Clutter Ratio", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":1, + "data_fields":[ + { + "name":"SCR", + "comment":"The Signal / Clutter Ratio describes the difference in signal strength between the signal constituting the raw plot and the signal of the clutter\n0.1 db < SCR < 2550", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.1 + } + ] + }, + { + "name":"RW", + "comment":"Range Width", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":2, + "data_fields":[ + { + "name":"RW", + "comment":"The Range Width defines the difference in range between the closest proximity to the radar of the raw response and the point farthest away from the radar\nMax. value: 256 NM", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00390625 + } + ] + }, + { + "name":"AR", + "comment":"Ambiguous Range", + "type":"optional_item", + "optional_bitfield_name":"available", + "optional_bitfield_index":3, + "data_fields":[ + { + "name":"AR", + "comment":"The Ambiguous Range describes the Pulse Repetition Interval of the radar in range\nMax. value: 256 NM", + "type":"fixed_bytes", + "length":2, + "data_type":"uint", + "lsb":0.00390625 + } + ] + } + ] + } + ] + }, + { + "number":"ERR", + "name":"Extended Range Report", + "comment":"", + "type":"item", + "data_fields":[ + { + "name":"RHO", + "comment":"Adaptation of data item I048/040 to extended range radars for provision of the measured range of an aircraft in local polar coordinates when the range is greater than 256NM", + "type":"fixed_bytes", + "length":3, + "data_type":"uint", + "lsb":0.00390625 + } + ] + } + ] +} diff --git a/definitions/categories/categories.json b/definitions/categories/categories.json index 4ea1b57..cabb591 100755 --- a/definitions/categories/categories.json +++ b/definitions/categories/categories.json @@ -180,13 +180,26 @@ }, "048":{ "comment":"Category 048 Transmission of Monoradar Target Reports", - "default_edition":"1.15", + "default_edition":"1.23", + "default_ref_edition":"1.9", "default_mapping":"", "editions":{ "1.15":{ "document":"SUR.ET1.ST05.2000-STD-04-01", "date":"April 2007", "file":"048/cat048_1.15.json" + }, + "1.23":{ + "document":"EUROCONTROL-SPEC-0149-4A", + "date":"31/07/2017", + "file":"048/cat048_1.23.json" + } + }, + "ref_editions":{ + "1.9":{ + "document":"EUROCONTROL-SPEC-0149-4A", + "date":"31/07/2017", + "file":"048/cat048_ref_1.9.json" } }, "mappings":{ diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 7d3f670..1274c01 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources( test_categories "${CMAKE_CURRENT_LIST_DIR}/test_cat030_7.0.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat034_1.26.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat048_1.15.cpp" + "${CMAKE_CURRENT_LIST_DIR}/test_cat048_1.23.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat062_1.12.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat062_1.16.cpp" "${CMAKE_CURRENT_LIST_DIR}/test_cat063_1.0.cpp" diff --git a/src/test/cat048ed1.23.bin b/src/test/cat048ed1.23.bin new file mode 100644 index 0000000000000000000000000000000000000000..e3134b0100355104b978c86e7506048febe6da20 GIT binary patch literal 66 zcmV-I0KNY(07C!w0ssL)ZR@E>N$fwwAvgudAi=9ly-Ad{VR#?|i`nZhzvKX5fRUd$ Ypak7e$VdP%r~m*!1D6Oq7cf8|{hja{TmS$7 literal 0 HcmV?d00001 diff --git a/src/test/test_cat048_1.15.cpp b/src/test/test_cat048_1.15.cpp index 0b69d08..04094cb 100644 --- a/src/test/test_cat048_1.15.cpp +++ b/src/test/test_cat048_1.15.cpp @@ -25,7 +25,7 @@ using namespace std; using namespace nlohmann; -void test_cat048_callback(std::unique_ptr json_data, size_t num_frames, +void test_cat048_115_callback(std::unique_ptr json_data, size_t num_frames, size_t num_records, size_t num_errors) { loginf << "cat048 test: decoded " << num_frames << " frames, " << num_records << " records, " @@ -345,7 +345,7 @@ TEST_CASE("jASTERIX CAT048 1.15", "[jASTERIX CAT048]") REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 65); - jasterix.decodeFile(data_path + filename, test_cat048_callback); + jasterix.decodeFile(data_path + filename, test_cat048_115_callback); loginf << "cat048 test: end" << logendl; } diff --git a/src/test/test_cat048_1.23.cpp b/src/test/test_cat048_1.23.cpp new file mode 100644 index 0000000..9480561 --- /dev/null +++ b/src/test/test_cat048_1.23.cpp @@ -0,0 +1,363 @@ +/* + * This file is part of ATSDB. + * + * ATSDB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ATSDB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with ATSDB. If not, see . + */ + +#include "catch.hpp" +#include "files.h" +#include "jasterix.h" +#include "logger.h" +#include "string_conv.h" +#include "test_jasterix.h" + +using namespace std; +using namespace nlohmann; + +void test_cat048_123_callback(std::unique_ptr json_data, size_t num_frames, + size_t num_records, size_t num_errors) +{ + loginf << "cat048 test: decoded " << num_frames << " frames, " << num_records << " records, " + << num_errors << " errors" << logendl; + + REQUIRE(num_frames == 0); + REQUIRE(num_records == 1); + REQUIRE(num_errors == 0); + + // { + // "data_blocks": [ + // { + // "category": 48, + // "content": { + // "index": 3, + // "length": 63, + // "records": [ + // { + // "010": { + // "SAC": 0, + // "SIC": 1 + // }, + // "020": { + // "ERR": 1, + // "FOE/FRI": 0, + // "FX": 1, + // "FX2": 0, + // "ME": 0, + // "MI": 1, + // "RAB": 0, + // "RDP": 1, + // "SIM": 0, + // "SPI": 0, + // "TST": 0, + // "TYP": 5, + // "XPP": 0 + // }, + // "040": { + // "RHO": 73.921875, + // "THETA": 89.67041011543999 + // }, + // "070": { + // "G": 0, + // "L": 1, + // "Mode-3/A reply": 470, + // "V": 0 + // }, + // "090": { + // "Flight Level": 370.0, + // "G": 0, + // "V": 0 + // }, + // "130": { + // "SAM": { + // "value": -63 + // }, + // "available": [ + // false, + // false, + // true, + // false, + // false, + // false, + // false, + // false + // ] + // }, + // "140": { + // "Time-of-Day": 33499.8359375 + // }, + // "161": { + // "TRACK NUMBER": 919 + // }, + // "170": { + // "CDM": 0, + // "CNF": 0, + // "DOU": 0, + // "FX": 0, + // "MAH": 0, + // "RAD": 2 + // }, + // "200": { + // "CALCULATED GROUNDSPEED": 463.1835467201585, + // "CALCULATED HEADING": 32.60742186016 + // }, + // "220": { + // "AIRCRAFT ADDRESS": 11226301 + // }, + // "230": { + // "AIC": 1, + // "ARC": 1, + // "B1A": 1, + // "B1B": 13, + // "COM": 1, + // "MSSC": 1, + // "SI": 0, + // "STAT": 0 + // }, + // "240": { + // "Aircraft Identification": "RYR5XW " + // }, + // "250": { + // "Mode S MB Data": [ + // { + // "BDS1": 6, + // "BDS2": 0, + // "MB Data": "8bd9eb2fbfe400" + // }, + // { + // "BDS1": 5, + // "BDS2": 0, + // "MB Data": "80919f39a004dd" + // }, + // { + // "BDS1": 4, + // "BDS2": 0, + // "MB Data": "c8480030a80000" + // } + // ], + // "REP": 3 + // }, + // "FSPEC": [ + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // false, + // true, + // true, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // true, + // false + // ] + // "index": 3, + // "length": 63 + // } + // ] + // }, + // "length": 66 + // } + // ] + // } + + loginf << "cat048 test: data block" << logendl; + + REQUIRE(json_data->contains("data_blocks")); + REQUIRE(json_data->at("data_blocks").is_array()); + REQUIRE(json_data->at("data_blocks").size() == 1); + + const json& first_data_block = json_data->at("data_blocks").at(0); + + REQUIRE(first_data_block.contains("category")); + REQUIRE(first_data_block.at("category") == 48); + REQUIRE(first_data_block.contains("length")); + REQUIRE(first_data_block.at("length") == 66); + + loginf << "cat048 test: num records" << logendl; + REQUIRE(first_data_block.contains("content")); + REQUIRE(first_data_block.at("content").contains("records")); + REQUIRE(first_data_block.at("content").at("records").is_array()); + REQUIRE(first_data_block.at("content").at("records").size() == 1); + + const json& record = first_data_block.at("content").at("records").at(0); + + // ; FSPEC: 0x ff f7 02 + // 111111111111011100000010 + + loginf << "cat048 test: fspec" << logendl; + REQUIRE(record.at("FSPEC").size() == 3 * 8); + + REQUIRE(record.at("FSPEC") == std::vector({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0})); + + // ; Data Record: + // ; I048/010: =0x 00 01 + // ; Data Source Identifier: 0x0001 (SAC=0; SIC=1) + + loginf << "cat048 test: 010" << logendl; + REQUIRE(record.at("010").at("SAC") == 0); + REQUIRE(record.at("010").at("SIC") == 1); + + // ; I048/140: =0x 41 6d eb + // ; Time of Day: 0x416deb (4287979; 33499.835938 secs; 09:18:19.836 UTC) + + loginf << "cat048 test: 140" << logendl; + double tmp_d = record.at("140").at("Time-of-Day"); + REQUIRE(fabs(tmp_d - 33499.835938) < 10e-6); + + // ; I048/020: =0x a948 + // ; Target Report Descriptor: TYP='Single ModeS Roll-Call' ACT RDP-2 ERR MI + + loginf << "cat048 test: 020" << logendl; + REQUIRE(record.at("020").at("TYP") == 5); + REQUIRE(record.at("020").at("SIM") == 0); + REQUIRE(record.at("020").at("RDP") == 1); + REQUIRE(record.at("020").at("SPI") == 0); + REQUIRE(record.at("020").at("RAB") == 0); + REQUIRE(record.at("020").at("FX") == 1); + REQUIRE(record.at("020").at("ERR") == 1); + REQUIRE(record.at("020").at("MI") == 1); + + // ; I048/040: =0x 49 ec 3f c4 + // ; Measured Position: srg=18924 (73.922 nmi); azm=16324 (89.670 deg) + + loginf << "cat048 test: 040" << logendl; + REQUIRE(approximatelyEqual(record.at("040").at("RHO"), 73.922, 10e-3)); + REQUIRE(approximatelyEqual(record.at("040").at("THETA"), 89.670, 10e-3)); + + // ; I048/070: =0x 21 38 + // ; Mode 3/A Code: v=0; g=0; l=1; code=00470 + + loginf << "cat048 test: 070" << logendl; + REQUIRE(record.at("070").at("V") == 0); + REQUIRE(record.at("070").at("G") == 0); + REQUIRE(record.at("070").at("L") == 1); + REQUIRE(record.at("070").at("Mode-3/A reply") == 470); + + // ; I048/090: =0x 05 c8 + // ; Flight Level: v=0; g=0; code=1480 (370.00 FL) + + loginf << "cat048 test: 090" << logendl; + REQUIRE(record.at("090").at("V") == 0); + REQUIRE(record.at("090").at("G") == 0); + REQUIRE(record.at("090").at("Flight Level") == 370.0); + + // ; I048/130: 0x 20 c1 + // ; Radar Plot Characteristics: + // ; Amplitude of (M)SSR reply: -63 dBm + + loginf << "cat048 test: 130" << logendl; + + // 00100000 + REQUIRE(record.at("130").at("available") == std::vector({0, 0, 1, 0, 0, 0, 0, 0})); + REQUIRE(record.at("130").at("SAM").at("value") == -63); + + // ; I048/220: =0x ab 4c bd + // ; Aircraft Address: 0xab4cbd (11226301) + + loginf << "cat048 test: 220" << logendl; + REQUIRE(record.at("220").at("AIRCRAFT ADDRESS") == 11226301); + + // ; I048/240: =0x 49 94 b5 61 78 20 + // ; Aircraft Identification: "RYR5XW " + + loginf << "cat048 test: 240" << logendl; + REQUIRE(record.at("240").at("Aircraft Identification") == "RYR5XW "); + + // ; I048/250: =0x 03 8b d9 eb 2f bf e4 00 60 80 91 9f 39 a0 04 dd + // ; +0x 50 c8 48 00 30 a8 00 00 40 + // ; Mode S MB Data: + // ; BDS 6,0 data=0x 8b d9 eb 2f bf e4 00 + // ; BDS 5,0 data=0x 80 91 9f 39 a0 04 dd + // ; BDS 4,0 data=0x c8 48 00 30 a8 00 00 + // ; mcp_fcu_selected_altitude=37008[ft] + + loginf << "cat048 test: 250" << logendl; + REQUIRE(record.at("250").at("Mode S MB Data").size() == 3); + REQUIRE(record.at("250").at("Mode S MB Data")[0].at("BDS1") == 6); + REQUIRE(record.at("250").at("Mode S MB Data")[0].at("BDS2") == 0); + REQUIRE(record.at("250").at("Mode S MB Data")[0].at("MB Data") == "8bd9eb2fbfe400"); + + // ; I048/161: =0x 03 97 + // ; Track Number: num=919 + + loginf << "cat048 test: 161" << logendl; + REQUIRE(record.at("161").at("TRACK NUMBER") == 919); + + // ; I048/200: =0x 08 3c 17 30 + // ; Calculated Track Velocity: spd=2108 (463.184 kts); hdg=5936 (32.607 deg) + + loginf << "cat048 test: 200" << logendl; + REQUIRE(approximatelyEqual(record.at("200").at("CALCULATED GROUNDSPEED"), 463.184, 10e-3)); + REQUIRE(approximatelyEqual(record.at("200").at("CALCULATED HEADING"), 32.607, 10e-3)); + + // ; I048/170: =0x 40 + // ; Track Status: CNF SRT LVL + + loginf << "cat048 test: 170" << logendl; + REQUIRE(record.at("170").at("CNF") == 0); + REQUIRE(record.at("170").at("RAD") == 2); + REQUIRE(record.at("170").at("DOU") == 0); + REQUIRE(record.at("170").at("MAH") == 0); + REQUIRE(record.at("170").at("CDM") == 0); + + // ; I048/230: =0x 20 fd + // ; Communications Capability: CC=1; FS=0 (airborne); MSSC; ARC=25ft; AIC; B1A=1; B1B=13 + + loginf << "cat048 test: 230" << logendl; + REQUIRE(record.at("230").at("COM") == 1); + REQUIRE(record.at("230").at("STAT") == 0); + REQUIRE(record.at("230").at("MSSC") == 1); + REQUIRE(record.at("230").at("ARC") == 1); + REQUIRE(record.at("230").at("AIC") == 1); + REQUIRE(record.at("230").at("B1A") == 1); + REQUIRE(record.at("230").at("B1B") == 13); +} + +TEST_CASE("jASTERIX CAT048 1.23", "[jASTERIX CAT048]") +{ + loginf << "cat048 test: start" << logendl; + + jASTERIX::jASTERIX jasterix(definition_path, true, true, false); + + // echo -n 300042fff7020001416deba94849ec3fc4213805c820c1ab4cbd4994b5617820038bd9eb2fbfe400608091 + // 9f39a004dd50c8480030a80000400397083c17304020fd | xxd -r -p > cat048ed1.23.bin + + REQUIRE(jasterix.hasCategory(48)); + std::shared_ptr cat048 = jasterix.category(48); + REQUIRE(cat048->hasEdition("1.23")); + cat048->setCurrentEdition("1.23"); + cat048->setCurrentMapping(""); + + const std::string filename = "cat048ed1.23.bin"; + + REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 66); + + jasterix.decodeFile(data_path + filename, test_cat048_123_callback); + + loginf << "cat048 test: end" << logendl; +} From e8393d404c8450d99c79833b52d145cff4f23898 Mon Sep 17 00:00:00 2001 From: alex-scp Date: Thu, 14 Jan 2021 23:21:28 +0000 Subject: [PATCH 12/13] adding test to ref v1.9 of cat048 v1.23 --- src/test/cat048ed1.23.bin | Bin 66 -> 72 bytes src/test/test_cat048_1.23.cpp | 354 +++++++++++++++++++--------------- 2 files changed, 195 insertions(+), 159 deletions(-) diff --git a/src/test/cat048ed1.23.bin b/src/test/cat048ed1.23.bin index e3134b0100355104b978c86e7506048febe6da20..914ba0395e7c0fdd8430ae36077cbfe822657769 100644 GIT binary patch delta 28 kcmZ?r5HMiy`2U@miGk5E_w`DT|NkfQ8?&-CegFUf delta 21 ccmeZp;x}M$`v0AYfzdJd^-2%VHxmVn0ZW4im;e9( diff --git a/src/test/test_cat048_1.23.cpp b/src/test/test_cat048_1.23.cpp index 9480561..b59dc94 100644 --- a/src/test/test_cat048_1.23.cpp +++ b/src/test/test_cat048_1.23.cpp @@ -35,153 +35,177 @@ void test_cat048_123_callback(std::unique_ptr json_data, size_t REQUIRE(num_records == 1); REQUIRE(num_errors == 0); - // { - // "data_blocks": [ - // { - // "category": 48, - // "content": { - // "index": 3, - // "length": 63, - // "records": [ - // { - // "010": { - // "SAC": 0, - // "SIC": 1 - // }, - // "020": { - // "ERR": 1, - // "FOE/FRI": 0, - // "FX": 1, - // "FX2": 0, - // "ME": 0, - // "MI": 1, - // "RAB": 0, - // "RDP": 1, - // "SIM": 0, - // "SPI": 0, - // "TST": 0, - // "TYP": 5, - // "XPP": 0 - // }, - // "040": { - // "RHO": 73.921875, - // "THETA": 89.67041011543999 - // }, - // "070": { - // "G": 0, - // "L": 1, - // "Mode-3/A reply": 470, - // "V": 0 - // }, - // "090": { - // "Flight Level": 370.0, - // "G": 0, - // "V": 0 - // }, - // "130": { - // "SAM": { - // "value": -63 - // }, - // "available": [ - // false, - // false, - // true, - // false, - // false, - // false, - // false, - // false - // ] - // }, - // "140": { - // "Time-of-Day": 33499.8359375 - // }, - // "161": { - // "TRACK NUMBER": 919 - // }, - // "170": { - // "CDM": 0, - // "CNF": 0, - // "DOU": 0, - // "FX": 0, - // "MAH": 0, - // "RAD": 2 - // }, - // "200": { - // "CALCULATED GROUNDSPEED": 463.1835467201585, - // "CALCULATED HEADING": 32.60742186016 - // }, - // "220": { - // "AIRCRAFT ADDRESS": 11226301 - // }, - // "230": { - // "AIC": 1, - // "ARC": 1, - // "B1A": 1, - // "B1B": 13, - // "COM": 1, - // "MSSC": 1, - // "SI": 0, - // "STAT": 0 - // }, - // "240": { - // "Aircraft Identification": "RYR5XW " - // }, - // "250": { - // "Mode S MB Data": [ - // { - // "BDS1": 6, - // "BDS2": 0, - // "MB Data": "8bd9eb2fbfe400" - // }, - // { - // "BDS1": 5, - // "BDS2": 0, - // "MB Data": "80919f39a004dd" - // }, - // { - // "BDS1": 4, - // "BDS2": 0, - // "MB Data": "c8480030a80000" - // } - // ], - // "REP": 3 - // }, - // "FSPEC": [ - // true, - // true, - // true, - // true, - // true, - // true, - // true, - // true, - // true, - // true, - // true, - // true, - // false, - // true, - // true, - // true, - // false, - // false, - // false, - // false, - // false, - // false, - // true, - // false - // ] - // "index": 3, - // "length": 63 - // } - // ] - // }, - // "length": 66 - // } - // ] - // } + // { + // "data_blocks": [ + // { + // "category": 48, + // "content": { + // "index": 3, + // "length": 69, + // "records": [ + // { + // "010": { + // "SAC": 0, + // "SIC": 1 + // }, + // "020": { + // "ERR": 1, + // "FOE/FRI": 0, + // "FX": 1, + // "FX2": 0, + // "ME": 0, + // "MI": 1, + // "RAB": 0, + // "RDP": 1, + // "SIM": 0, + // "SPI": 0, + // "TST": 0, + // "TYP": 5, + // "XPP": 0 + // }, + // "040": { + // "RHO": 255.99609375, + // "THETA": 89.67041011543999 + // }, + // "070": { + // "G": 0, + // "L": 1, + // "Mode-3/A reply": 470, + // "V": 0 + // }, + // "090": { + // "Flight Level": 370.0, + // "G": 0, + // "V": 0 + // }, + // "130": { + // "SAM": { + // "value": -63 + // }, + // "available": [ + // false, + // false, + // true, + // false, + // false, + // false, + // false, + // false + // ] + // }, + // "140": { + // "Time-of-Day": 33499.8359375 + // }, + // "161": { + // "TRACK NUMBER": 919 + // }, + // "170": { + // "CDM": 0, + // "CNF": 0, + // "DOU": 0, + // "FX": 0, + // "MAH": 0, + // "RAD": 2 + // }, + // "200": { + // "CALCULATED GROUNDSPEED": 463.1835467201585, + // "CALCULATED HEADING": 32.60742186016 + // }, + // "220": { + // "AIRCRAFT ADDRESS": 11226301 + // }, + // "230": { + // "AIC": 1, + // "ARC": 1, + // "B1A": 1, + // "B1B": 13, + // "COM": 1, + // "MSSC": 1, + // "SI": 0, + // "STAT": 0 + // }, + // "240": { + // "Aircraft Identification": "RYR5XW " + // }, + // "250": { + // "Mode S MB Data": [ + // { + // "BDS1": 6, + // "BDS2": 0, + // "MB Data": "8bd9eb2fbfe400" + // }, + // { + // "BDS1": 5, + // "BDS2": 0, + // "MB Data": "80919f39a004dd" + // }, + // { + // "BDS1": 4, + // "BDS2": 0, + // "MB Data": "c8480030a80000" + // } + // ], + // "REP": 3 + // }, + // "FSPEC": [ + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // true, + // false, + // true, + // true, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // true, + // true, + // false, + // false, + // false, + // false, + // false, + // false, + // true, + // false + // ], + // "REF": { + // "ERR": { + // "RHO": 257.0 + // }, + // "REF_FSPEC": [ + // false, + // false, + // false, + // false, + // true, + // false, + // false, + // false + // ] + // }, + // "index": 3, + // "length": 69 + // } + // ] + // }, + // "length": 72 + // } + // ], + // "rec_num": 0 + // } loginf << "cat048 test: data block" << logendl; @@ -194,7 +218,7 @@ void test_cat048_123_callback(std::unique_ptr json_data, size_t REQUIRE(first_data_block.contains("category")); REQUIRE(first_data_block.at("category") == 48); REQUIRE(first_data_block.contains("length")); - REQUIRE(first_data_block.at("length") == 66); + REQUIRE(first_data_block.at("length") == 72); loginf << "cat048 test: num records" << logendl; REQUIRE(first_data_block.contains("content")); @@ -204,14 +228,14 @@ void test_cat048_123_callback(std::unique_ptr json_data, size_t const json& record = first_data_block.at("content").at("records").at(0); - // ; FSPEC: 0x ff f7 02 - // 111111111111011100000010 + // ; FSPEC: 0x ff f7 03 02 + // 11111111111101110000001100000010 loginf << "cat048 test: fspec" << logendl; - REQUIRE(record.at("FSPEC").size() == 3 * 8); + REQUIRE(record.at("FSPEC").size() == 4 * 8); - REQUIRE(record.at("FSPEC") == std::vector({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0})); + REQUIRE(record.at("FSPEC") == std::vector({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0})); // ; Data Record: // ; I048/010: =0x 00 01 @@ -241,11 +265,11 @@ void test_cat048_123_callback(std::unique_ptr json_data, size_t REQUIRE(record.at("020").at("ERR") == 1); REQUIRE(record.at("020").at("MI") == 1); - // ; I048/040: =0x 49 ec 3f c4 - // ; Measured Position: srg=18924 (73.922 nmi); azm=16324 (89.670 deg) + // ; I048/040: =0x ff ff 3f c4 + // ; Measured Position: srg=65535 (255.996 nmi); azm=16324 (89.670 deg) loginf << "cat048 test: 040" << logendl; - REQUIRE(approximatelyEqual(record.at("040").at("RHO"), 73.922, 10e-3)); + REQUIRE(approximatelyEqual(record.at("040").at("RHO"), 255.99609375, 10e-8)); REQUIRE(approximatelyEqual(record.at("040").at("THETA"), 89.670, 10e-3)); // ; I048/070: =0x 21 38 @@ -335,6 +359,18 @@ void test_cat048_123_callback(std::unique_ptr json_data, size_t REQUIRE(record.at("230").at("AIC") == 1); REQUIRE(record.at("230").at("B1A") == 1); REQUIRE(record.at("230").at("B1B") == 13); + + // ; I048/REF: 0x 05 08 01 01 00 + + loginf << "cat048 test: REF: ERR" << logendl; + + REQUIRE(record.at("REF").contains("ERR")); + + const json& ref_err = record.at("REF").at("ERR"); + + // ; Extended Range: + // ; RHO = 257.0 nmi + REQUIRE(ref_err.at("RHO") == 257.0); } TEST_CASE("jASTERIX CAT048 1.23", "[jASTERIX CAT048]") @@ -343,8 +379,8 @@ TEST_CASE("jASTERIX CAT048 1.23", "[jASTERIX CAT048]") jASTERIX::jASTERIX jasterix(definition_path, true, true, false); - // echo -n 300042fff7020001416deba94849ec3fc4213805c820c1ab4cbd4994b5617820038bd9eb2fbfe400608091 - // 9f39a004dd50c8480030a80000400397083c17304020fd | xxd -r -p > cat048ed1.23.bin + // echo -n 300048fff703020001416deba948ffff3fc4213805c820c1ab4cbd4994b5617820038bd9eb2fbfe400608091 + // 9f39a004dd50c8480030a80000400397083c17304020fd0508010100 | xxd -r -p > cat048ed1.23.bin REQUIRE(jasterix.hasCategory(48)); std::shared_ptr cat048 = jasterix.category(48); @@ -355,7 +391,7 @@ TEST_CASE("jASTERIX CAT048 1.23", "[jASTERIX CAT048]") const std::string filename = "cat048ed1.23.bin"; REQUIRE(jASTERIX::Files::fileExists(data_path + filename)); - REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 66); + REQUIRE(jASTERIX::Files::fileSize(data_path + filename) == 72); jasterix.decodeFile(data_path + filename, test_cat048_123_callback); From 7099075a6d222bda3722fce40deff188695502a5 Mon Sep 17 00:00:00 2001 From: hpuhr Date: Fri, 22 Jan 2021 14:34:55 +0100 Subject: [PATCH 13/13] added readme details and fixed cat020/500 naming --- README.md | 23 ++++++++++++++++++++++ definitions/categories/020/cat020_1.8.json | 8 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 44cbd18..f44d4b8 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,29 @@ The library allows decoding of binary ASTERIX data into JSON. The ASTERIX defini For a detailed list of features, as well as the offered commercial services, please refer to [OpenATS jASTERIX](https://www.openats.at/projects/jasterix/). +## Supported Editions + +| CAT | Editions | REFs | SPFs | +|-----|------------------|------|------------| +| 001 | 1.1 | | | +| 002 | 1.0 | | | +| 004 | 1.4 | | | +| 010 | 0.31 | | | +| 019 | 1.2, 1.3 | | | +| 020 | 1.5, 1.8 | 1.3 | | +| 021 | 0.26, 2.1, 2.4 | | | +| 023 | 1.2 | | | +| 030 | 7.0 | | | +| 034 | 1.26 | | | +| 048 | 1.15, 1.23 | 1.9 | | +| 062 | 1.12, 1.16, 1.18 | 1.2 | ARTAS TRIs | +| 063 | 1.0,1.1 | | | +| 065 | 1.2, 1.3 | | | +| 247 | 1.2 | | | +| 252 | 7.0 | | | + + + ## Contents - Folder "analyze": Contains Python scripts for data analysis - Folder "appimage": Contains files required for AppImage building diff --git a/definitions/categories/020/cat020_1.8.json b/definitions/categories/020/cat020_1.8.json index c0d5f6f..880a61f 100644 --- a/definitions/categories/020/cat020_1.8.json +++ b/definitions/categories/020/cat020_1.8.json @@ -988,7 +988,7 @@ "optional_bitfield_index":1, "data_fields":[ { - "name":"SDP-x", + "name":"sigma-x", "comment":"Standard Deviation of X component", "type":"fixed_bytes", "length":2, @@ -996,7 +996,7 @@ "lsb":0.25 }, { - "name":"SDP-y", + "name":"sigma-y", "comment":"Standard Deviation of Y component", "type":"fixed_bytes", "length":2, @@ -1004,7 +1004,7 @@ "lsb":0.25 }, { - "name":"SDP-xy", + "name":"rho-xy", "comment":"Correlation coefficient in two's complement", "type":"fixed_bytes", "length":2, @@ -1021,7 +1021,7 @@ "optional_bitfield_index":2, "data_fields":[ { - "name":"SDH-gh", + "name":"sigma-gh", "comment":"Standard Deviation of Geometric Height", "type":"fixed_bytes", "length":2,