2 # Wireshark ASTERIX dissector tests
3 # By Atli Guðmundsson <atli@tern.is>
5 # SPDX-License-Identifier: GPL-2.0-or-later
7 '''ASTERIX dissector tests'''
13 from suite_dissectors
.dissectorstest
import *
18 def test_for_asterix(self
, dissection_validator
):
19 '''Verifies that the asterix dissector is installed and accessible'''
21 tester
= dissection_validator('asterix')
22 tester
.add_dissection(
25 "asterix.category": "19",
29 tester
.check_dissections()
32 class _asterix_validator_real
:
34 def __init__(self
, category
, dissection_validator
):
35 self
.category
= category
36 self
.validator
= dissection_validator("asterix")
38 def add_dissection(self
, byte_list
, field
, expected_message
, line_no
=None):
39 '''pre-wrap asterix category messages with proper asterix structure'''
41 total_length
= len(byte_list
) + 3
44 (total_length
// 256) % 256,
48 "asterix.category": "{}".format(self
.category
),
49 "asterix.length": "{}".format(total_length
),
53 field
: expected_message
57 caller
= inspect
.getframeinfo(inspect
.stack()[1][0])
58 line_no
= caller
.lineno
59 self
.validator
.add_dissection(byte_list
, expected_result
, line_no
)
61 def check_dissections(self
):
62 self
.validator
.check_dissections()
66 def asterix_validator(dissection_validator
):
68 def generate_asterix_validator(category
):
69 retval
= _asterix_validator_real(category
, dissection_validator
)
72 return generate_asterix_validator
75 class _asterix_re_validator_real(_asterix_validator_real
):
77 def __init__(self
, category
, re_byte_list
, dissection_validator
):
78 super().__init
__(category
, dissection_validator
)
79 self
.re_byte_list
= re_byte_list
81 def add_re_dissection(self
, byte_list
, field
, expected_message
, line_no
=None):
82 '''pre-wrap asterix RE messages with proper asterix RE structure'''
84 re_length
= len(byte_list
) + 1
85 byte_list
= self
.re_byte_list
+ [
89 "asterix.re_field_len": "{}".format(re_length
),
91 "asterix.{:03}_RE_{}".format(self
.category
, field
): expected_message
94 caller
= inspect
.getframeinfo(inspect
.stack()[1][0])
95 line_no
= caller
.lineno
96 self
.add_dissection(byte_list
, "asterix.{:03}_RE".format(
97 self
.category
), expected_result
, line_no
)
101 def asterix_re_validator(dissection_validator
):
103 def generate_re_asterix_validator(category
, re_byte_list
):
104 retval
= _asterix_re_validator_real(
105 category
, re_byte_list
, dissection_validator
)
108 return generate_re_asterix_validator
111 def fspec_local(key
, idx
, value
):
114 "asterix.{}".format(key
):
116 "asterix.{}_{}".format(key
, idx
): value
122 def fspec_global(key
, idx
, value
):
125 "asterix.{}".format(key
):
127 "asterix.{}".format(idx
): value
133 def dict_local(vmap
, key
, idx
, value
):
135 result
["asterix.{}_{}".format(key
, idx
)] = value
139 def dict_global(vmap
, key
, value
):
141 result
["asterix.{}".format(key
)] = value
145 def dict_fspec_local(vmap
, key
, idx
, value
):
148 "asterix.{}".format(key
): dict_local(vmap
, key
, idx
, value
)
153 def dict_fspec_global(vmap
, key
, idx
, value
):
156 "asterix.{}".format(key
): dict_global(vmap
, idx
, value
)
161 def counter_local(vmap
, counter
, key
, idx
, value
):
164 "asterix.{}".format(key
):
166 "asterix.counter": counter
,
167 "asterix.{}".format(key
): dict_local(vmap
, key
, idx
, value
)
173 class TestCategory019
:
175 Unittest case for ASTERIX Category 019
177 Online specification:
178 https://www.eurocontrol.int/publications/cat019-multilateration-system-status-messages-part-18
180 Part 18 : Category 019 (1.3)
181 Multilateration System
184 Standard User Application Profile
186 FRN Data Item Information Length
187 1 I019/010 Data Source Identifier 2
188 2 I019/000 Message Type 1
189 3 I019/140 Time of Day 3
190 4 I019/550 System Status 1
191 5 I019/551 Tracking Processor Detailed Status 1
192 6 I019/552 Remote Sensor Detailed Status 1+
193 7 I019/553 Reference Transponder Detailed Status 1+
194 FX - Field Extension Indicator -
195 8 I019/600 Position of the MLT System Reference point 8
196 9 I019/610 Height of the MLT System Reference point 2
197 10 I019/620 WGS-84 Undulation 1
200 13 RE Reserved Expansion Field -
201 14 SP Special Purpose Field -
202 FX - Field Extension Indicator -
205 def test_for_fields(self
, asterix_validator
):
206 '''verifies existence of all fields and their maximum value'''
208 validator
= asterix_validator(19)
210 validator
.add_dissection(
214 "asterix.019_010_SAC": "0xff",
215 "asterix.019_010_SIC": "0x00"
218 validator
.add_dissection(
222 "asterix.019_010_SAC": "0x00",
223 "asterix.019_010_SIC": "0xff"
226 validator
.add_dissection(
230 "asterix.019_000_VALUE": "3"
233 validator
.add_dissection(
234 [0x20, 0xa8, 0xbf, 0xff],
237 "asterix.019_140_VALUE": "86399.9921875"
240 validator
.add_dissection(
244 "asterix.019_550_NOGO": "3",
245 "asterix.019_550_OVL": "0",
246 "asterix.019_550_TSV": "0",
247 "asterix.019_550_TTF": "0"
250 validator
.add_dissection(
254 "asterix.019_550_NOGO": "0",
255 "asterix.019_550_OVL": "1",
256 "asterix.019_550_TSV": "0",
257 "asterix.019_550_TTF": "0"
260 validator
.add_dissection(
264 "asterix.019_550_NOGO": "0",
265 "asterix.019_550_OVL": "0",
266 "asterix.019_550_TSV": "1",
267 "asterix.019_550_TTF": "0"
270 validator
.add_dissection(
274 "asterix.019_550_NOGO": "0",
275 "asterix.019_550_OVL": "0",
276 "asterix.019_550_TSV": "0",
277 "asterix.019_550_TTF": "1"
280 validator
.add_dissection(
284 "asterix.019_551_TP1A": "1",
285 "asterix.019_551_TP1B": "0",
286 "asterix.019_551_TP2A": "0",
287 "asterix.019_551_TP2B": "0",
288 "asterix.019_551_TP3A": "0",
289 "asterix.019_551_TP3B": "0",
290 "asterix.019_551_TP4A": "0",
291 "asterix.019_551_TP4B": "0"
294 validator
.add_dissection(
298 "asterix.019_551_TP1A": "0",
299 "asterix.019_551_TP1B": "1",
300 "asterix.019_551_TP2A": "0",
301 "asterix.019_551_TP2B": "0",
302 "asterix.019_551_TP3A": "0",
303 "asterix.019_551_TP3B": "0",
304 "asterix.019_551_TP4A": "0",
305 "asterix.019_551_TP4B": "0"
308 validator
.add_dissection(
312 "asterix.019_551_TP1A": "0",
313 "asterix.019_551_TP1B": "0",
314 "asterix.019_551_TP2A": "1",
315 "asterix.019_551_TP2B": "0",
316 "asterix.019_551_TP3A": "0",
317 "asterix.019_551_TP3B": "0",
318 "asterix.019_551_TP4A": "0",
319 "asterix.019_551_TP4B": "0"
322 validator
.add_dissection(
326 "asterix.019_551_TP1A": "0",
327 "asterix.019_551_TP1B": "0",
328 "asterix.019_551_TP2A": "0",
329 "asterix.019_551_TP2B": "1",
330 "asterix.019_551_TP3A": "0",
331 "asterix.019_551_TP3B": "0",
332 "asterix.019_551_TP4A": "0",
333 "asterix.019_551_TP4B": "0"
336 validator
.add_dissection(
340 "asterix.019_551_TP1A": "0",
341 "asterix.019_551_TP1B": "0",
342 "asterix.019_551_TP2A": "0",
343 "asterix.019_551_TP2B": "0",
344 "asterix.019_551_TP3A": "1",
345 "asterix.019_551_TP3B": "0",
346 "asterix.019_551_TP4A": "0",
347 "asterix.019_551_TP4B": "0"
350 validator
.add_dissection(
354 "asterix.019_551_TP1A": "0",
355 "asterix.019_551_TP1B": "0",
356 "asterix.019_551_TP2A": "0",
357 "asterix.019_551_TP2B": "0",
358 "asterix.019_551_TP3A": "0",
359 "asterix.019_551_TP3B": "1",
360 "asterix.019_551_TP4A": "0",
361 "asterix.019_551_TP4B": "0"
364 validator
.add_dissection(
368 "asterix.019_551_TP1A": "0",
369 "asterix.019_551_TP1B": "0",
370 "asterix.019_551_TP2A": "0",
371 "asterix.019_551_TP2B": "0",
372 "asterix.019_551_TP3A": "0",
373 "asterix.019_551_TP3B": "0",
374 "asterix.019_551_TP4A": "1",
375 "asterix.019_551_TP4B": "0"
378 validator
.add_dissection(
382 "asterix.019_551_TP1A": "0",
383 "asterix.019_551_TP1B": "0",
384 "asterix.019_551_TP2A": "0",
385 "asterix.019_551_TP2B": "0",
386 "asterix.019_551_TP3A": "0",
387 "asterix.019_551_TP3B": "0",
388 "asterix.019_551_TP4A": "0",
389 "asterix.019_551_TP4B": "1"
392 validator
.add_dissection(
396 "asterix.counter": "0"
399 validator
.add_dissection(
400 [0x04, 0x01, 0xff, 0x00],
403 "asterix.counter": "1",
406 "asterix.019_552_RSI": "0xff",
407 "asterix.019_552_RS1090": "0",
408 "asterix.019_552_TX1030": "0",
409 "asterix.019_552_TX1090": "0",
410 "asterix.019_552_RSS": "0",
411 "asterix.019_552_RSO": "0"
415 validator
.add_dissection(
416 [0x04, 0x01, 0x00, 0x40],
419 "asterix.counter": "1",
422 "asterix.019_552_RSI": "0x00",
423 "asterix.019_552_RS1090": "1",
424 "asterix.019_552_TX1030": "0",
425 "asterix.019_552_TX1090": "0",
426 "asterix.019_552_RSS": "0",
427 "asterix.019_552_RSO": "0"
431 validator
.add_dissection(
432 [0x04, 0x01, 0x00, 0x20],
435 "asterix.counter": "1",
438 "asterix.019_552_RSI": "0x00",
439 "asterix.019_552_RS1090": "0",
440 "asterix.019_552_TX1030": "1",
441 "asterix.019_552_TX1090": "0",
442 "asterix.019_552_RSS": "0",
443 "asterix.019_552_RSO": "0"
447 validator
.add_dissection(
448 [0x04, 0x01, 0x00, 0x10],
451 "asterix.counter": "1",
454 "asterix.019_552_RSI": "0x00",
455 "asterix.019_552_RS1090": "0",
456 "asterix.019_552_TX1030": "0",
457 "asterix.019_552_TX1090": "1",
458 "asterix.019_552_RSS": "0",
459 "asterix.019_552_RSO": "0"
463 validator
.add_dissection(
464 [0x04, 0x01, 0x00, 0x08],
467 "asterix.counter": "1",
470 "asterix.019_552_RSI": "0x00",
471 "asterix.019_552_RS1090": "0",
472 "asterix.019_552_TX1030": "0",
473 "asterix.019_552_TX1090": "0",
474 "asterix.019_552_RSS": "1",
475 "asterix.019_552_RSO": "0"
479 validator
.add_dissection(
480 [0x04, 0x01, 0x00, 0x04],
483 "asterix.counter": "1",
486 "asterix.019_552_RSI": "0x00",
487 "asterix.019_552_RS1090": "0",
488 "asterix.019_552_TX1030": "0",
489 "asterix.019_552_TX1090": "0",
490 "asterix.019_552_RSS": "0",
491 "asterix.019_552_RSO": "1"
495 validator
.add_dissection(
496 [0x04, 0x03, 0x12, 0x34, 0x56, 0x78, 0x9a, 0x0c],
499 "asterix.counter": "3",
502 "asterix.019_552_RSI": "18",
503 "asterix.019_552_RS1090": "0",
504 "asterix.019_552_TX1030": "1",
505 "asterix.019_552_TX1090": "1",
506 "asterix.019_552_RSS": "0",
507 "asterix.019_552_RSO": "1"
511 "asterix.019_552_RSI": "86",
512 "asterix.019_552_RS1090": "1",
513 "asterix.019_552_TX1030": "1",
514 "asterix.019_552_TX1090": "1",
515 "asterix.019_552_RSS": "1",
516 "asterix.019_552_RSO": "0"
520 "asterix.019_552_RSI": "0x9a",
521 "asterix.019_552_RS1090": "0",
522 "asterix.019_552_TX1030": "0",
523 "asterix.019_552_TX1090": "0",
524 "asterix.019_552_RSS": "1",
525 "asterix.019_552_RSO": "1"
529 validator
.add_dissection(
533 "asterix.019_553_REFTR1": "3",
534 "asterix.019_553_REFTR2": "0",
538 validator
.add_dissection(
542 "asterix.019_553_REFTR1": "0",
543 "asterix.019_553_REFTR2": "3",
547 '''TODO: check this testcase, it has too many subitems
548 validator.add_dissection(
549 [0x02, 0x01, 0x01, 0x0c],
552 "asterix.019_553_Ref_Trans_1_Status": "0",
553 "asterix.019_553_Ref_Trans_2_Status": "0",
554 "asterix.019_553_Ref_Trans_3_Status": "0",
555 "asterix.019_553_Ref_Trans_4_Status": "0",
556 "asterix.019_553_Ref_Trans_5_Status": "0",
557 "asterix.019_553_Ref_Trans_6_Status": "3",
562 validator
.add_dissection(
563 [0x01, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
566 "asterix.019_600_LAT": "90",
567 "asterix.019_600_LON": "0"
570 validator
.add_dissection(
571 [0x01, 0x80, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
574 "asterix.019_600_LAT": "-90",
575 "asterix.019_600_LON": "0"
578 validator
.add_dissection(
579 [0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00],
582 "asterix.019_600_LAT": "0",
583 "asterix.019_600_LON": "180"
586 validator
.add_dissection(
587 [0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00],
590 "asterix.019_600_LAT": "0",
591 "asterix.019_600_LON": "-180"
594 validator
.add_dissection(
595 [0x01, 0x40, 0x7f, 0xff],
598 "asterix.019_610_VALUE": "8191.75"
601 validator
.add_dissection(
602 [0x01, 0x40, 0x80, 0x00],
605 "asterix.019_610_VALUE": "-8192"
608 validator
.add_dissection(
612 "asterix.019_620_VALUE": "127"
615 validator
.add_dissection(
619 "asterix.019_620_VALUE": "-127"
623 validator
.check_dissections()
625 def test_undefined_value_handling(self
, asterix_validator
):
626 '''verifies that the dissector can dissect undefined field values by setting
627 the maximum value of bits or by setting all undefined bits'''
629 validator
= asterix_validator(19)
631 validator
.add_dissection(
635 "asterix.019_000_VALUE": "255"
638 validator
.add_dissection(
639 [0x20, 0xff, 0xff, 0xff],
642 "asterix.019_140_VALUE": "131071.9921875"
645 validator
.add_dissection(
649 "asterix.019_550_NOGO": "0",
650 "asterix.019_550_OVL": "0",
651 "asterix.019_550_TSV": "0",
652 "asterix.019_550_TTF": "0"
655 validator
.add_dissection(
656 [0x04, 0x01, 0x00, 0x83],
659 "asterix.counter": "1",
662 "asterix.019_552_RSI": "0x00",
663 "asterix.019_552_RS1090": "0",
664 "asterix.019_552_TX1030": "0",
665 "asterix.019_552_TX1090": "0",
666 "asterix.019_552_RSS": "0",
667 "asterix.019_552_RSO": "0"
671 validator
.add_dissection(
675 "asterix.019_553_REFTR1": "0",
676 "asterix.019_553_REFTR2": "0",
680 '''TODO: check this testcase, it has too many subitems
681 validator.add_dissection(
682 [0x02, 0x33, 0x33, 0x32],
685 "asterix.019_553_REFTR1": "0",
686 "asterix.019_553_REFTR2": "0",
687 "asterix.019_553_REFTR3": "0",
688 "asterix.019_553_REFTR4": "0",
689 "asterix.019_553_Ref_Trans_5_Status": "0",
690 "asterix.019_553_Ref_Trans_6_Status": "0",
695 validator
.add_dissection(
696 [0x01, 0x80, 0x7f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00],
699 "asterix.019_600_LAT": "359.999999832362",
700 "asterix.019_600_LON": "0"
703 validator
.add_dissection(
704 [0x01, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
707 "asterix.019_600_LAT": "-360",
708 "asterix.019_600_LON": "0"
711 validator
.add_dissection(
712 [0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff],
715 "asterix.019_600_LAT": "0",
716 "asterix.019_600_LON": "359.999999832362"
719 validator
.add_dissection(
720 [0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00],
723 "asterix.019_600_LAT": "0",
724 "asterix.019_600_LON": "-360"
727 validator
.add_dissection(
731 "asterix.019_620_VALUE": "-128"
734 validator
.add_dissection(
739 validator
.add_dissection(
744 '''TODO: re-enable RE and SP tests when implemented
745 validator.add_dissection(
746 [0x01, 0x04, 0x02, 0x00],
749 "asterix.re_field_len": "2",
753 validator.add_dissection(
754 [0x01, 0x04, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
755 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
759 "asterix.re_field_len": "16"
762 validator.add_dissection(
767 validator.add_dissection(
768 [0x01, 0x02, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
769 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
775 validator
.check_dissections()
778 # Fails after automatic updates on December 3, 2023 / MR 13535
779 class _disabled_TestCategory034
:
781 Unittest case for ASTERIX Category 034
783 Online specification:
784 https://www.eurocontrol.int/publications/cat034-monoradar-service-messages-part-2b-next-version-cat-002
787 Transmission of Monoradar Service Messages
789 Standard User Application Profile
791 FRN Data Item Information Length
792 1 I034/010 Data Source Identifier 2
793 2 I034/000 Message Type 1
794 3 I034/030 Time-of-Day 3
795 4 I034/020 Sector Number 1
796 5 I034/041 Antenna Rotation Period 2
797 6 I034/050 System Configuration and Status 1+
798 7 I034/060 System Processing Mode 1+
799 FX N/A. Field Extension Indicator N/A.
800 8 I034/070 Message Count Values (1+2*N)
801 9 I034/100 Generic Polar Window 8
802 10 I034/110 Data Filter 1
803 11 I034/120 3D-Position of Data Source 8
804 12 I034/090 Collimation Error 2
805 13 RE-Data Item Reserved Expansion Field 1+1+
806 14 SP-Data Item Special Purpose Field 1+1+
807 FX N/A. Field Extension Indicator n.a.
810 def test_for_fields(self
, asterix_validator
):
811 '''verifies existence of all fields and their maximum value'''
813 validator
= asterix_validator(34)
815 validator
.add_dissection(
819 "asterix.034_010_SAC": "0xff",
820 "asterix.034_010_SIC": "0x00"
823 validator
.add_dissection(
827 "asterix.034_010_SAC": "0x00",
828 "asterix.034_010_SIC": "0xff"
831 validator
.add_dissection(
835 "asterix.034_000_VALUE": "4"
838 validator
.add_dissection(
839 [0x20, 0xa8, 0xbf, 0xff],
842 "asterix.034_030_VALUE": "86399.9921875"
845 validator
.add_dissection(
849 "asterix.034_020_VALUE": "358.59375"
852 validator
.add_dissection(
856 "asterix.034_041_VALUE": "511.9921875"
860 "asterix.034_050_COM_NOGO": "0",
861 "asterix.034_050_COM_RDPC": "0",
862 "asterix.034_050_COM_RDPR": "0",
863 "asterix.034_050_COM_OVLRDP": "0",
864 "asterix.034_050_COM_OVLXMT": "0",
865 "asterix.034_050_COM_MSC": "0",
866 "asterix.034_050_COM_TSV": "0"
868 validator
.add_dissection(
871 dict_fspec_local(x_050_COM
, "034_050_COM", "NOGO", "1")
873 validator
.add_dissection(
876 dict_fspec_local(x_050_COM
, "034_050_COM", "RDPC", "1")
878 validator
.add_dissection(
881 dict_fspec_local(x_050_COM
, "034_050_COM", "RDPR", "1")
883 validator
.add_dissection(
886 dict_fspec_local(x_050_COM
, "034_050_COM", "OVLRDP", "1")
888 validator
.add_dissection(
891 dict_fspec_local(x_050_COM
, "034_050_COM", "OVLXMT", "1")
893 validator
.add_dissection(
896 dict_fspec_local(x_050_COM
, "034_050_COM", "MSC", "1")
898 validator
.add_dissection(
901 dict_fspec_local(x_050_COM
, "034_050_COM", "TSV", "1")
904 "asterix.034_050_PSR_ANT": "0",
905 "asterix.034_050_PSR_CHAB": "0",
906 "asterix.034_050_PSR_OVL": "0",
907 "asterix.034_050_PSR_MSC": "0"
909 validator
.add_dissection(
912 dict_fspec_local(x_050_PSR
, "034_050_PSR", "ANT", "1")
914 validator
.add_dissection(
917 dict_fspec_local(x_050_PSR
, "034_050_PSR", "CHAB", "3")
919 validator
.add_dissection(
922 dict_fspec_local(x_050_PSR
, "034_050_PSR", "OVL", "1")
924 validator
.add_dissection(
927 dict_fspec_local(x_050_PSR
, "034_050_PSR", "MSC", "1")
930 "asterix.034_050_SSR_ANT": "0",
931 "asterix.034_050_SSR_CHAB": "0",
932 "asterix.034_050_SSR_OVL": "0",
933 "asterix.034_050_SSR_MSC": "0"
935 validator
.add_dissection(
938 dict_fspec_local(x_050_SSR
, "034_050_SSR", "ANT", "1")
940 validator
.add_dissection(
943 dict_fspec_local(x_050_SSR
, "034_050_SSR", "CHAB", "3")
945 validator
.add_dissection(
948 dict_fspec_local(x_050_SSR
, "034_050_SSR", "OVL", "1")
950 validator
.add_dissection(
953 dict_fspec_local(x_050_SSR
, "034_050_SSR", "MSC", "1")
956 "asterix.034_050_MDS_ANT": "0",
957 "asterix.034_050_MDS_CHAB": "0",
958 "asterix.034_050_MDS_OVLSUR": "0",
959 "asterix.034_050_MDS_MSC": "0",
960 "asterix.034_050_MDS_SCF": "0",
961 "asterix.034_050_MDS_DLF": "0",
962 "asterix.034_050_MDS_OVLSCF": "0",
963 "asterix.034_050_MDS_OVLDLF": "0"
965 validator
.add_dissection(
966 [0x04, 0x04, 0x80, 0x00],
968 dict_fspec_local(x_050_MDS
, "034_050_MDS", "ANT", "1")
970 validator
.add_dissection(
971 [0x04, 0x04, 0x60, 0x00],
973 dict_fspec_local(x_050_MDS
, "034_050_MDS", "CHAB", "3")
975 validator
.add_dissection(
976 [0x04, 0x04, 0x10, 0x00],
978 dict_fspec_local(x_050_MDS
, "034_050_MDS", "OVLSUR", "1")
980 validator
.add_dissection(
981 [0x04, 0x04, 0x08, 0x00],
983 dict_fspec_local(x_050_MDS
, "034_050_MDS", "MSC", "1")
985 validator
.add_dissection(
986 [0x04, 0x04, 0x04, 0x00],
988 dict_fspec_local(x_050_MDS
, "034_050_MDS", "SCF", "1")
990 validator
.add_dissection(
991 [0x04, 0x04, 0x02, 0x00],
993 dict_fspec_local(x_050_MDS
, "034_050_MDS", "DLF", "1")
995 validator
.add_dissection(
996 [0x04, 0x04, 0x01, 0x00],
998 dict_fspec_local(x_050_MDS
, "034_050_MDS", "OVLSCF", "1")
1000 validator
.add_dissection(
1001 [0x04, 0x04, 0x00, 0x80],
1003 dict_fspec_local(x_050_MDS
, "034_050_MDS", "OVLDLF", "1")
1006 "asterix.034_060_COM_REDRDP": "0",
1007 "asterix.034_060_COM_REDXMT": "0"
1009 validator
.add_dissection(
1012 dict_fspec_local(x_060_COM
, "034_060_COM", "REDRDP", "7")
1014 validator
.add_dissection(
1017 dict_fspec_local(x_060_COM
, "034_060_COM", "REDXMT", "7")
1020 "asterix.034_060_PSR_POL": "0",
1021 "asterix.034_060_PSR_REDRAD": "0",
1022 "asterix.034_060_PSR_STC": "0"
1024 validator
.add_dissection(
1027 dict_fspec_local(x_060_PSR
, "034_060_PSR", "POL", "1")
1029 validator
.add_dissection(
1032 dict_fspec_local(x_060_PSR
, "034_060_PSR", "REDRAD", "7")
1034 validator
.add_dissection(
1037 dict_fspec_local(x_060_PSR
, "034_060_PSR", "STC", "3")
1039 validator
.add_dissection(
1042 fspec_local("034_060_SSR", "REDRAD", "7")
1045 "asterix.034_060_MDS_REDRAD": "0",
1046 "asterix.034_060_MDS_CLU": "0"
1048 validator
.add_dissection(
1051 dict_fspec_local(x_060_06
, "034_060_MDS", "REDRAD", "7")
1053 validator
.add_dissection(
1056 dict_fspec_local(x_060_06
, "034_060_MDS", "CLU", "1")
1059 "asterix.034_070_TYP": "0",
1060 "asterix.034_070_COUNT": "0"
1062 validator
.add_dissection(
1063 [0x01, 0x80, 0x01, 0x80, 0x00],
1066 "asterix.counter": "1",
1068 dict_local(x_070
, "034_070", "TYP", "16")
1071 validator
.add_dissection(
1072 [0x01, 0x80, 0x03, 0x80, 0x00, 0x87, 0xff, 0x07, 0xff],
1075 "asterix.counter": "3",
1077 dict_local(x_070
, "034_070", "TYPE", "16"),
1080 "asterix.034_070_TYP": "16",
1081 "asterix.034_070_COUNT": "2047"
1084 dict_local(x_070
, "034_070", "COUNT", "2047"),
1088 "asterix.034_100_RHOST": "0",
1089 "asterix.034_100_RHOEND": "0",
1090 "asterix.034_100_THETAST": "0",
1091 "asterix.034_100_THETAEND": "0"
1093 validator
.add_dissection(
1094 [0x01, 0x40, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
1096 dict_local(x_100
, "034_100", "RHOST", "255.99609375")
1098 validator
.add_dissection(
1099 [0x01, 0x40, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00],
1101 dict_local(x_100
, "034_100", "RHOEND", "255.99609375")
1103 validator
.add_dissection(
1104 [0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00],
1106 dict_local(x_100
, "034_100", "THETAST", "359.994506835938")
1108 validator
.add_dissection(
1109 [0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff],
1111 dict_local(x_100
, "034_100", "THETAEND", "359.994506835938")
1113 validator
.add_dissection(
1117 "asterix.034_110_VALUE": "9"
1121 "asterix.034_120_HGT": "0",
1122 "asterix.034_120_LAT": "0",
1123 "asterix.034_120_LON": "0"
1125 validator
.add_dissection(
1126 [0x01, 0x10, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
1128 dict_local(x_120
, "034_120", "HGT", "32767")
1130 validator
.add_dissection(
1131 [0x01, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
1133 dict_local(x_120
, "034_120", "HGT", "32768")
1135 validator
.add_dissection(
1136 [0x01, 0x10, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00],
1138 dict_local(x_120
, "034_120", "LAT", "90")
1140 validator
.add_dissection(
1141 [0x01, 0x10, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00],
1143 dict_local(x_120
, "034_120", "LAT", "-90")
1145 validator
.add_dissection(
1146 [0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff],
1148 dict_local(x_120
, "034_120", "LON", "179.999978542328")
1150 validator
.add_dissection(
1151 [0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00],
1153 dict_local(x_120
, "034_120", "LON", "-180")
1155 '''TODO: re-enable RE and SP tests when implemented
1157 "asterix.034_090_RE": "0",
1158 "asterix.034_090_AE": "0"
1160 validator.add_dissection(
1161 [0x01, 0x08, 0x7f, 0x00],
1163 dict_local(x_090, "034_090", "RE", "0.9921875")
1165 validator.add_dissection(
1166 [0x01, 0x08, 0x80, 0x00],
1168 dict_local(x_090, "034_090", "RE", "-1")
1170 validator.add_dissection(
1171 [0x01, 0x08, 0x00, 0x80],
1173 dict_local(x_090, "034_090", "AE", "-2.8125")
1177 validator
.check_dissections()
1179 def test_undefined_value_handling(self
, asterix_validator
):
1180 '''verifies that the dissector can dissect undefined field values by setting
1181 the maximum value of bits or by setting all undefined bits'''
1183 validator
= asterix_validator(34)
1185 validator
.add_dissection(
1189 "asterix.034_000_VALUE": "255"
1192 validator
.add_dissection(
1193 [0x20, 0xff, 0xff, 0xff],
1196 "asterix.034_030_VALUE": "131071.9921875"
1199 validator
.add_dissection(
1203 "asterix.fspec": "",
1207 validator
.add_dissection(
1211 "asterix.fspec": "",
1212 "asterix.034_050_COM":
1214 "asterix.034_050_COM_NOGO": "0",
1215 "asterix.034_050_COM_RDPC": "0",
1216 "asterix.034_050_COM_RDPR": "0",
1217 "asterix.034_050_COM_OVLRDP": "0",
1218 "asterix.034_050_COM_OVLXMT": "0",
1219 "asterix.034_050_COM_MSC": "0",
1220 "asterix.034_050_COM_TSV": "0"
1224 validator
.add_dissection(
1228 "asterix.fspec": "",
1229 "asterix.034_050_PSR":
1231 "asterix.034_050_PSR_ANT": "0",
1232 "asterix.034_050_PSR_CHAB": "0",
1233 "asterix.034_050_PSR_OVL": "0",
1234 "asterix.034_050_PSR_MSC": "0"
1238 validator
.add_dissection(
1242 "asterix.fspec": "",
1243 "asterix.034_050_SSR":
1245 "asterix.034_050_SSR_ANT": "0",
1246 "asterix.034_050_SSR_CHAB": "0",
1247 "asterix.034_050_SSR_OVL": "0",
1248 "asterix.034_050_SSR_MSC": "0"
1252 validator
.add_dissection(
1253 [0x04, 0x04, 0x00, 0x7f],
1256 "asterix.fspec": "",
1257 "asterix.034_050_MDS":
1259 "asterix.034_050_MDS_ANT": "0",
1260 "asterix.034_050_MDS_CHAB": "0",
1261 "asterix.034_050_MDS_OVLSUR": "0",
1262 "asterix.034_050_MDS_MSC": "0",
1263 "asterix.034_050_MDS_SCF": "0",
1264 "asterix.034_050_MDS_DLF": "0",
1265 "asterix.034_050_MDS_OVLSCF": "0",
1266 "asterix.034_050_MDS_OVLDLF": "0"
1270 validator
.add_dissection(
1274 "asterix.fspec": "",
1278 validator
.add_dissection(
1282 "asterix.fspec": "",
1283 "asterix.034_060_COM":
1285 "asterix.034_060_COM_REDRDP": "0",
1286 "asterix.034_060_COM_REDXMT": "0"
1290 validator
.add_dissection(
1294 "asterix.fspec": "",
1295 "asterix.034_060_PSR":
1297 "asterix.034_060_PSR_POL": "0",
1298 "asterix.034_060_PSR_REDRAD": "0",
1299 "asterix.034_060_PSR_STC": "0"
1303 validator
.add_dissection(
1306 fspec_local("034_060_SSR", "REDRAD", "0")
1308 validator
.add_dissection(
1312 "asterix.fspec": "",
1313 "asterix.034_060_MDS":
1315 "asterix.034_060_MDS_REDRAD": "0",
1316 "asterix.034_060_MDS_CLU": "0"
1321 "asterix.034_070_TYP": "0",
1322 "asterix.034_070_COUNT": "0"
1324 validator
.add_dissection(
1325 [0x01, 0x80, 0x01, 0xf8, 0x00],
1328 "asterix.counter": "1",
1330 dict_local(x_070
, "034_070", "TYP", "31")
1333 validator
.add_dissection(
1337 "asterix.034_110_VALUE": "255"
1340 '''TODO: re-enable RE and SP tests when implemented
1341 validator.add_dissection(
1342 [0x01, 0x04, 0x02, 0xfe],
1345 "asterix.re_field_len": "2",
1349 validator.add_dissection(
1354 validator.add_dissection(
1355 [0x01, 0x02, 0x11, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1356 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
1362 validator
.check_dissections()
1365 class TestCategory048
:
1367 Unittest case for ASTERIX Category 048
1369 Online specification:
1370 https://www.eurocontrol.int/publications/cat048-monoradar-target-reports-part-4-next-version-cat-001
1371 https://www.eurocontrol.int/publications/cat048-reserved-expansion-field-part-4-appendix
1374 Monoradar Target Reports
1376 Standard User Application Profile
1378 FRN Data Item Information Length
1379 1 I048/010 Data Source Identifier 2
1380 2 I048/140 Time-of-Day 3
1381 3 I048/020 Target Report Descriptor 1+
1382 4 I048/040 Measured Position in Slant Polar Coordinates 4
1383 5 I048/070 Mode-3/A Code in Octal Representation 2
1384 6 I048/090 Flight Level in Binary Representation 2
1385 7 I048/130 Radar Plot Characteristics 1+1+
1386 FX n.a. Field Extension Indicator n.a.
1387 8 I048/220 Aircraft Address 3
1388 9 I048/240 Aircraft Identification 6
1389 10 I048/250 Mode S MB Data 1+8*n
1390 11 I048/161 Track Number 2
1391 12 I048/042 Calculated Position in Cartesian Coordinates 4
1392 13 I048/200 Calculated Track Velocity in Polar Representation 4
1393 14 I048/170 Track Status 1+
1394 FX n.a. Field Extension Indicator n.a.
1395 15 I048/210 Track Quality 4
1396 16 I048/030 Warning/Error Conditions 1+
1397 17 I048/080 Mode-3/A Code Confidence Indicator 2
1398 18 I048/100 Mode-C Code and Confidence Indicator 4
1399 19 I048/110 Height Measured by 3D Radar 2
1400 20 I048/120 Radial Doppler Speed 1+
1401 21 I048/230 Communications / ACAS Capability and Flight Status 2
1402 FX n.a. Field Extension Indicator n.a.
1403 22 I048/260 ACAS Resolution Advisory Report 7
1404 23 I048/055 Mode-1 Code in Octal Representation 1
1405 24 I048/050 Mode-2 Code in Octal Representation 2
1406 25 I048/065 Mode-1 Code Confidence Indicator 1
1407 26 I048/060 Mode-2 Code Confidence Indicator 2
1408 27 SP-Data Item Special Purpose Field 1+1+
1409 28 RE-Data Item Reserved Expansion Field 1+1+
1410 FX n.a. Field Extension Indicator n.a.
1413 def test_for_fields(self
, asterix_re_validator
):
1414 '''verifies existence of all fields and their maximum value'''
1416 validator
= asterix_re_validator(48, [0x01, 0x01, 0x01, 0x02])
1418 validator
.add_dissection(
1422 "asterix.048_010_SAC": "0xff",
1423 "asterix.048_010_SIC": "0x00"
1426 validator
.add_dissection(
1430 "asterix.048_010_SAC": "0x00",
1431 "asterix.048_010_SIC": "0xff"
1434 validator
.add_dissection(
1435 [0x40, 0xa8, 0xbf, 0xff],
1438 "asterix.048_140_VALUE": "86399.9921875"
1442 "asterix.048_020_TYP": "0",
1443 "asterix.048_020_SIM": "0",
1444 "asterix.048_020_RDP": "0",
1445 "asterix.048_020_SPI": "0",
1446 "asterix.048_020_RAB": "0",
1449 validator
.add_dissection(
1452 dict_local(x_020
, "048_020", "TYP", "7")
1454 validator
.add_dissection(
1457 dict_local(x_020
, "048_020", "RDP", "1")
1459 validator
.add_dissection(
1462 dict_local(x_020
, "048_020", "SPI", "1")
1464 validator
.add_dissection(
1467 dict_local(x_020
, "048_020", "RAB", "1")
1470 "asterix.048_020_TST": "0",
1471 "asterix.048_020_ERR": "0",
1472 "asterix.048_020_XPP": "0",
1473 "asterix.048_020_ME": "0",
1474 "asterix.048_020_MI": "0",
1475 "asterix.048_020_FOEFRI": "0"
1477 validator
.add_dissection(
1480 dict_local(x_020
, "048_020", "TST", "1")
1482 validator
.add_dissection(
1485 dict_local(x_020
, "048_020", "ERR", "1")
1487 validator
.add_dissection(
1490 dict_local(x_020
, "048_020", "XPP", "1")
1492 validator
.add_dissection(
1495 dict_local(x_020
, "048_020", "ME", "1")
1497 validator
.add_dissection(
1500 dict_local(x_020
, "048_020", "MI", "1")
1502 validator
.add_dissection(
1505 dict_local(x_020
, "048_020", "FOEFRI", "3")
1508 "asterix.048_040_RHO": "0",
1509 "asterix.048_040_THETA": "0"
1511 validator
.add_dissection(
1512 [0x10, 0xff, 0xff, 0x00, 0x00],
1514 dict_local(x_040
, "048_040", "RHO", "255.99609375")
1516 validator
.add_dissection(
1517 [0x10, 0x00, 0x00, 0xff, 0xff],
1519 dict_local(x_040
, "048_040", "THETA", "359.994506835938")
1522 "asterix.048_070_V": "0",
1523 "asterix.048_070_G": "0",
1524 "asterix.048_070_L": "0",
1525 "asterix.048_070_MODE3A": "0"
1527 validator
.add_dissection(
1530 dict_local(x_070
, "048_070", "V", "1")
1532 validator
.add_dissection(
1535 dict_local(x_070
, "048_070", "G", "1")
1537 validator
.add_dissection(
1540 dict_local(x_070
, "048_070", "L", "1")
1542 validator
.add_dissection(
1545 dict_local(x_070
, "048_070", "MODE3A", "3584") # 07000
1547 validator
.add_dissection(
1550 dict_local(x_070
, "048_070", "MODE3A", "448") # 0700
1552 validator
.add_dissection(
1555 dict_local(x_070
, "048_070", "MODE3A", "56") # 070
1557 validator
.add_dissection(
1560 dict_local(x_070
, "048_070", "MODE3A", "7") # 07
1563 "asterix.048_090_V": "0",
1564 "asterix.048_090_G": "0",
1565 "asterix.048_090_FL": "0"
1567 validator
.add_dissection(
1570 dict_local(x_090
, "048_090", "V", "1")
1572 validator
.add_dissection(
1575 dict_local(x_090
, "048_090", "G", "1")
1577 validator
.add_dissection(
1580 dict_local(x_090
, "048_090", "FL", "2047.75")
1582 validator
.add_dissection(
1585 dict_local(x_090
, "048_090", "FL", "-2048")
1587 validator
.add_dissection(
1590 fspec_local("048_130_SRL", "VALUE", "11.2060546875")
1592 validator
.add_dissection(
1595 fspec_local("048_130_SRR", "VALUE", "255")
1597 validator
.add_dissection(
1600 fspec_local("048_130_SAM", "VALUE", "127")
1602 validator
.add_dissection(
1605 fspec_local("048_130_SAM", "VALUE", "-128")
1607 validator
.add_dissection(
1610 fspec_local("048_130_PRL", "VALUE", "11.2060546875")
1612 validator
.add_dissection(
1615 fspec_local("048_130_PAM", "VALUE", "127")
1617 validator
.add_dissection(
1620 fspec_local("048_130_PAM", "VALUE", "-128")
1622 validator
.add_dissection(
1625 fspec_local("048_130_RPD", "VALUE", "0.49609375")
1627 validator
.add_dissection(
1630 fspec_local("048_130_RPD", "VALUE", "-0.5")
1632 validator
.add_dissection(
1635 fspec_local("048_130_APD", "VALUE", "2.79052734375")
1637 validator
.add_dissection(
1640 fspec_local("048_130_APD", "VALUE", "-2.8125")
1642 validator
.add_dissection(
1643 [0x01, 0x80, 0xff, 0xff, 0xff],
1646 "asterix.048_220_VALUE": '0xffffff'
1649 validator
.add_dissection(
1650 [0x01, 0x80, 0xff, 0xff, 0xff],
1653 "asterix.048_220_VALUE": '0xffffff'
1656 validator
.add_dissection(
1657 [0x01, 0x40, 0x04, 0x20, 0xda, 0x83, 0x0c, 0x79],
1660 "asterix.048_240_VALUE": "ABCZ 019"
1664 "asterix.048_250_MBDATA": "00:00:00:00:00:00:00",
1665 "asterix.048_250_BDS1": "0",
1666 "asterix.048_250_BDS2": "0"
1668 validator
.add_dissection(
1671 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1675 "asterix.counter": "1",
1677 dict_global(x_250
, "048_250_MBDATA", '0x0011223344556677'),
1680 '''TODO: result seems correct, check dict format
1681 validator.add_dissection(
1684 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1688 "asterix.counter": "1",
1690 dict_global(x_250, "048_250_BDS1", "15"),
1693 validator.add_dissection(
1696 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1700 "asterix.counter": "1",
1702 dict_global(x_250, "BDS2", "15"),
1705 validator.add_dissection(
1708 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1710 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1712 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1716 "asterix.counter": "3",
1718 dict_global(x_250, "048_250_MBDATA", '0x0011223344556677'),
1720 dict_global(x_250, "048_250_BDS1", "15"),
1722 dict_global(x_250, "048_250_BDS2", "15"),
1726 validator
.add_dissection(
1727 [0x01, 0x10, 0x0f, 0xff],
1730 "asterix.048_161_TRN": "4095"
1734 "asterix.048_042_X": "0",
1735 "asterix.048_042_Y": "0"
1737 validator
.add_dissection(
1738 [0x01, 0x08, 0x7f, 0xff, 0x00, 0x00],
1740 dict_local(x_042
, "048_042", "X", "255.9921875")
1742 validator
.add_dissection(
1743 [0x01, 0x08, 0x80, 0x00, 0x00, 0x00],
1745 dict_local(x_042
, "048_042", "X", "-256")
1747 validator
.add_dissection(
1748 [0x01, 0x08, 0x00, 0x0, 0x7f, 0xff],
1750 dict_local(x_042
, "048_042", "Y", "255.9921875")
1752 validator
.add_dissection(
1753 [0x01, 0x08, 0x00, 0x0, 0x80, 0x00],
1755 dict_local(x_042
, "048_042", "Y", "-256")
1758 "asterix.048_200_GSP": "0",
1759 "asterix.048_200_HDG": "0"
1761 validator
.add_dissection(
1762 [0x01, 0x04, 0xff, 0xff, 0x00, 0x00],
1764 dict_local(x_200
, "048_200", "GSP", "3.99993896484375")
1766 validator
.add_dissection(
1767 [0x01, 0x04, 0x00, 0x00, 0xff, 0xff],
1769 dict_local(x_200
, "048_200", "HDG", "359.994506835938")
1772 "asterix.048_170_CNF": "0",
1773 "asterix.048_170_RAD": "0",
1774 "asterix.048_170_DOU": "0",
1775 "asterix.048_170_MAH": "0",
1776 "asterix.048_170_CDM": "0",
1779 validator
.add_dissection(
1782 dict_local(x_170
, "048_170", "CNF", "1")
1784 validator
.add_dissection(
1787 dict_local(x_170
, "048_170", "RAD", "3")
1789 validator
.add_dissection(
1792 dict_local(x_170
, "048_170", "DOU", "1")
1794 validator
.add_dissection(
1797 dict_local(x_170
, "048_170", "MAH", "1")
1799 validator
.add_dissection(
1802 dict_local(x_170
, "048_170", "CDM", "3")
1805 "asterix.048_170_TRE": "0",
1806 "asterix.048_170_GHO": "0",
1807 "asterix.048_170_SUP": "0",
1808 "asterix.048_170_TCC": "0"
1810 validator
.add_dissection(
1811 [0x01, 0x02, 0x01, 0x80],
1813 dict_local(x_170
, "048_170", "TRE", "1")
1815 validator
.add_dissection(
1816 [0x01, 0x02, 0x01, 0x40],
1818 dict_local(x_170
, "048_170", "GHO", "1")
1820 validator
.add_dissection(
1821 [0x01, 0x02, 0x01, 0x20],
1823 dict_local(x_170
, "048_170", "SUP", "1")
1825 validator
.add_dissection(
1826 [0x01, 0x02, 0x01, 0x10],
1828 dict_local(x_170
, "048_170", "TCC", "1")
1831 "asterix.048_210_SIGX": "0",
1832 "asterix.048_210_SIGY": "0",
1833 "asterix.048_210_SIGV": "0",
1834 "asterix.048_210_SIGH": "0"
1836 validator
.add_dissection(
1837 [0x01, 0x01, 0x80, 0xff, 0x00, 0x00, 0x00],
1839 dict_local(x_210
, "048_210", "SIGX", "1.9921875")
1841 validator
.add_dissection(
1842 [0x01, 0x01, 0x80, 0x00, 0xff, 0x00, 0x00],
1844 dict_local(x_210
, "048_210", "SIGY", "1.9921875")
1846 validator
.add_dissection(
1847 [0x01, 0x01, 0x80, 0x00, 0x00, 0xff, 0x00],
1849 dict_local(x_210
, "048_210", "SIGV", "0.01556396484375")
1851 validator
.add_dissection(
1852 [0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0xff],
1854 dict_local(x_210
, "048_210", "SIGH", "22.412109375")
1856 validator
.add_dissection(
1857 [0x01, 0x01, 0x40, 0x2e],
1860 "asterix.048_030_Subitem": "23",
1864 '''TODO: check this test, not according to the specs
1865 validator.add_dissection(
1866 [0x01, 0x01, 0x40, 0x2f, 0x03, 0x05, 0x06],
1869 "asterix.048_030_WE": "23",
1870 "asterix.048_030_1_WE": "1",
1871 "asterix.048_030_2_WE": "2",
1872 "asterix.048_030_3_WE": "3",
1878 "asterix.048_080_QA4": "0",
1879 "asterix.048_080_QA2": "0",
1880 "asterix.048_080_QA1": "0",
1881 "asterix.048_080_QB4": "0",
1882 "asterix.048_080_QB2": "0",
1883 "asterix.048_080_QB1": "0",
1884 "asterix.048_080_QC4": "0",
1885 "asterix.048_080_QC2": "0",
1886 "asterix.048_080_QC1": "0",
1887 "asterix.048_080_QD4": "0",
1888 "asterix.048_080_QD2": "0",
1889 "asterix.048_080_QD1": "0"
1891 validator
.add_dissection(
1892 [0x01, 0x01, 0x20, 0x08, 0x00],
1894 dict_local(x_080
, "048_080", "QA4", "1")
1896 validator
.add_dissection(
1897 [0x01, 0x01, 0x20, 0x04, 0x00],
1899 dict_local(x_080
, "048_080", "QA2", "1")
1901 validator
.add_dissection(
1902 [0x01, 0x01, 0x20, 0x02, 0x00],
1904 dict_local(x_080
, "048_080", "QA1", "1")
1906 validator
.add_dissection(
1907 [0x01, 0x01, 0x20, 0x01, 0x00],
1909 dict_local(x_080
, "048_080", "QB4", "1")
1911 validator
.add_dissection(
1912 [0x01, 0x01, 0x20, 0x00, 0x80],
1914 dict_local(x_080
, "048_080", "QB2", "1")
1916 validator
.add_dissection(
1917 [0x01, 0x01, 0x20, 0x00, 0x40],
1919 dict_local(x_080
, "048_080", "QB1", "1")
1921 validator
.add_dissection(
1922 [0x01, 0x01, 0x20, 0x00, 0x20],
1924 dict_local(x_080
, "048_080", "QC4", "1")
1926 validator
.add_dissection(
1927 [0x01, 0x01, 0x20, 0x00, 0x10],
1929 dict_local(x_080
, "048_080", "QC2", "1")
1931 validator
.add_dissection(
1932 [0x01, 0x01, 0x20, 0x00, 0x08],
1934 dict_local(x_080
, "048_080", "QC1", "1")
1936 validator
.add_dissection(
1937 [0x01, 0x01, 0x20, 0x00, 0x04],
1939 dict_local(x_080
, "048_080", "QD4", "1")
1941 validator
.add_dissection(
1942 [0x01, 0x01, 0x20, 0x00, 0x02],
1944 dict_local(x_080
, "048_080", "QD2", "1")
1946 validator
.add_dissection(
1947 [0x01, 0x01, 0x20, 0x00, 0x01],
1949 dict_local(x_080
, "048_080", "QD1", "1")
1951 '''TODO: A,B,C,D values need to go to single subitem 'MODEC'
1953 "asterix.048_100_V": "0",
1954 "asterix.048_100_G": "0",
1955 "asterix.048_100_C1": "0",
1956 "asterix.048_100_A1": "0",
1957 "asterix.048_100_C2": "0",
1958 "asterix.048_100_A2": "0",
1959 "asterix.048_100_C4": "0",
1960 "asterix.048_100_A4": "0",
1961 "asterix.048_100_B1": "0",
1962 "asterix.048_100_D1": "0",
1963 "asterix.048_100_B2": "0",
1964 "asterix.048_100_D2": "0",
1965 "asterix.048_100_B4": "0",
1966 "asterix.048_100_D4": "0",
1967 "asterix.048_100_QC1": "0",
1968 "asterix.048_100_QA1": "0",
1969 "asterix.048_100_QC2": "0",
1970 "asterix.048_100_QA2": "0",
1971 "asterix.048_100_QC4": "0",
1972 "asterix.048_100_QA4": "0",
1973 "asterix.048_100_QB1": "0",
1974 "asterix.048_100_QD1": "0",
1975 "asterix.048_100_QB2": "0",
1976 "asterix.048_100_QD2": "0",
1977 "asterix.048_100_QB4": "0",
1978 "asterix.048_100_QD4": "0"
1980 validator.add_dissection(
1981 [0x01, 0x01, 0x10, 0x80, 0x00, 0x00, 0x00],
1983 dict_local(x_100, "048_100", "V", "1")
1985 validator.add_dissection(
1986 [0x01, 0x01, 0x10, 0x40, 0x00, 0x00, 0x00],
1988 dict_local(x_100, "048_100", "G", "1")
1990 validator.add_dissection(
1991 [0x01, 0x01, 0x10, 0x08, 0x00, 0x00, 0x00],
1993 dict_local(x_100, "048_100", "C1", "1")
1995 validator.add_dissection(
1996 [0x01, 0x01, 0x10, 0x04, 0x00, 0x00, 0x00],
1998 dict_local(x_100, "048_100", "A1", "1")
2000 validator.add_dissection(
2001 [0x01, 0x01, 0x10, 0x02, 0x00, 0x00, 0x00],
2003 dict_local(x_100, "048_100", "C2", "1")
2005 validator.add_dissection(
2006 [0x01, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00],
2008 dict_local(x_100, "048_100", "A2", "1")
2010 validator.add_dissection(
2011 [0x01, 0x01, 0x10, 0x00, 0x80, 0x00, 0x00],
2013 dict_local(x_100, "048_100", "C4", "1")
2015 validator.add_dissection(
2016 [0x01, 0x01, 0x10, 0x00, 0x40, 0x00, 0x00],
2018 dict_local(x_100, "048_100", "A4", "1")
2020 validator.add_dissection(
2021 [0x01, 0x01, 0x10, 0x00, 0x20, 0x00, 0x00],
2023 dict_local(x_100, "048_100", "B1", "1")
2025 validator.add_dissection(
2026 [0x01, 0x01, 0x10, 0x00, 0x10, 0x00, 0x00],
2028 dict_local(x_100, "048_100", "D1", "1")
2030 validator.add_dissection(
2031 [0x01, 0x01, 0x10, 0x00, 0x08, 0x00, 0x00],
2033 dict_local(x_100, "048_100", "B2", "1")
2035 validator.add_dissection(
2036 [0x01, 0x01, 0x10, 0x00, 0x04, 0x00, 0x00],
2038 dict_local(x_100, "048_100", "D2", "1")
2040 validator.add_dissection(
2041 [0x01, 0x01, 0x10, 0x00, 0x02, 0x00, 0x00],
2043 dict_local(x_100, "048_100", "B4", "1")
2045 validator.add_dissection(
2046 [0x01, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00],
2048 dict_local(x_100, "048_100", "D4", "1")
2050 validator.add_dissection(
2051 [0x01, 0x01, 0x10, 0x00, 0x00, 0x08, 0x00],
2053 dict_local(x_100, "048_100", "QC1", "1")
2055 validator.add_dissection(
2056 [0x01, 0x01, 0x10, 0x00, 0x00, 0x04, 0x00],
2058 dict_local(x_100, "048_100", "QA1", "1")
2060 validator.add_dissection(
2061 [0x01, 0x01, 0x10, 0x00, 0x00, 0x02, 0x00],
2063 dict_local(x_100, "048_100", "QC2", "1")
2065 validator.add_dissection(
2066 [0x01, 0x01, 0x10, 0x00, 0x00, 0x01, 0x00],
2068 dict_local(x_100, "048_100", "QA2", "1")
2070 validator.add_dissection(
2071 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x80],
2073 dict_local(x_100, "048_100", "QC4", "1")
2075 validator.add_dissection(
2076 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x40],
2078 dict_local(x_100, "048_100", "QA4", "1")
2080 validator.add_dissection(
2081 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x20],
2083 dict_local(x_100, "048_100", "QB1", "1")
2085 validator.add_dissection(
2086 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x10],
2088 dict_local(x_100, "048_100", "QD1", "1")
2090 validator.add_dissection(
2091 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x08],
2093 dict_local(x_100, "048_100", "QB2", "1")
2095 validator.add_dissection(
2096 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x04],
2098 dict_local(x_100, "048_100", "QD2", "1")
2100 validator.add_dissection(
2101 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x02],
2103 dict_local(x_100, "048_100", "QB4", "1")
2105 validator.add_dissection(
2106 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x01],
2108 dict_local(x_100, "048_100", "QD4", "1")
2111 validator
.add_dissection(
2112 [0x01, 0x01, 0x08, 0x1f, 0xff],
2115 "asterix.048_110_3DH": "204775"
2118 validator
.add_dissection(
2119 [0x01, 0x01, 0x08, 0x20, 0x00],
2122 "asterix.048_110_3DH": "-204800"
2126 "asterix.048_120_CAL_D": "0",
2127 "asterix.048_120_CAL_CAL": "0"
2129 validator
.add_dissection(
2130 [0x01, 0x01, 0x04, 0x80, 0x80, 0x00],
2132 dict_fspec_local(x_120_01
, "048_120_CAL", "D", "1")
2134 validator
.add_dissection(
2135 [0x01, 0x01, 0x04, 0x80, 0x01, 0xff],
2137 dict_fspec_local(x_120_01
, "048_120_CAL", "CAL", "511")
2139 validator
.add_dissection(
2140 [0x01, 0x01, 0x04, 0x80, 0x02, 0x00],
2142 dict_fspec_local(x_120_01
, "048_120_CAL", "CAL", "-512")
2145 "asterix.048_120_RDS_DOP": "0",
2146 "asterix.048_120_RDS_AMB": "0",
2147 "asterix.048_120_RDS_FRQ": "0"
2149 validator
.add_dissection(
2150 [0x01, 0x01, 0x04, 0x40, 0x01, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00],
2152 counter_local(x_120_RDS
, "1", "048_120_RDS", "DOP", "32767")
2154 validator
.add_dissection(
2155 [0x01, 0x01, 0x04, 0x40, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00],
2157 counter_local(x_120_RDS
, "1", "048_120_RDS", "DOP", "32768")
2159 validator
.add_dissection(
2160 [0x01, 0x01, 0x04, 0x40, 0x01, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00],
2162 counter_local(x_120_RDS
, "1", "048_120_RDS", "AMB", "65535")
2164 validator
.add_dissection(
2165 [0x01, 0x01, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff],
2167 counter_local(x_120_RDS
, "1", "048_120_RDS", "FRQ", "65535")
2169 validator
.add_dissection(
2170 [0x01, 0x01, 0x04, 0x40, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
2171 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
2175 "asterix.fspec": "",
2176 "asterix.048_120_RDS":
2178 "asterix.counter": "3",
2179 "asterix.048_120_RDS":
2180 dict_local(x_120_RDS
, "048_120_RDS", "DOP", "-32768"),
2181 "asterix.048_120_RDS":
2182 dict_local(x_120_RDS
, "048_120_RDS", "AMB", "65535"),
2183 "asterix.048_120_RDS":
2184 dict_local(x_120_RDS
, "048_120_RDS", "FRQ", "65535")
2189 "asterix.048_230_COM": "0",
2190 "asterix.048_230_STAT": "0",
2191 "asterix.048_230_SI": "0",
2192 "asterix.048_230_MSSC": "0",
2193 "asterix.048_230_ARC": "0",
2194 "asterix.048_230_AIC": "0",
2195 "asterix.048_230_B1A": "0",
2196 "asterix.048_230_B1B": "0"
2198 validator
.add_dissection(
2199 [0x01, 0x01, 0x02, 0xe0, 0x00],
2201 dict_local(x_230
, "048_230", "COM", "7")
2203 validator
.add_dissection(
2204 [0x01, 0x01, 0x02, 0x1c, 0x00],
2206 dict_local(x_230
, "048_230", "STAT", "7")
2208 validator
.add_dissection(
2209 [0x01, 0x01, 0x02, 0x02, 0x00],
2211 dict_local(x_230
, "048_230", "SI", "1")
2213 validator
.add_dissection(
2214 [0x01, 0x01, 0x02, 0x00, 0x80],
2216 dict_local(x_230
, "048_230", "MSSC", "1")
2218 validator
.add_dissection(
2219 [0x01, 0x01, 0x02, 0x00, 0x40],
2221 dict_local(x_230
, "048_230", "ARC", "1")
2223 validator
.add_dissection(
2224 [0x01, 0x01, 0x02, 0x00, 0x20],
2226 dict_local(x_230
, "048_230", "AIC", "1")
2228 validator
.add_dissection(
2229 [0x01, 0x01, 0x02, 0x00, 0x10],
2231 dict_local(x_230
, "048_230", "B1A", "1")
2233 validator
.add_dissection(
2234 [0x01, 0x01, 0x02, 0x00, 0x0f],
2236 dict_local(x_230
, "048_230", "B1B", "15")
2238 validator
.add_dissection(
2239 [0x01, 0x01, 0x01, 0x80, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77],
2242 "asterix.048_260_VALUE": '0x0011223344556677'
2246 "asterix.048_055_V": "0",
2247 "asterix.048_055_G": "0",
2248 "asterix.048_055_L": "0",
2249 "asterix.048_055_MODE1": "0"
2251 validator
.add_dissection(
2252 [0x01, 0x01, 0x01, 0x40, 0x80],
2254 dict_local(x_055
, "048_055", "V", "1")
2256 validator
.add_dissection(
2257 [0x01, 0x01, 0x01, 0x40, 0x40],
2259 dict_local(x_055
, "048_055", "G", "1")
2261 validator
.add_dissection(
2262 [0x01, 0x01, 0x01, 0x40, 0x20],
2264 dict_local(x_055
, "048_055", "L", "1")
2266 validator
.add_dissection(
2267 [0x01, 0x01, 0x01, 0x40, 0x1f],
2269 dict_local(x_055
, "048_055", "MODE1", "31")
2272 "asterix.048_050_V": "0",
2273 "asterix.048_050_G": "0",
2274 "asterix.048_050_L": "0",
2275 "asterix.048_050_MODE2": "0"
2277 validator
.add_dissection(
2278 [0x01, 0x01, 0x01, 0x20, 0x80, 0x00],
2280 dict_local(x_050
, "048_050", "V", "1")
2282 validator
.add_dissection(
2283 [0x01, 0x01, 0x01, 0x20, 0x40, 0x00],
2285 dict_local(x_050
, "048_050", "G", "1")
2287 validator
.add_dissection(
2288 [0x01, 0x01, 0x01, 0x20, 0x20, 0x00],
2290 dict_local(x_050
, "048_050", "L", "1")
2292 validator
.add_dissection(
2293 [0x01, 0x01, 0x01, 0x20, 0x0f, 0xff],
2295 dict_local(x_050
, "048_050", "MODE2", "4095")
2298 "asterix.048_065_QA4": "0",
2299 "asterix.048_065_QA2": "0",
2300 "asterix.048_065_QA1": "0",
2301 "asterix.048_065_QB2": "0",
2302 "asterix.048_065_QB1": "0"
2304 validator
.add_dissection(
2305 [0x01, 0x01, 0x01, 0x10, 0x10],
2307 dict_local(x_065
, "048_065", "QA4", "1")
2309 validator
.add_dissection(
2310 [0x01, 0x01, 0x01, 0x10, 0x08],
2312 dict_local(x_065
, "048_065", "QA2", "1")
2314 validator
.add_dissection(
2315 [0x01, 0x01, 0x01, 0x10, 0x04],
2317 dict_local(x_065
, "048_065", "QA1", "1")
2319 validator
.add_dissection(
2320 [0x01, 0x01, 0x01, 0x10, 0x02],
2322 dict_local(x_065
, "048_065", "QB2", "1")
2324 validator
.add_dissection(
2325 [0x01, 0x01, 0x01, 0x10, 0x01],
2327 dict_local(x_065
, "048_065", "QB1", "1")
2330 "asterix.048_060_QA4": "0",
2331 "asterix.048_060_QA2": "0",
2332 "asterix.048_060_QA1": "0",
2333 "asterix.048_060_QB4": "0",
2334 "asterix.048_060_QB2": "0",
2335 "asterix.048_060_QB1": "0",
2336 "asterix.048_060_QC4": "0",
2337 "asterix.048_060_QC2": "0",
2338 "asterix.048_060_QC1": "0",
2339 "asterix.048_060_QD4": "0",
2340 "asterix.048_060_QD2": "0",
2341 "asterix.048_060_QD1": "0"
2343 validator
.add_dissection(
2344 [0x01, 0x01, 0x01, 0x08, 0x08, 0x00],
2346 dict_local(x_060
, "048_060", "QA4", "1")
2348 validator
.add_dissection(
2349 [0x01, 0x01, 0x01, 0x08, 0x04, 0x00],
2351 dict_local(x_060
, "048_060", "QA2", "1")
2353 validator
.add_dissection(
2354 [0x01, 0x01, 0x01, 0x08, 0x02, 0x00],
2356 dict_local(x_060
, "048_060", "QA1", "1")
2358 validator
.add_dissection(
2359 [0x01, 0x01, 0x01, 0x08, 0x01, 0x00],
2361 dict_local(x_060
, "048_060", "QB4", "1")
2363 validator
.add_dissection(
2364 [0x01, 0x01, 0x01, 0x08, 0x00, 0x80],
2366 dict_local(x_060
, "048_060", "QB2", "1")
2368 validator
.add_dissection(
2369 [0x01, 0x01, 0x01, 0x08, 0x00, 0x40],
2371 dict_local(x_060
, "048_060", "QB1", "1")
2373 validator
.add_dissection(
2374 [0x01, 0x01, 0x01, 0x08, 0x00, 0x20],
2376 dict_local(x_060
, "048_060", "QC4", "1")
2378 validator
.add_dissection(
2379 [0x01, 0x01, 0x01, 0x08, 0x00, 0x10],
2381 dict_local(x_060
, "048_060", "QC2", "1")
2383 validator
.add_dissection(
2384 [0x01, 0x01, 0x01, 0x08, 0x00, 0x08],
2386 dict_local(x_060
, "048_060", "QC1", "1")
2388 validator
.add_dissection(
2389 [0x01, 0x01, 0x01, 0x08, 0x00, 0x04],
2391 dict_local(x_060
, "048_060", "QD4", "1")
2393 validator
.add_dissection(
2394 [0x01, 0x01, 0x01, 0x08, 0x00, 0x02],
2396 dict_local(x_060
, "048_060", "QD2", "1")
2398 validator
.add_dissection(
2399 [0x01, 0x01, 0x01, 0x08, 0x00, 0x01],
2401 dict_local(x_060
, "048_060", "QD1", "1")
2403 validator
.add_dissection(
2404 [0x01, 0x01, 0x01, 0x04, 0x01],
2408 validator
.add_dissection(
2409 [0x01, 0x01, 0x01, 0x04, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
2410 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
2414 '''TODO: re-enable RE and SP tests when implemented
2416 "asterix.048_RE_MD5_01_M5": "0",
2417 "asterix.048_RE_MD5_01_ID": "0",
2418 "asterix.048_RE_MD5_01_DA": "0",
2419 "asterix.048_RE_MD5_01_M1": "0",
2420 "asterix.048_RE_MD5_01_M2": "0",
2421 "asterix.048_RE_MD5_01_M3": "0",
2422 "asterix.048_RE_MD5_01_MC": "0"
2424 validator.add_re_dissection(
2427 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M5", "1")
2429 validator.add_re_dissection(
2432 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "ID", "1")
2434 validator.add_re_dissection(
2437 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "DA", "1")
2439 validator.add_re_dissection(
2442 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M1", "1")
2444 validator.add_re_dissection(
2447 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M2", "1")
2449 validator.add_re_dissection(
2452 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M3", "1")
2454 validator.add_re_dissection(
2457 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "MC", "1")
2460 "asterix.048_RE_MD5_02_PIN": "0",
2461 "asterix.048_RE_MD5_02_NAV": "0",
2462 "asterix.048_RE_MD5_02_NAT": "0",
2463 "asterix.048_RE_MD5_02_MIS": "0"
2465 validator.add_re_dissection(
2466 [0x80, 0x40, 0x3f, 0xff, 0x00, 0x00],
2468 dict_fspec_local(x_re_pmn, "048_RE_MD5_02", "PIN", "16383")
2470 validator.add_re_dissection(
2471 [0x80, 0x40, 0x00, 0x00, 0x20, 0x00],
2473 dict_fspec_local(x_re_pmn, "048_RE_MD5_02", "NAV", "1")
2475 validator.add_re_dissection(
2476 [0x80, 0x40, 0x00, 0x00, 0x1f, 0x00],
2478 dict_fspec_local(x_re_pmn, "048_RE_MD5_02", "NAT", "31")
2480 validator.add_re_dissection(
2481 [0x80, 0x40, 0x00, 0x00, 0x00, 0x3f],
2483 dict_fspec_local(x_re_pmn, "048_RE_MD5_02", "MIS", "63")
2486 "asterix.048_RE_MD5_03_LAT": "0",
2487 "asterix.048_RE_MD5_03_LON": "0"
2489 validator.add_re_dissection(
2490 [0x80, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00],
2492 dict_fspec_local(x_re_pos, "048_RE_MD5_03", "LAT", "90")
2494 validator.add_re_dissection(
2495 [0x80, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00],
2497 dict_fspec_local(x_re_pos, "048_RE_MD5_03", "LAT", "-90")
2499 validator.add_re_dissection(
2500 [0x80, 0x20, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff],
2502 dict_fspec_local(x_re_pos, "048_RE_MD5_03",
2503 "LON", "179.999978542328")
2505 validator.add_re_dissection(
2506 [0x80, 0x20, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00],
2508 dict_fspec_local(x_re_pos, "048_RE_MD5_03", "LON", "-180")
2511 "asterix.048_RE_MD5_04_RES": "0",
2512 "asterix.048_RE_MD5_04_GA": "0"
2514 validator.add_re_dissection(
2515 [0x80, 0x10, 0x40, 0x00],
2517 dict_fspec_local(x_re_ga, "048_RE_MD5_04", "RES", "1")
2519 validator.add_re_dissection(
2520 [0x80, 0x10, 0x1f, 0xff],
2522 dict_fspec_local(x_re_ga, "048_RE_MD5_04", "GA", "204775")
2524 validator.add_re_dissection(
2525 [0x80, 0x10, 0x20, 0x00],
2527 dict_fspec_local(x_re_ga, "048_RE_MD5_04", "GA", "-204800")
2530 "asterix.048_RE_MD5_05_V": "0",
2531 "asterix.048_RE_MD5_05_G": "0",
2532 "asterix.048_RE_MD5_05_L": "0",
2533 "asterix.048_RE_MD5_05_MODE3A": "0"
2535 validator.add_re_dissection(
2536 [0x80, 0x08, 0x80, 0x00],
2538 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "V", "1")
2540 validator.add_re_dissection(
2541 [0x80, 0x08, 0x40, 0x00],
2543 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "G", "1")
2545 validator.add_re_dissection(
2546 [0x80, 0x08, 0x20, 0x00],
2548 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "L", "1")
2550 validator.add_re_dissection(
2551 [0x80, 0x08, 0x0f, 0xff],
2553 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "MODE3A", "4095")
2555 validator.add_re_dissection(
2558 fspec_local("048_RE_MD5_06", "TOS", "0.9921875")
2560 validator.add_re_dissection(
2563 fspec_local("048_RE_MD5_06", "TOS", "-1")
2566 "asterix.048_RE_MD5_07_XP": "0",
2567 "asterix.048_RE_MD5_07_X5": "0",
2568 "asterix.048_RE_MD5_07_XC": "0",
2569 "asterix.048_RE_MD5_07_X3": "0",
2570 "asterix.048_RE_MD5_07_X2": "0",
2571 "asterix.048_RE_MD5_07_X1": "0"
2573 validator.add_re_dissection(
2576 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "XP", "1")
2578 validator.add_re_dissection(
2581 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X5", "1")
2583 validator.add_re_dissection(
2586 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "XC", "1")
2588 validator.add_re_dissection(
2591 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X3", "1")
2593 validator.add_re_dissection(
2596 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X2", "1")
2598 validator.add_re_dissection(
2601 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X1", "1")
2604 "asterix.048_RE_M5N_01_M5": "0",
2605 "asterix.048_RE_M5N_01_ID": "0",
2606 "asterix.048_RE_M5N_01_DA": "0",
2607 "asterix.048_RE_M5N_01_M1": "0",
2608 "asterix.048_RE_M5N_01_M2": "0",
2609 "asterix.048_RE_M5N_01_M3": "0",
2610 "asterix.048_RE_M5N_01_MC": "0"
2612 validator.add_re_dissection(
2615 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M5", "1")
2617 validator.add_re_dissection(
2620 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "ID", "1")
2622 validator.add_re_dissection(
2625 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "DA", "1")
2627 validator.add_re_dissection(
2630 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M1", "1")
2632 validator.add_re_dissection(
2635 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M2", "1")
2637 validator.add_re_dissection(
2640 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M3", "1")
2642 validator.add_re_dissection(
2645 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "MC", "1")
2648 "asterix.048_RE_M5N_02_PIN": "0",
2649 "asterix.048_RE_M5N_02_NOV": "0",
2650 "asterix.048_RE_M5N_02_NO": "0"
2652 validator.add_re_dissection(
2653 [0x40, 0x40, 0x3f, 0xff, 0x00, 0x00],
2655 dict_fspec_local(x_re_pmn, "048_RE_M5N_02", "PIN", "16383")
2657 validator.add_re_dissection(
2658 [0x40, 0x40, 0x00, 0x00, 0x08, 0x00],
2660 dict_fspec_local(x_re_pmn, "048_RE_M5N_02", "NOV", "1")
2662 validator.add_re_dissection(
2663 [0x40, 0x40, 0x00, 0x00, 0x07, 0xff],
2665 dict_fspec_local(x_re_pmn, "048_RE_M5N_02", "NO", "2047")
2668 "asterix.048_RE_M5N_03_LAT": "0",
2669 "asterix.048_RE_M5N_03_LON": "0"
2671 validator.add_re_dissection(
2672 [0x40, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00],
2674 dict_fspec_local(x_re_pos, "048_RE_M5N_03", "LAT", "90")
2676 validator.add_re_dissection(
2677 [0x40, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00],
2679 dict_fspec_local(x_re_pos, "048_RE_M5N_03", "LAT", "-90")
2681 validator.add_re_dissection(
2682 [0x40, 0x20, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff],
2684 dict_fspec_local(x_re_pos, "048_RE_M5N_03",
2685 "LON", "179.999978542328")
2687 validator.add_re_dissection(
2688 [0x40, 0x20, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00],
2690 dict_fspec_local(x_re_pos, "048_RE_M5N_03", "LON", "-180")
2693 "asterix.048_RE_M5N_04_RES": "0",
2694 "asterix.048_RE_M5N_04_GA": "0"
2696 validator.add_re_dissection(
2697 [0x40, 0x10, 0x40, 0x00],
2699 dict_fspec_local(x_re_ga, "048_RE_M5N_04", "RES", "1")
2701 validator.add_re_dissection(
2702 [0x40, 0x10, 0x1f, 0xff],
2704 dict_fspec_local(x_re_ga, "048_RE_M5N_04", "GA", "204775")
2706 validator.add_re_dissection(
2707 [0x40, 0x10, 0x20, 0x00],
2709 dict_fspec_local(x_re_ga, "048_RE_M5N_04", "GA", "-204800")
2712 "asterix.048_RE_M5N_05_V": "0",
2713 "asterix.048_RE_M5N_05_G": "0",
2714 "asterix.048_RE_M5N_05_L": "0",
2715 "asterix.048_RE_M5N_05_MODE3A": "0"
2717 validator.add_re_dissection(
2718 [0x40, 0x08, 0x80, 0x00],
2720 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "V", "1")
2722 validator.add_re_dissection(
2723 [0x40, 0x08, 0x40, 0x00],
2725 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "G", "1")
2727 validator.add_re_dissection(
2728 [0x40, 0x08, 0x20, 0x00],
2730 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "L", "1")
2732 validator.add_re_dissection(
2733 [0x40, 0x08, 0x0f, 0xff],
2735 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "MODE3A", "4095")
2737 validator.add_re_dissection(
2740 fspec_local("048_RE_M5N_06", "TOS", "0.9921875")
2742 validator.add_re_dissection(
2745 fspec_local("048_RE_M5N_06", "TOS", "-1")
2748 "asterix.048_RE_M5N_07_XP": "0",
2749 "asterix.048_RE_M5N_07_X5": "0",
2750 "asterix.048_RE_M5N_07_XC": "0",
2751 "asterix.048_RE_M5N_07_X3": "0",
2752 "asterix.048_RE_M5N_07_X2": "0",
2753 "asterix.048_RE_M5N_07_X1": "0"
2755 validator.add_re_dissection(
2758 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "XP", "1")
2760 validator.add_re_dissection(
2763 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X5", "1")
2765 validator.add_re_dissection(
2768 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "XC", "1")
2770 validator.add_re_dissection(
2773 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X3", "1")
2775 validator.add_re_dissection(
2778 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X2", "1")
2780 validator.add_re_dissection(
2783 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X1", "1")
2785 validator.add_re_dissection(
2786 [0x40, 0x01, 0x80, 0x1f],
2788 fspec_local("048_RE_M5N_08", "FOM", "31")
2790 validator.add_re_dissection(
2794 "asterix.048_RE_M4E_FOE_FRI": "3",
2798 validator.add_re_dissection(
2801 fspec_local("048_RE_RPC_01", "SCO", "255")
2803 validator.add_re_dissection(
2804 [0x10, 0x40, 0xff, 0xff],
2806 fspec_local("048_RE_RPC_02", "SCR", "6553.5")
2808 validator.add_re_dissection(
2809 [0x10, 0x20, 0xff, 0xff],
2811 fspec_local("048_RE_RPC_03", "RW", "255.99609375")
2813 validator.add_re_dissection(
2814 [0x10, 0x10, 0xff, 0xff],
2816 fspec_local("048_RE_RPC_04", "AR", "255.99609375")
2818 validator.add_re_dissection(
2819 [0x08, 0xff, 0xff, 0xff],
2822 "asterix.048_RE_ERR_RHO": "65535.99609375"
2827 validator
.check_dissections()
2829 def test_undefined_value_handling(self
, asterix_re_validator
):
2830 '''verifies that the dissector can dissect undefined field values by
2831 setting the maximum value of bits or by setting all undefined bits'''
2833 validator
= asterix_re_validator(48, [0x01, 0x01, 0x01, 0x02])
2835 validator
.add_dissection(
2839 "asterix.048_070_V": "0",
2840 "asterix.048_070_G": "0",
2841 "asterix.048_070_L": "0",
2842 "asterix.048_070_MODE3A": "0"
2845 validator
.add_dissection(
2846 [0x01, 0x10, 0xf0, 0x00],
2849 "asterix.048_161_TRN": "0"
2852 validator
.add_dissection(
2853 [0x01, 0x02, 0x01, 0x0e],
2856 "asterix.048_170_CNF": "0",
2857 "asterix.048_170_RAD": "0",
2858 "asterix.048_170_DOU": "0",
2859 "asterix.048_170_MAH": "0",
2860 "asterix.048_170_CDM": "0",
2861 "asterix.048_170_TRE": "0",
2862 "asterix.048_170_GHO": "0",
2863 "asterix.048_170_SUP": "0",
2864 "asterix.048_170_TCC": "0",
2868 validator
.add_dissection(
2869 [0x01, 0x01, 0x40, 0xfe],
2872 "asterix.048_030_Subitem": "127",
2876 validator
.add_dissection(
2877 [0x01, 0x01, 0x20, 0xf0, 0x00],
2880 "asterix.048_080_QA4": "0",
2881 "asterix.048_080_QA2": "0",
2882 "asterix.048_080_QA1": "0",
2883 "asterix.048_080_QB4": "0",
2884 "asterix.048_080_QB2": "0",
2885 "asterix.048_080_QB1": "0",
2886 "asterix.048_080_QC4": "0",
2887 "asterix.048_080_QC2": "0",
2888 "asterix.048_080_QC1": "0",
2889 "asterix.048_080_QD4": "0",
2890 "asterix.048_080_QD2": "0",
2891 "asterix.048_080_QD1": "0"
2894 '''TODO: A,B,C,D values need to go to single subitem 'MODEC'
2895 validator.add_dissection(
2896 [0x01, 0x01, 0x10, 0x30, 0x00, 0xf0, 0x00],
2899 "asterix.048_100_V": "0",
2900 "asterix.048_100_G": "0",
2901 "asterix.048_100_A1": "0",
2902 "asterix.048_100_C2": "0",
2903 "asterix.048_100_A2": "0",
2904 "asterix.048_100_C4": "0",
2905 "asterix.048_100_A4": "0",
2906 "asterix.048_100_B1": "0",
2907 "asterix.048_100_D1": "0",
2908 "asterix.048_100_B2": "0",
2909 "asterix.048_100_D2": "0",
2910 "asterix.048_100_B4": "0",
2911 "asterix.048_100_D4": "0",
2912 "asterix.048_100_QC1": "0",
2913 "asterix.048_100_QA1": "0",
2914 "asterix.048_100_QC2": "0",
2915 "asterix.048_100_QA2": "0",
2916 "asterix.048_100_QC4": "0",
2917 "asterix.048_100_QA4": "0",
2918 "asterix.048_100_QB1": "0",
2919 "asterix.048_100_QD1": "0",
2920 "asterix.048_100_QB2": "0",
2921 "asterix.048_100_QD2": "0",
2922 "asterix.048_100_QB4": "0",
2923 "asterix.048_100_QD4": "0"
2926 validator.add_dissection(
2927 [0x01, 0x01, 0x04, 0x80, 0x7c, 0x00],
2930 "asterix.fspec": "",
2931 "asterix.048_120_01":
2933 "asterix.048_120_01_D": "0",
2934 "asterix.048_120_01_CAL": "0"
2939 validator
.add_dissection(
2940 [0x01, 0x01, 0x04, 0x3e],
2946 validator
.add_dissection(
2947 [0x01, 0x01, 0x02, 0x01, 0x00],
2950 "asterix.048_230_COM": "0",
2951 "asterix.048_230_STAT": "0",
2952 "asterix.048_230_SI": "0",
2953 "asterix.048_230_MSSC": "0",
2954 "asterix.048_230_ARC": "0",
2955 "asterix.048_230_AIC": "0",
2956 "asterix.048_230_B1A": "0",
2957 "asterix.048_230_B1B": "0"
2960 validator
.add_dissection(
2961 [0x01, 0x01, 0x01, 0x20, 0x10, 0x00],
2964 "asterix.048_050_V": "0",
2965 "asterix.048_050_G": "0",
2966 "asterix.048_050_L": "0",
2967 "asterix.048_050_MODE2": "0"
2970 validator
.add_dissection(
2971 [0x01, 0x01, 0x01, 0x10, 0xe0],
2974 "asterix.048_065_QA4": "0",
2975 "asterix.048_065_QA2": "0",
2976 "asterix.048_065_QA1": "0",
2977 "asterix.048_065_QB2": "0",
2978 "asterix.048_065_QB1": "0"
2981 '''TODO: re-enable RE and SP tests when implemented
2983 "asterix.048_RE_MD5_01_M5": "0",
2984 "asterix.048_RE_MD5_01_ID": "0",
2985 "asterix.048_RE_MD5_01_DA": "0",
2986 "asterix.048_RE_MD5_01_M1": "0",
2987 "asterix.048_RE_MD5_01_M2": "0",
2988 "asterix.048_RE_MD5_01_M3": "0",
2989 "asterix.048_RE_MD5_01_MC": "0"
2991 validator.add_re_dissection(
2992 [0x80, 0x80, 0x01, 0x00],
2994 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M5", "0")
2997 "asterix.048_RE_MD5_02_PIN": "0",
2998 "asterix.048_RE_MD5_02_NAV": "0",
2999 "asterix.048_RE_MD5_02_NAT": "0",
3000 "asterix.048_RE_MD5_02_MIS": "0"
3002 validator.add_re_dissection(
3003 [0x80, 0x40, 0xc0, 0x00, 0xc0, 0xc0],
3005 dict_fspec_local(x_re_pmn, "048_RE_MD5_02", "PIN", "0")
3008 "asterix.048_RE_MD5_05_V": "0",
3009 "asterix.048_RE_MD5_05_G": "0",
3010 "asterix.048_RE_MD5_05_L": "0",
3011 "asterix.048_RE_MD5_05_MODE3A": "0"
3013 validator.add_re_dissection(
3014 [0x80, 0x08, 0x10, 0x00],
3016 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "V", "0")
3019 "asterix.048_RE_M5N_01_M5": "0",
3020 "asterix.048_RE_M5N_01_ID": "0",
3021 "asterix.048_RE_M5N_01_DA": "0",
3022 "asterix.048_RE_M5N_01_M1": "0",
3023 "asterix.048_RE_M5N_01_M2": "0",
3024 "asterix.048_RE_M5N_01_M3": "0",
3025 "asterix.048_RE_M5N_01_MC": "0"
3027 validator.add_re_dissection(
3028 [0x40, 0x80, 0x01, 0x00],
3030 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M5", "0")
3033 "asterix.048_RE_M5N_02_PIN": "0",
3034 "asterix.048_RE_M5N_02_NOV": "0",
3035 "asterix.048_RE_M5N_02_NO": "0"
3037 validator.add_re_dissection(
3038 [0x40, 0x40, 0xc0, 0x00, 0xf0, 0x00],
3040 dict_fspec_local(x_re_pmn, "048_RE_M5N_02", "PIN", "0")
3043 "asterix.048_RE_M5N_05_V": "0",
3044 "asterix.048_RE_M5N_05_G": "0",
3045 "asterix.048_RE_M5N_05_L": "0",
3046 "asterix.048_RE_M5N_05_MODE3A": "0"
3048 validator.add_re_dissection(
3049 [0x40, 0x08, 0x10, 0x00],
3051 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "V", "0")
3053 validator.add_re_dissection(
3054 [0x40, 0x01, 0x80, 0xe0],
3056 fspec_local("048_RE_M5N_08", "FOM", "0")
3058 validator.add_re_dissection(
3062 "asterix.048_RE_M4E_FOE_FRI": "0",
3066 validator.add_re_dissection(
3070 "asterix.048_RE_M4E_FOE_FRI": "0",
3076 validator
.check_dissections()
3079 class TestCategory063
:
3081 Unittest case for ASTERIX Category 063
3083 Online specification:
3084 https://www.eurocontrol.int/publications/cat063-sensor-status-messages-part-10
3086 Part 10: Category 63 (1.4)
3087 Sensor Status Messages
3089 Standard User Application Profile
3091 FRN Data Item Information Length
3092 1 I063/010 Data Source Identifier 2
3093 2 I063/015 Service Identification 1
3094 3 I063/030 Time of Message 3
3095 4 I063/050 Sensor Identifier 2
3096 5 I063/060 Sensor Configuration and Status 1+1
3097 6 I063/070 Time Stamping Bias 2
3098 7 I063/080 SSR/Mode S Range Gain and Bias 4
3099 FX - Field extension indicator -
3100 8 I063/081 SSR/Mode S Azimuth Bias 2
3101 9 I063/090 PSR Range Gain and Bias 4
3102 10 I063/091 PSR Azimuth Bias 2
3103 11 I063/092 PSR Elevation Bias 2
3105 13 RE Reserved Expansion Field 1+1+
3106 14 SP Special Purpose Field 1+1+
3107 FX - Field extension indicator -
3110 def test_for_fields(self
, asterix_validator
):
3111 '''verifies existence of all fields and their maximum value'''
3113 validator
= asterix_validator(63)
3115 validator
.add_dissection(
3119 "asterix.063_010_SAC": "0xff",
3120 "asterix.063_010_SIC": "0x00"
3123 validator
.add_dissection(
3127 "asterix.063_010_SAC": "0x00",
3128 "asterix.063_010_SIC": "0xff"
3131 validator
.add_dissection(
3135 "asterix.063_015_VALUE": "0xff"
3138 validator
.add_dissection(
3139 [0x20, 0xa8, 0xbf, 0xff],
3142 "asterix.063_030_VALUE": "86399.9921875"
3145 validator
.add_dissection(
3149 "asterix.063_050_SAC": "0xff",
3150 "asterix.063_050_SIC": "0x00"
3153 validator
.add_dissection(
3157 "asterix.063_050_SAC": "0x00",
3158 "asterix.063_050_SIC": "0xff"
3161 validator
.add_dissection(
3165 "asterix.063_060_CON": "3",
3166 "asterix.063_060_PSR": "0",
3167 "asterix.063_060_SSR": "0",
3168 "asterix.063_060_MDS": "0",
3169 "asterix.063_060_ADS": "0",
3170 "asterix.063_060_MLT": "0",
3174 validator
.add_dissection(
3178 "asterix.063_060_CON": "0",
3179 "asterix.063_060_PSR": "1",
3180 "asterix.063_060_SSR": "0",
3181 "asterix.063_060_MDS": "0",
3182 "asterix.063_060_ADS": "0",
3183 "asterix.063_060_MLT": "0",
3187 validator
.add_dissection(
3191 "asterix.063_060_CON": "0",
3192 "asterix.063_060_PSR": "0",
3193 "asterix.063_060_SSR": "1",
3194 "asterix.063_060_MDS": "0",
3195 "asterix.063_060_ADS": "0",
3196 "asterix.063_060_MLT": "0",
3200 validator
.add_dissection(
3204 "asterix.063_060_CON": "0",
3205 "asterix.063_060_PSR": "0",
3206 "asterix.063_060_SSR": "0",
3207 "asterix.063_060_MDS": "1",
3208 "asterix.063_060_ADS": "0",
3209 "asterix.063_060_MLT": "0",
3213 validator
.add_dissection(
3217 "asterix.063_060_CON": "0",
3218 "asterix.063_060_PSR": "0",
3219 "asterix.063_060_SSR": "0",
3220 "asterix.063_060_MDS": "0",
3221 "asterix.063_060_ADS": "1",
3222 "asterix.063_060_MLT": "0",
3226 validator
.add_dissection(
3230 "asterix.063_060_CON": "0",
3231 "asterix.063_060_PSR": "0",
3232 "asterix.063_060_SSR": "0",
3233 "asterix.063_060_MDS": "0",
3234 "asterix.063_060_ADS": "0",
3235 "asterix.063_060_MLT": "1",
3239 validator
.add_dissection(
3243 "asterix.063_060_CON": "0",
3244 "asterix.063_060_PSR": "0",
3245 "asterix.063_060_SSR": "0",
3246 "asterix.063_060_MDS": "0",
3247 "asterix.063_060_ADS": "0",
3248 "asterix.063_060_MLT": "0",
3249 "asterix.063_060_OPS": "1",
3250 "asterix.063_060_ODP": "0",
3251 "asterix.063_060_OXT": "0",
3252 "asterix.063_060_MSC": "0",
3253 "asterix.063_060_TSV": "0",
3254 "asterix.063_060_NPW": "0",
3258 validator
.add_dissection(
3262 "asterix.063_060_CON": "0",
3263 "asterix.063_060_PSR": "0",
3264 "asterix.063_060_SSR": "0",
3265 "asterix.063_060_MDS": "0",
3266 "asterix.063_060_ADS": "0",
3267 "asterix.063_060_MLT": "0",
3268 "asterix.063_060_OPS": "0",
3269 "asterix.063_060_ODP": "1",
3270 "asterix.063_060_OXT": "0",
3271 "asterix.063_060_MSC": "0",
3272 "asterix.063_060_TSV": "0",
3273 "asterix.063_060_NPW": "0",
3277 validator
.add_dissection(
3281 "asterix.063_060_CON": "0",
3282 "asterix.063_060_PSR": "0",
3283 "asterix.063_060_SSR": "0",
3284 "asterix.063_060_MDS": "0",
3285 "asterix.063_060_ADS": "0",
3286 "asterix.063_060_MLT": "0",
3287 "asterix.063_060_OPS": "0",
3288 "asterix.063_060_ODP": "0",
3289 "asterix.063_060_OXT": "1",
3290 "asterix.063_060_MSC": "0",
3291 "asterix.063_060_TSV": "0",
3292 "asterix.063_060_NPW": "0",
3296 validator
.add_dissection(
3300 "asterix.063_060_CON": "0",
3301 "asterix.063_060_PSR": "0",
3302 "asterix.063_060_SSR": "0",
3303 "asterix.063_060_MDS": "0",
3304 "asterix.063_060_ADS": "0",
3305 "asterix.063_060_MLT": "0",
3306 "asterix.063_060_OPS": "0",
3307 "asterix.063_060_ODP": "0",
3308 "asterix.063_060_OXT": "0",
3309 "asterix.063_060_MSC": "1",
3310 "asterix.063_060_TSV": "0",
3311 "asterix.063_060_NPW": "0",
3315 validator
.add_dissection(
3319 "asterix.063_060_CON": "0",
3320 "asterix.063_060_PSR": "0",
3321 "asterix.063_060_SSR": "0",
3322 "asterix.063_060_MDS": "0",
3323 "asterix.063_060_ADS": "0",
3324 "asterix.063_060_MLT": "0",
3325 "asterix.063_060_OPS": "0",
3326 "asterix.063_060_ODP": "0",
3327 "asterix.063_060_OXT": "0",
3328 "asterix.063_060_MSC": "0",
3329 "asterix.063_060_TSV": "1",
3330 "asterix.063_060_NPW": "0",
3334 validator
.add_dissection(
3338 "asterix.063_060_CON": "0",
3339 "asterix.063_060_PSR": "0",
3340 "asterix.063_060_SSR": "0",
3341 "asterix.063_060_MDS": "0",
3342 "asterix.063_060_ADS": "0",
3343 "asterix.063_060_MLT": "0",
3344 "asterix.063_060_OPS": "0",
3345 "asterix.063_060_ODP": "0",
3346 "asterix.063_060_OXT": "0",
3347 "asterix.063_060_MSC": "0",
3348 "asterix.063_060_TSV": "0",
3349 "asterix.063_060_NPW": "1",
3353 validator
.add_dissection(
3357 "asterix.063_070_VALUE": "-1"
3360 validator
.add_dissection(
3361 [0x02, 0x7f, 0xff, 0x00, 0x00],
3364 "asterix.063_080_SRG": "0.32767",
3365 "asterix.063_080_SRB": "0"
3368 validator
.add_dissection(
3369 [0x02, 0x80, 0x00, 0x00, 0x00],
3372 "asterix.063_080_SRG": "-0.32768",
3373 "asterix.063_080_SRB": "0"
3376 validator
.add_dissection(
3377 [0x02, 0x00, 0x00, 0x7f, 0xff],
3380 "asterix.063_080_SRG": "0",
3381 "asterix.063_080_SRB": "255.9921875"
3384 validator
.add_dissection(
3385 [0x02, 0x00, 0x00, 0x80, 0x00],
3388 "asterix.063_080_SRG": "0",
3389 "asterix.063_080_SRB": "-256"
3392 validator
.add_dissection(
3393 [0x01, 0x80, 0x7f, 0xff],
3396 "asterix.063_081_VALUE": "179.994506835938"
3399 validator
.add_dissection(
3400 [0x01, 0x80, 0x80, 0x00],
3403 "asterix.063_081_VALUE": "-180"
3406 validator
.add_dissection(
3407 [0x01, 0x40, 0x7f, 0xff, 0x00, 0x00],
3410 "asterix.063_090_PRG": "0.32767",
3411 "asterix.063_090_PRB": "0"
3414 validator
.add_dissection(
3415 [0x01, 0x40, 0x80, 0x00, 0x00, 0x00],
3418 "asterix.063_090_PRG": "-0.32768",
3419 "asterix.063_090_PRB": "0"
3422 validator
.add_dissection(
3423 [0x01, 0x40, 0x00, 0x00, 0x7f, 0xff],
3426 "asterix.063_090_PRG": "0",
3427 "asterix.063_090_PRB": "255.9921875"
3430 validator
.add_dissection(
3431 [0x01, 0x40, 0x00, 0x00, 0x80, 0x00],
3434 "asterix.063_090_PRG": "0",
3435 "asterix.063_090_PRB": "-256"
3438 validator
.add_dissection(
3439 [0x01, 0x20, 0x7f, 0xff],
3442 "asterix.063_091_VALUE": "179.994506835938"
3445 validator
.add_dissection(
3446 [0x01, 0x20, 0x80, 0x00],
3449 "asterix.063_091_VALUE": "-180"
3452 validator
.add_dissection(
3453 [0x01, 0x10, 0x7f, 0xff],
3456 "asterix.063_092_VALUE": "179.994506835938"
3459 validator
.add_dissection(
3460 [0x01, 0x10, 0x80, 0x00],
3463 "asterix.063_092_VALUE": "-180"
3467 validator
.check_dissections()
3469 def test_undefined_value_handling(self
, asterix_validator
):
3470 '''verifies that the dissector can dissect undefined field values by
3471 setting the maximum value of bits or by setting all undefined bits'''
3473 validator
= asterix_validator(63)
3475 validator
.add_dissection(
3480 '''TODO: re-enable RE and SP tests when implemented
3481 validator.add_dissection(
3482 [0x01, 0x04, 0x02, 0x00],
3485 "asterix.re_field_len": "2",
3489 validator.add_dissection(
3490 [0x01, 0x04, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
3491 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
3494 "asterix.fspec": "",
3495 "asterix.re_field_len": "16"
3498 validator.add_dissection(
3503 validator.add_dissection(
3504 [0x01, 0x02, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
3505 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
3511 validator
.check_dissections()
3514 class TestCategory065
:
3516 Unittest case for ASTERIX Category 065
3518 Online specification:
3519 https://www.eurocontrol.int/publications/cat065-surveillance-data-processing-system-sdps-service-status-messages-part-15
3520 https://www.eurocontrol.int/publications/cat065-coding-rules-reserved-expansion-field-part-15-appendix
3522 Part 15 Category 65 (1.4)
3523 SDPS Service Status Reports
3525 Standard User Application Profile
3527 FRN Data Item Information Length
3528 1 I065/010 Data Source Identifier 2
3529 2 I065/000 Message Type 1
3530 3 I065/015 Service Identification 1
3531 4 I065/030 Time of Message 3
3532 5 I065/020 Batch Number 1
3533 6 I065/040 SDPS Configuration and Status 1
3534 7 I065/050 Service Status Report 1
3535 FX - Field extension indicator -
3541 13 RE Reserved Expansion Field 1+1+
3542 14 SP Special Purpose Field 1+1+
3543 FX - Field extension indicator -
3546 def test_for_fields(self
, asterix_validator
):
3547 '''verifies existence of all fields and their maximum value'''
3549 validator
= asterix_validator(65)
3551 validator
.add_dissection(
3555 "asterix.065_010_SAC": "0xff",
3556 "asterix.065_010_SIC": "0x00"
3559 validator
.add_dissection(
3563 "asterix.065_010_SAC": "0x00",
3564 "asterix.065_010_SIC": "0xff"
3567 validator
.add_dissection(
3571 "asterix.065_000_VALUE": "3"
3574 validator
.add_dissection(
3578 "asterix.065_015_VALUE": "0xff"
3581 validator
.add_dissection(
3582 [0x10, 0xa8, 0xbf, 0xff],
3585 "asterix.065_030_VALUE": "86399.9921875"
3588 validator
.add_dissection(
3592 "asterix.065_020_VALUE": "255"
3595 validator
.add_dissection(
3599 "asterix.065_040_NOGO": "3",
3600 "asterix.065_040_OVL": "0",
3601 "asterix.065_040_TSV": "0",
3602 "asterix.065_040_PSS": "0",
3603 "asterix.065_040_STTN": "0"
3606 validator
.add_dissection(
3610 "asterix.065_040_NOGO": "0",
3611 "asterix.065_040_OVL": "1",
3612 "asterix.065_040_TSV": "0",
3613 "asterix.065_040_PSS": "0",
3614 "asterix.065_040_STTN": "0"
3617 validator
.add_dissection(
3621 "asterix.065_040_NOGO": "0",
3622 "asterix.065_040_OVL": "0",
3623 "asterix.065_040_TSV": "1",
3624 "asterix.065_040_PSS": "0",
3625 "asterix.065_040_STTN": "0"
3628 validator
.add_dissection(
3632 "asterix.065_040_NOGO": "0",
3633 "asterix.065_040_OVL": "0",
3634 "asterix.065_040_TSV": "0",
3635 "asterix.065_040_PSS": "3",
3636 "asterix.065_040_STTN": "0"
3639 validator
.add_dissection(
3643 "asterix.065_040_NOGO": "0",
3644 "asterix.065_040_OVL": "0",
3645 "asterix.065_040_TSV": "0",
3646 "asterix.065_040_PSS": "0",
3647 "asterix.065_040_STTN": "1"
3650 validator
.add_dissection(
3654 "asterix.065_050_VALUE": "255"
3657 '''TODO: re-enable RE and SP tests when implemented
3658 validator.add_dissection(
3659 [0x01, 0x04, 0x02, 0x00],
3662 "asterix.re_field_len": "2",
3666 validator.add_dissection(
3667 [0x01, 0x04, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3671 "asterix.re_field_len": "10",
3672 "asterix.fspec": "",
3673 "asterix.065_RE_SRP":
3675 "asterix.065_RE_SRP_Latitude": "90",
3676 "asterix.065_RE_SRP_Longitude": "0"
3680 validator.add_dissection(
3681 [0x01, 0x04, 0x0a, 0x80, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3685 "asterix.re_field_len": "10",
3686 "asterix.fspec": "",
3687 "asterix.065_RE_SRP":
3689 "asterix.065_RE_SRP_Latitude": "-90",
3690 "asterix.065_RE_SRP_Longitude": "0"
3694 validator.add_dissection(
3695 [0x01, 0x04, 0x0a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
3699 "asterix.re_field_len": "10",
3700 "asterix.fspec": "",
3701 "asterix.065_RE_SRP":
3703 "asterix.065_RE_SRP_Latitude": "0",
3704 "asterix.065_RE_SRP_Longitude": "180"
3708 validator.add_dissection(
3709 [0x01, 0x04, 0x0a, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
3713 "asterix.re_field_len": "10",
3714 "asterix.fspec": "",
3715 "asterix.065_RE_SRP":
3717 "asterix.065_RE_SRP_Latitude": "0",
3718 "asterix.065_RE_SRP_Longitude": "-180"
3722 validator.add_dissection(
3723 [0x01, 0x04, 0x04, 0x40, 0xff, 0xfc],
3726 "asterix.re_field_len": "4",
3727 "asterix.fspec": "",
3728 "asterix.065_RE_ARL":
3730 "asterix.065_RE_ARL_ARL": "65532"
3736 validator
.check_dissections()
3738 def test_undefined_value_handling(self
, asterix_validator
):
3739 '''verifies that the dissector can dissect undefined field values by
3740 setting the maximum value of bits or by setting all undefined bits'''
3742 validator
= asterix_validator(65)
3744 validator
.add_dissection(
3748 "asterix.065_000_VALUE": "255"
3751 validator
.add_dissection(
3752 [0x10, 0xff, 0xff, 0xff],
3755 "asterix.065_030_VALUE": "131071.9921875"
3758 validator
.add_dissection(
3762 "asterix.065_040_NOGO": "0",
3763 "asterix.065_040_OVL": "0",
3764 "asterix.065_040_TSV": "0",
3765 "asterix.065_040_PSS": "0",
3766 "asterix.065_040_STTN": "0"
3769 validator
.add_dissection(
3774 validator
.add_dissection(
3779 validator
.add_dissection(
3784 validator
.add_dissection(
3789 validator
.add_dissection(
3794 '''TODO: re-enable RE and SP tests when implemented
3795 validator.add_dissection(
3796 [0x01, 0x04, 0x0a, 0x80, 0x7f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
3800 "asterix.re_field_len": "10",
3801 "asterix.fspec": "",
3802 "asterix.065_RE_SRP":
3804 "asterix.065_RE_SRP_Latitude": "359.999999832362",
3805 "asterix.065_RE_SRP_Longitude": "0"
3809 validator.add_dissection(
3810 [0x01, 0x04, 0x0a, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3814 "asterix.re_field_len": "10",
3815 "asterix.fspec": "",
3816 "asterix.065_RE_SRP":
3818 "asterix.065_RE_SRP_Latitude": "-360",
3819 "asterix.065_RE_SRP_Longitude": "0"
3823 validator.add_dissection(
3824 [0x01, 0x04, 0x0a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff,
3828 "asterix.re_field_len": "10",
3829 "asterix.fspec": "",
3830 "asterix.065_RE_SRP":
3832 "asterix.065_RE_SRP_Latitude": "0",
3833 "asterix.065_RE_SRP_Longitude": "359.999999832362"
3837 validator.add_dissection(
3838 [0x01, 0x04, 0x0a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
3842 "asterix.re_field_len": "10",
3843 "asterix.fspec": "",
3844 "asterix.065_RE_SRP":
3846 "asterix.065_RE_SRP_Latitude": "0",
3847 "asterix.065_RE_SRP_Longitude": "-360"
3851 validator.add_dissection(
3852 [0x01, 0x04, 0x04, 0x40, 0xff, 0xff],
3855 "asterix.re_field_len": "4",
3856 "asterix.fspec": "",
3857 "asterix.065_RE_ARL":
3859 "asterix.065_RE_ARL_ARL": "65535"
3863 validator.add_dissection(
3868 validator.add_dissection(
3869 [0x01, 0x02, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
3870 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
3876 validator
.check_dissections()