epan/dissectors/pidl/ C99 drsuapi
[wireshark-sm.git] / test / suite_dissectors / group_asterix.py
blob66b65eedb868c0b8919bb14ea07402e54f22b0a8
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'''
9 import inspect
10 import pytest
12 # Wireshark modules
13 from suite_dissectors.dissectorstest import *
16 class TestAsterix:
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(
23 [0x13, 0x00, 0x03],
25 "asterix.category": "19",
26 "asterix.length": "3"
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
42 byte_list = [
43 self.category,
44 (total_length // 256) % 256,
45 total_length % 256
46 ] + byte_list
47 expected_result = {
48 "asterix.category": "{}".format(self.category),
49 "asterix.length": "{}".format(total_length),
50 "asterix.message":
52 "asterix.fspec": "",
53 field: expected_message
56 if line_no is None:
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()
65 @pytest.fixture
66 def asterix_validator(dissection_validator):
68 def generate_asterix_validator(category):
69 retval = _asterix_validator_real(category, dissection_validator)
70 return retval
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 + [
86 re_length % 256
87 ] + byte_list
88 expected_result = {
89 "asterix.re_field_len": "{}".format(re_length),
90 "asterix.fspec": "",
91 "asterix.{:03}_RE_{}".format(self.category, field): expected_message
93 if line_no is None:
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)
100 @pytest.fixture
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)
106 return retval
108 return generate_re_asterix_validator
111 def fspec_local(key, idx, value):
112 result = {
113 "asterix.fspec": "",
114 "asterix.{}".format(key):
116 "asterix.{}_{}".format(key, idx): value
119 return result
122 def fspec_global(key, idx, value):
123 result = {
124 "asterix.fspec": "",
125 "asterix.{}".format(key):
127 "asterix.{}".format(idx): value
130 return result
133 def dict_local(vmap, key, idx, value):
134 result = vmap.copy()
135 result["asterix.{}_{}".format(key, idx)] = value
136 return result
139 def dict_global(vmap, key, value):
140 result = vmap.copy()
141 result["asterix.{}".format(key)] = value
142 return result
145 def dict_fspec_local(vmap, key, idx, value):
146 result = {
147 "asterix.fspec": "",
148 "asterix.{}".format(key): dict_local(vmap, key, idx, value)
150 return result
153 def dict_fspec_global(vmap, key, idx, value):
154 result = {
155 "asterix.fspec": "",
156 "asterix.{}".format(key): dict_global(vmap, idx, value)
158 return result
161 def counter_local(vmap, counter, key, idx, value):
162 result = {
163 "asterix.fspec": "",
164 "asterix.{}".format(key):
166 "asterix.counter": counter,
167 "asterix.{}".format(key): dict_local(vmap, key, idx, value)
170 return result
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
182 Status Messages
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
198 11 - Spare -
199 12 - Spare -
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(
211 [0x80, 0xff, 0x00],
212 "asterix.019_010",
214 "asterix.019_010_SAC": "0xff",
215 "asterix.019_010_SIC": "0x00"
218 validator.add_dissection(
219 [0x80, 0x00, 0xff],
220 "asterix.019_010",
222 "asterix.019_010_SAC": "0x00",
223 "asterix.019_010_SIC": "0xff"
226 validator.add_dissection(
227 [0x40, 0x03],
228 "asterix.019_000",
230 "asterix.019_000_VALUE": "3"
233 validator.add_dissection(
234 [0x20, 0xa8, 0xbf, 0xff],
235 "asterix.019_140",
237 "asterix.019_140_VALUE": "86399.9921875"
240 validator.add_dissection(
241 [0x10, 0xc0],
242 "asterix.019_550",
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(
251 [0x10, 0x20],
252 "asterix.019_550",
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(
261 [0x10, 0x10],
262 "asterix.019_550",
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(
271 [0x10, 0x08],
272 "asterix.019_550",
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(
281 [0x08, 0x80],
282 "asterix.019_551",
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(
295 [0x08, 0x40],
296 "asterix.019_551",
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(
309 [0x08, 0x20],
310 "asterix.019_551",
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(
323 [0x08, 0x10],
324 "asterix.019_551",
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(
337 [0x08, 0x08],
338 "asterix.019_551",
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(
351 [0x08, 0x04],
352 "asterix.019_551",
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(
365 [0x08, 0x02],
366 "asterix.019_551",
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(
379 [0x08, 0x01],
380 "asterix.019_551",
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(
393 [0x04, 0x00],
394 "asterix.019_552",
396 "asterix.counter": "0"
399 validator.add_dissection(
400 [0x04, 0x01, 0xff, 0x00],
401 "asterix.019_552",
403 "asterix.counter": "1",
404 "asterix.019_552":
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],
417 "asterix.019_552",
419 "asterix.counter": "1",
420 "asterix.019_552":
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],
433 "asterix.019_552",
435 "asterix.counter": "1",
436 "asterix.019_552":
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],
449 "asterix.019_552",
451 "asterix.counter": "1",
452 "asterix.019_552":
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],
465 "asterix.019_552",
467 "asterix.counter": "1",
468 "asterix.019_552":
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],
481 "asterix.019_552",
483 "asterix.counter": "1",
484 "asterix.019_552":
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],
497 "asterix.019_552",
499 "asterix.counter": "3",
500 "asterix.019_552":
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"
509 "asterix.019_552":
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"
518 "asterix.019_552":
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(
530 [0x02, 0xc0],
531 "asterix.019_553",
533 "asterix.019_553_REFTR1": "3",
534 "asterix.019_553_REFTR2": "0",
535 "asterix.FX": "0"
538 validator.add_dissection(
539 [0x02, 0x0c],
540 "asterix.019_553",
542 "asterix.019_553_REFTR1": "0",
543 "asterix.019_553_REFTR2": "3",
544 "asterix.FX": "0"
547 '''TODO: check this testcase, it has too many subitems
548 validator.add_dissection(
549 [0x02, 0x01, 0x01, 0x0c],
550 "asterix.019_553",
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",
558 "asterix.FX": "0"
562 validator.add_dissection(
563 [0x01, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
564 "asterix.019_600",
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],
572 "asterix.019_600",
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],
580 "asterix.019_600",
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],
588 "asterix.019_600",
590 "asterix.019_600_LAT": "0",
591 "asterix.019_600_LON": "-180"
594 validator.add_dissection(
595 [0x01, 0x40, 0x7f, 0xff],
596 "asterix.019_610",
598 "asterix.019_610_VALUE": "8191.75"
601 validator.add_dissection(
602 [0x01, 0x40, 0x80, 0x00],
603 "asterix.019_610",
605 "asterix.019_610_VALUE": "-8192"
608 validator.add_dissection(
609 [0x01, 0x20, 0x7f],
610 "asterix.019_620",
612 "asterix.019_620_VALUE": "127"
615 validator.add_dissection(
616 [0x01, 0x20, 0x81],
617 "asterix.019_620",
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(
632 [0x40, 0xff],
633 "asterix.019_000",
635 "asterix.019_000_VALUE": "255"
638 validator.add_dissection(
639 [0x20, 0xff, 0xff, 0xff],
640 "asterix.019_140",
642 "asterix.019_140_VALUE": "131071.9921875"
645 validator.add_dissection(
646 [0x10, 0x07],
647 "asterix.019_550",
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],
657 "asterix.019_552",
659 "asterix.counter": "1",
660 "asterix.019_552":
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(
672 [0x02, 0x32],
673 "asterix.019_553",
675 "asterix.019_553_REFTR1": "0",
676 "asterix.019_553_REFTR2": "0",
677 "asterix.FX": "0"
680 '''TODO: check this testcase, it has too many subitems
681 validator.add_dissection(
682 [0x02, 0x33, 0x33, 0x32],
683 "asterix.019_553",
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",
691 "asterix.FX": "0"
695 validator.add_dissection(
696 [0x01, 0x80, 0x7f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00],
697 "asterix.019_600",
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],
705 "asterix.019_600",
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],
713 "asterix.019_600",
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],
721 "asterix.019_600",
723 "asterix.019_600_LAT": "0",
724 "asterix.019_600_LON": "-360"
727 validator.add_dissection(
728 [0x01, 0x20, 0x80],
729 "asterix.019_620",
731 "asterix.019_620_VALUE": "-128"
734 validator.add_dissection(
735 [0x01, 0x10],
736 "asterix.spare",
739 validator.add_dissection(
740 [0x01, 0x08],
741 "asterix.spare",
744 '''TODO: re-enable RE and SP tests when implemented
745 validator.add_dissection(
746 [0x01, 0x04, 0x02, 0x00],
747 "asterix.019_RE",
749 "asterix.re_field_len": "2",
750 "asterix.fspec": ""
753 validator.add_dissection(
754 [0x01, 0x04, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
755 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
756 "asterix.019_RE",
758 "asterix.fspec": "",
759 "asterix.re_field_len": "16"
762 validator.add_dissection(
763 [0x01, 0x02, 0x01],
764 "asterix.019_SP",
767 validator.add_dissection(
768 [0x01, 0x02, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
769 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
770 "asterix.019_SP",
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
786 Part 2b
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(
816 [0x80, 0xff, 0x00],
817 "asterix.034_010",
819 "asterix.034_010_SAC": "0xff",
820 "asterix.034_010_SIC": "0x00"
823 validator.add_dissection(
824 [0x80, 0x00, 0xff],
825 "asterix.034_010",
827 "asterix.034_010_SAC": "0x00",
828 "asterix.034_010_SIC": "0xff"
831 validator.add_dissection(
832 [0x40, 0x04],
833 "asterix.034_000",
835 "asterix.034_000_VALUE": "4"
838 validator.add_dissection(
839 [0x20, 0xa8, 0xbf, 0xff],
840 "asterix.034_030",
842 "asterix.034_030_VALUE": "86399.9921875"
845 validator.add_dissection(
846 [0x10, 0xff],
847 "asterix.034_020",
849 "asterix.034_020_VALUE": "358.59375"
852 validator.add_dissection(
853 [0x08, 0xff, 0xff],
854 "asterix.034_041",
856 "asterix.034_041_VALUE": "511.9921875"
859 x_050_COM = {
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(
869 [0x04, 0x80, 0x80],
870 "asterix.034_050",
871 dict_fspec_local(x_050_COM, "034_050_COM", "NOGO", "1")
873 validator.add_dissection(
874 [0x04, 0x80, 0x40],
875 "asterix.034_050",
876 dict_fspec_local(x_050_COM, "034_050_COM", "RDPC", "1")
878 validator.add_dissection(
879 [0x04, 0x80, 0x20],
880 "asterix.034_050",
881 dict_fspec_local(x_050_COM, "034_050_COM", "RDPR", "1")
883 validator.add_dissection(
884 [0x04, 0x80, 0x10],
885 "asterix.034_050",
886 dict_fspec_local(x_050_COM, "034_050_COM", "OVLRDP", "1")
888 validator.add_dissection(
889 [0x04, 0x80, 0x08],
890 "asterix.034_050",
891 dict_fspec_local(x_050_COM, "034_050_COM", "OVLXMT", "1")
893 validator.add_dissection(
894 [0x04, 0x80, 0x04],
895 "asterix.034_050",
896 dict_fspec_local(x_050_COM, "034_050_COM", "MSC", "1")
898 validator.add_dissection(
899 [0x04, 0x80, 0x02],
900 "asterix.034_050",
901 dict_fspec_local(x_050_COM, "034_050_COM", "TSV", "1")
903 x_050_PSR = {
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(
910 [0x04, 0x10, 0x80],
911 "asterix.034_050",
912 dict_fspec_local(x_050_PSR, "034_050_PSR", "ANT", "1")
914 validator.add_dissection(
915 [0x04, 0x10, 0x60],
916 "asterix.034_050",
917 dict_fspec_local(x_050_PSR, "034_050_PSR", "CHAB", "3")
919 validator.add_dissection(
920 [0x04, 0x10, 0x10],
921 "asterix.034_050",
922 dict_fspec_local(x_050_PSR, "034_050_PSR", "OVL", "1")
924 validator.add_dissection(
925 [0x04, 0x10, 0x08],
926 "asterix.034_050",
927 dict_fspec_local(x_050_PSR, "034_050_PSR", "MSC", "1")
929 x_050_SSR = {
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(
936 [0x04, 0x08, 0x80],
937 "asterix.034_050",
938 dict_fspec_local(x_050_SSR, "034_050_SSR", "ANT", "1")
940 validator.add_dissection(
941 [0x04, 0x08, 0x60],
942 "asterix.034_050",
943 dict_fspec_local(x_050_SSR, "034_050_SSR", "CHAB", "3")
945 validator.add_dissection(
946 [0x04, 0x08, 0x10],
947 "asterix.034_050",
948 dict_fspec_local(x_050_SSR, "034_050_SSR", "OVL", "1")
950 validator.add_dissection(
951 [0x04, 0x08, 0x08],
952 "asterix.034_050",
953 dict_fspec_local(x_050_SSR, "034_050_SSR", "MSC", "1")
955 x_050_MDS = {
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],
967 "asterix.034_050",
968 dict_fspec_local(x_050_MDS, "034_050_MDS", "ANT", "1")
970 validator.add_dissection(
971 [0x04, 0x04, 0x60, 0x00],
972 "asterix.034_050",
973 dict_fspec_local(x_050_MDS, "034_050_MDS", "CHAB", "3")
975 validator.add_dissection(
976 [0x04, 0x04, 0x10, 0x00],
977 "asterix.034_050",
978 dict_fspec_local(x_050_MDS, "034_050_MDS", "OVLSUR", "1")
980 validator.add_dissection(
981 [0x04, 0x04, 0x08, 0x00],
982 "asterix.034_050",
983 dict_fspec_local(x_050_MDS, "034_050_MDS", "MSC", "1")
985 validator.add_dissection(
986 [0x04, 0x04, 0x04, 0x00],
987 "asterix.034_050",
988 dict_fspec_local(x_050_MDS, "034_050_MDS", "SCF", "1")
990 validator.add_dissection(
991 [0x04, 0x04, 0x02, 0x00],
992 "asterix.034_050",
993 dict_fspec_local(x_050_MDS, "034_050_MDS", "DLF", "1")
995 validator.add_dissection(
996 [0x04, 0x04, 0x01, 0x00],
997 "asterix.034_050",
998 dict_fspec_local(x_050_MDS, "034_050_MDS", "OVLSCF", "1")
1000 validator.add_dissection(
1001 [0x04, 0x04, 0x00, 0x80],
1002 "asterix.034_050",
1003 dict_fspec_local(x_050_MDS, "034_050_MDS", "OVLDLF", "1")
1005 x_060_COM = {
1006 "asterix.034_060_COM_REDRDP": "0",
1007 "asterix.034_060_COM_REDXMT": "0"
1009 validator.add_dissection(
1010 [0x02, 0x80, 0x70],
1011 "asterix.034_060",
1012 dict_fspec_local(x_060_COM, "034_060_COM", "REDRDP", "7")
1014 validator.add_dissection(
1015 [0x02, 0x80, 0x0e],
1016 "asterix.034_060",
1017 dict_fspec_local(x_060_COM, "034_060_COM", "REDXMT", "7")
1019 x_060_PSR = {
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(
1025 [0x02, 0x10, 0x80],
1026 "asterix.034_060",
1027 dict_fspec_local(x_060_PSR, "034_060_PSR", "POL", "1")
1029 validator.add_dissection(
1030 [0x02, 0x10, 0x70],
1031 "asterix.034_060",
1032 dict_fspec_local(x_060_PSR, "034_060_PSR", "REDRAD", "7")
1034 validator.add_dissection(
1035 [0x02, 0x10, 0x0c],
1036 "asterix.034_060",
1037 dict_fspec_local(x_060_PSR, "034_060_PSR", "STC", "3")
1039 validator.add_dissection(
1040 [0x02, 0x08, 0xe0],
1041 "asterix.034_060",
1042 fspec_local("034_060_SSR", "REDRAD", "7")
1044 x_060_06 = {
1045 "asterix.034_060_MDS_REDRAD": "0",
1046 "asterix.034_060_MDS_CLU": "0"
1048 validator.add_dissection(
1049 [0x02, 0x04, 0xe0],
1050 "asterix.034_060",
1051 dict_fspec_local(x_060_06, "034_060_MDS", "REDRAD", "7")
1053 validator.add_dissection(
1054 [0x02, 0x04, 0x10],
1055 "asterix.034_060",
1056 dict_fspec_local(x_060_06, "034_060_MDS", "CLU", "1")
1058 x_070 = {
1059 "asterix.034_070_TYP": "0",
1060 "asterix.034_070_COUNT": "0"
1062 validator.add_dissection(
1063 [0x01, 0x80, 0x01, 0x80, 0x00],
1064 "asterix.034_070",
1066 "asterix.counter": "1",
1067 "asterix.034_070":
1068 dict_local(x_070, "034_070", "TYP", "16")
1071 validator.add_dissection(
1072 [0x01, 0x80, 0x03, 0x80, 0x00, 0x87, 0xff, 0x07, 0xff],
1073 "asterix.034_070",
1075 "asterix.counter": "3",
1076 "asterix.034_070":
1077 dict_local(x_070, "034_070", "TYPE", "16"),
1078 "asterix.034_070":
1080 "asterix.034_070_TYP": "16",
1081 "asterix.034_070_COUNT": "2047"
1083 "asterix.034_070":
1084 dict_local(x_070, "034_070", "COUNT", "2047"),
1087 x_100 = {
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],
1095 "asterix.034_100",
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],
1100 "asterix.034_100",
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],
1105 "asterix.034_100",
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],
1110 "asterix.034_100",
1111 dict_local(x_100, "034_100", "THETAEND", "359.994506835938")
1113 validator.add_dissection(
1114 [0x01, 0x20, 0x09],
1115 "asterix.034_110",
1117 "asterix.034_110_VALUE": "9"
1120 x_120 = {
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],
1127 "asterix.034_120",
1128 dict_local(x_120, "034_120", "HGT", "32767")
1130 validator.add_dissection(
1131 [0x01, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
1132 "asterix.034_120",
1133 dict_local(x_120, "034_120", "HGT", "32768")
1135 validator.add_dissection(
1136 [0x01, 0x10, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00],
1137 "asterix.034_120",
1138 dict_local(x_120, "034_120", "LAT", "90")
1140 validator.add_dissection(
1141 [0x01, 0x10, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00],
1142 "asterix.034_120",
1143 dict_local(x_120, "034_120", "LAT", "-90")
1145 validator.add_dissection(
1146 [0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff],
1147 "asterix.034_120",
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],
1152 "asterix.034_120",
1153 dict_local(x_120, "034_120", "LON", "-180")
1155 '''TODO: re-enable RE and SP tests when implemented
1156 x_090 = {
1157 "asterix.034_090_RE": "0",
1158 "asterix.034_090_AE": "0"
1160 validator.add_dissection(
1161 [0x01, 0x08, 0x7f, 0x00],
1162 "asterix.034_090",
1163 dict_local(x_090, "034_090", "RE", "0.9921875")
1165 validator.add_dissection(
1166 [0x01, 0x08, 0x80, 0x00],
1167 "asterix.034_090",
1168 dict_local(x_090, "034_090", "RE", "-1")
1170 validator.add_dissection(
1171 [0x01, 0x08, 0x00, 0x80],
1172 "asterix.034_090",
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(
1186 [0x40, 0xff],
1187 "asterix.034_000",
1189 "asterix.034_000_VALUE": "255"
1192 validator.add_dissection(
1193 [0x20, 0xff, 0xff, 0xff],
1194 "asterix.034_030",
1196 "asterix.034_030_VALUE": "131071.9921875"
1199 validator.add_dissection(
1200 [0x04, 0x63, 0x00],
1201 "asterix.034_050",
1203 "asterix.fspec": "",
1204 "asterix.spare": ""
1207 validator.add_dissection(
1208 [0x04, 0x80, 0x01],
1209 "asterix.034_050",
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(
1225 [0x04, 0x10, 0x07],
1226 "asterix.034_050",
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(
1239 [0x04, 0x08, 0x07],
1240 "asterix.034_050",
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],
1254 "asterix.034_050",
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(
1271 [0x02, 0x63, 0x00],
1272 "asterix.034_060",
1274 "asterix.fspec": "",
1275 "asterix.spare": ""
1278 validator.add_dissection(
1279 [0x02, 0x80, 0x81],
1280 "asterix.034_060",
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(
1291 [0x02, 0x10, 0x03],
1292 "asterix.034_060",
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(
1304 [0x02, 0x08, 0x1f],
1305 "asterix.034_060",
1306 fspec_local("034_060_SSR", "REDRAD", "0")
1308 validator.add_dissection(
1309 [0x02, 0x04, 0x0f],
1310 "asterix.034_060",
1312 "asterix.fspec": "",
1313 "asterix.034_060_MDS":
1315 "asterix.034_060_MDS_REDRAD": "0",
1316 "asterix.034_060_MDS_CLU": "0"
1320 x_070 = {
1321 "asterix.034_070_TYP": "0",
1322 "asterix.034_070_COUNT": "0"
1324 validator.add_dissection(
1325 [0x01, 0x80, 0x01, 0xf8, 0x00],
1326 "asterix.034_070",
1328 "asterix.counter": "1",
1329 "asterix.034_070":
1330 dict_local(x_070, "034_070", "TYP", "31")
1333 validator.add_dissection(
1334 [0x01, 0x20, 0xff],
1335 "asterix.034_110",
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],
1343 "asterix.034_RE",
1345 "asterix.re_field_len": "2",
1346 "asterix.fspec": ""
1349 validator.add_dissection(
1350 [0x01, 0x02, 0x01],
1351 "asterix.034_SP",
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],
1357 "asterix.034_SP",
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
1373 Part 4 Category 048
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(
1419 [0x80, 0xff, 0x00],
1420 "asterix.048_010",
1422 "asterix.048_010_SAC": "0xff",
1423 "asterix.048_010_SIC": "0x00"
1426 validator.add_dissection(
1427 [0x80, 0x00, 0xff],
1428 "asterix.048_010",
1430 "asterix.048_010_SAC": "0x00",
1431 "asterix.048_010_SIC": "0xff"
1434 validator.add_dissection(
1435 [0x40, 0xa8, 0xbf, 0xff],
1436 "asterix.048_140",
1438 "asterix.048_140_VALUE": "86399.9921875"
1441 x_020 = {
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",
1447 "asterix.FX": "0"
1449 validator.add_dissection(
1450 [0x20, 0xe0],
1451 "asterix.048_020",
1452 dict_local(x_020, "048_020", "TYP", "7")
1454 validator.add_dissection(
1455 [0x20, 0x08],
1456 "asterix.048_020",
1457 dict_local(x_020, "048_020", "RDP", "1")
1459 validator.add_dissection(
1460 [0x20, 0x04],
1461 "asterix.048_020",
1462 dict_local(x_020, "048_020", "SPI", "1")
1464 validator.add_dissection(
1465 [0x20, 0x02],
1466 "asterix.048_020",
1467 dict_local(x_020, "048_020", "RAB", "1")
1469 x_020.update({
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(
1478 [0x20, 0x01, 0x80],
1479 "asterix.048_020",
1480 dict_local(x_020, "048_020", "TST", "1")
1482 validator.add_dissection(
1483 [0x20, 0x01, 0x40],
1484 "asterix.048_020",
1485 dict_local(x_020, "048_020", "ERR", "1")
1487 validator.add_dissection(
1488 [0x20, 0x01, 0x20],
1489 "asterix.048_020",
1490 dict_local(x_020, "048_020", "XPP", "1")
1492 validator.add_dissection(
1493 [0x20, 0x01, 0x10],
1494 "asterix.048_020",
1495 dict_local(x_020, "048_020", "ME", "1")
1497 validator.add_dissection(
1498 [0x20, 0x01, 0x08],
1499 "asterix.048_020",
1500 dict_local(x_020, "048_020", "MI", "1")
1502 validator.add_dissection(
1503 [0x20, 0x01, 0x06],
1504 "asterix.048_020",
1505 dict_local(x_020, "048_020", "FOEFRI", "3")
1507 x_040 = {
1508 "asterix.048_040_RHO": "0",
1509 "asterix.048_040_THETA": "0"
1511 validator.add_dissection(
1512 [0x10, 0xff, 0xff, 0x00, 0x00],
1513 "asterix.048_040",
1514 dict_local(x_040, "048_040", "RHO", "255.99609375")
1516 validator.add_dissection(
1517 [0x10, 0x00, 0x00, 0xff, 0xff],
1518 "asterix.048_040",
1519 dict_local(x_040, "048_040", "THETA", "359.994506835938")
1521 x_070 = {
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(
1528 [0x08, 0x80, 0x00],
1529 "asterix.048_070",
1530 dict_local(x_070, "048_070", "V", "1")
1532 validator.add_dissection(
1533 [0x08, 0x40, 0x00],
1534 "asterix.048_070",
1535 dict_local(x_070, "048_070", "G", "1")
1537 validator.add_dissection(
1538 [0x08, 0x20, 0x00],
1539 "asterix.048_070",
1540 dict_local(x_070, "048_070", "L", "1")
1542 validator.add_dissection(
1543 [0x08, 0x0e, 0x00],
1544 "asterix.048_070",
1545 dict_local(x_070, "048_070", "MODE3A", "3584") # 07000
1547 validator.add_dissection(
1548 [0x08, 0x01, 0xc0],
1549 "asterix.048_070",
1550 dict_local(x_070, "048_070", "MODE3A", "448") # 0700
1552 validator.add_dissection(
1553 [0x08, 0x00, 0x38],
1554 "asterix.048_070",
1555 dict_local(x_070, "048_070", "MODE3A", "56") # 070
1557 validator.add_dissection(
1558 [0x08, 0x00, 0x07],
1559 "asterix.048_070",
1560 dict_local(x_070, "048_070", "MODE3A", "7") # 07
1562 x_090 = {
1563 "asterix.048_090_V": "0",
1564 "asterix.048_090_G": "0",
1565 "asterix.048_090_FL": "0"
1567 validator.add_dissection(
1568 [0x04, 0x80, 0x00],
1569 "asterix.048_090",
1570 dict_local(x_090, "048_090", "V", "1")
1572 validator.add_dissection(
1573 [0x04, 0x40, 0x00],
1574 "asterix.048_090",
1575 dict_local(x_090, "048_090", "G", "1")
1577 validator.add_dissection(
1578 [0x04, 0x1f, 0xff],
1579 "asterix.048_090",
1580 dict_local(x_090, "048_090", "FL", "2047.75")
1582 validator.add_dissection(
1583 [0x04, 0x20, 0x00],
1584 "asterix.048_090",
1585 dict_local(x_090, "048_090", "FL", "-2048")
1587 validator.add_dissection(
1588 [0x02, 0x80, 0xff],
1589 "asterix.048_130",
1590 fspec_local("048_130_SRL", "VALUE", "11.2060546875")
1592 validator.add_dissection(
1593 [0x02, 0x40, 0xff],
1594 "asterix.048_130",
1595 fspec_local("048_130_SRR", "VALUE", "255")
1597 validator.add_dissection(
1598 [0x02, 0x20, 0x7f],
1599 "asterix.048_130",
1600 fspec_local("048_130_SAM", "VALUE", "127")
1602 validator.add_dissection(
1603 [0x02, 0x20, 0x80],
1604 "asterix.048_130",
1605 fspec_local("048_130_SAM", "VALUE", "-128")
1607 validator.add_dissection(
1608 [0x02, 0x10, 0xff],
1609 "asterix.048_130",
1610 fspec_local("048_130_PRL", "VALUE", "11.2060546875")
1612 validator.add_dissection(
1613 [0x02, 0x08, 0x7f],
1614 "asterix.048_130",
1615 fspec_local("048_130_PAM", "VALUE", "127")
1617 validator.add_dissection(
1618 [0x02, 0x08, 0x80],
1619 "asterix.048_130",
1620 fspec_local("048_130_PAM", "VALUE", "-128")
1622 validator.add_dissection(
1623 [0x02, 0x04, 0x7f],
1624 "asterix.048_130",
1625 fspec_local("048_130_RPD", "VALUE", "0.49609375")
1627 validator.add_dissection(
1628 [0x02, 0x04, 0x80],
1629 "asterix.048_130",
1630 fspec_local("048_130_RPD", "VALUE", "-0.5")
1632 validator.add_dissection(
1633 [0x02, 0x02, 0x7f],
1634 "asterix.048_130",
1635 fspec_local("048_130_APD", "VALUE", "2.79052734375")
1637 validator.add_dissection(
1638 [0x02, 0x02, 0x80],
1639 "asterix.048_130",
1640 fspec_local("048_130_APD", "VALUE", "-2.8125")
1642 validator.add_dissection(
1643 [0x01, 0x80, 0xff, 0xff, 0xff],
1644 "asterix.048_220",
1646 "asterix.048_220_VALUE": '0xffffff'
1649 validator.add_dissection(
1650 [0x01, 0x80, 0xff, 0xff, 0xff],
1651 "asterix.048_220",
1653 "asterix.048_220_VALUE": '0xffffff'
1656 validator.add_dissection(
1657 [0x01, 0x40, 0x04, 0x20, 0xda, 0x83, 0x0c, 0x79],
1658 "asterix.048_240",
1660 "asterix.048_240_VALUE": "ABCZ 019"
1663 x_250 = {
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(
1669 [0x01, 0x20,
1670 0x01,
1671 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1672 0x00],
1673 "asterix.048_250",
1675 "asterix.counter": "1",
1676 "asterix.048_250":
1677 dict_global(x_250, "048_250_MBDATA", '0x0011223344556677'),
1680 '''TODO: result seems correct, check dict format
1681 validator.add_dissection(
1682 [0x01, 0x20,
1683 0x01,
1684 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1685 0xf0],
1686 "asterix.048_250",
1688 "asterix.counter": "1",
1689 "asterix.048_250":
1690 dict_global(x_250, "048_250_BDS1", "15"),
1693 validator.add_dissection(
1694 [0x01, 0x20,
1695 0x01,
1696 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1697 0x0f],
1698 "asterix.048_250",
1700 "asterix.counter": "1",
1701 "asterix.048_250":
1702 dict_global(x_250, "BDS2", "15"),
1705 validator.add_dissection(
1706 [0x01, 0x20,
1707 0x03,
1708 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1709 0x00,
1710 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1711 0xf0,
1712 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1713 0x0f],
1714 "asterix.048_250",
1716 "asterix.counter": "3",
1717 "asterix.048_250":
1718 dict_global(x_250, "048_250_MBDATA", '0x0011223344556677'),
1719 "asterix.048_250":
1720 dict_global(x_250, "048_250_BDS1", "15"),
1721 "asterix.048_250":
1722 dict_global(x_250, "048_250_BDS2", "15"),
1726 validator.add_dissection(
1727 [0x01, 0x10, 0x0f, 0xff],
1728 "asterix.048_161",
1730 "asterix.048_161_TRN": "4095"
1733 x_042 = {
1734 "asterix.048_042_X": "0",
1735 "asterix.048_042_Y": "0"
1737 validator.add_dissection(
1738 [0x01, 0x08, 0x7f, 0xff, 0x00, 0x00],
1739 "asterix.048_042",
1740 dict_local(x_042, "048_042", "X", "255.9921875")
1742 validator.add_dissection(
1743 [0x01, 0x08, 0x80, 0x00, 0x00, 0x00],
1744 "asterix.048_042",
1745 dict_local(x_042, "048_042", "X", "-256")
1747 validator.add_dissection(
1748 [0x01, 0x08, 0x00, 0x0, 0x7f, 0xff],
1749 "asterix.048_042",
1750 dict_local(x_042, "048_042", "Y", "255.9921875")
1752 validator.add_dissection(
1753 [0x01, 0x08, 0x00, 0x0, 0x80, 0x00],
1754 "asterix.048_042",
1755 dict_local(x_042, "048_042", "Y", "-256")
1757 x_200 = {
1758 "asterix.048_200_GSP": "0",
1759 "asterix.048_200_HDG": "0"
1761 validator.add_dissection(
1762 [0x01, 0x04, 0xff, 0xff, 0x00, 0x00],
1763 "asterix.048_200",
1764 dict_local(x_200, "048_200", "GSP", "3.99993896484375")
1766 validator.add_dissection(
1767 [0x01, 0x04, 0x00, 0x00, 0xff, 0xff],
1768 "asterix.048_200",
1769 dict_local(x_200, "048_200", "HDG", "359.994506835938")
1771 x_170 = {
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",
1777 "asterix.FX": "0"
1779 validator.add_dissection(
1780 [0x01, 0x02, 0x80],
1781 "asterix.048_170",
1782 dict_local(x_170, "048_170", "CNF", "1")
1784 validator.add_dissection(
1785 [0x01, 0x02, 0x60],
1786 "asterix.048_170",
1787 dict_local(x_170, "048_170", "RAD", "3")
1789 validator.add_dissection(
1790 [0x01, 0x02, 0x10],
1791 "asterix.048_170",
1792 dict_local(x_170, "048_170", "DOU", "1")
1794 validator.add_dissection(
1795 [0x01, 0x02, 0x08],
1796 "asterix.048_170",
1797 dict_local(x_170, "048_170", "MAH", "1")
1799 validator.add_dissection(
1800 [0x01, 0x02, 0x06],
1801 "asterix.048_170",
1802 dict_local(x_170, "048_170", "CDM", "3")
1804 x_170.update({
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],
1812 "asterix.048_170",
1813 dict_local(x_170, "048_170", "TRE", "1")
1815 validator.add_dissection(
1816 [0x01, 0x02, 0x01, 0x40],
1817 "asterix.048_170",
1818 dict_local(x_170, "048_170", "GHO", "1")
1820 validator.add_dissection(
1821 [0x01, 0x02, 0x01, 0x20],
1822 "asterix.048_170",
1823 dict_local(x_170, "048_170", "SUP", "1")
1825 validator.add_dissection(
1826 [0x01, 0x02, 0x01, 0x10],
1827 "asterix.048_170",
1828 dict_local(x_170, "048_170", "TCC", "1")
1830 x_210 = {
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],
1838 "asterix.048_210",
1839 dict_local(x_210, "048_210", "SIGX", "1.9921875")
1841 validator.add_dissection(
1842 [0x01, 0x01, 0x80, 0x00, 0xff, 0x00, 0x00],
1843 "asterix.048_210",
1844 dict_local(x_210, "048_210", "SIGY", "1.9921875")
1846 validator.add_dissection(
1847 [0x01, 0x01, 0x80, 0x00, 0x00, 0xff, 0x00],
1848 "asterix.048_210",
1849 dict_local(x_210, "048_210", "SIGV", "0.01556396484375")
1851 validator.add_dissection(
1852 [0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0xff],
1853 "asterix.048_210",
1854 dict_local(x_210, "048_210", "SIGH", "22.412109375")
1856 validator.add_dissection(
1857 [0x01, 0x01, 0x40, 0x2e],
1858 "asterix.048_030",
1860 "asterix.048_030_Subitem": "23",
1861 "asterix.FX": "0"
1864 '''TODO: check this test, not according to the specs
1865 validator.add_dissection(
1866 [0x01, 0x01, 0x40, 0x2f, 0x03, 0x05, 0x06],
1867 "asterix.048_030",
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",
1873 "asterix.FX": "0"
1877 x_080 = {
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],
1893 "asterix.048_080",
1894 dict_local(x_080, "048_080", "QA4", "1")
1896 validator.add_dissection(
1897 [0x01, 0x01, 0x20, 0x04, 0x00],
1898 "asterix.048_080",
1899 dict_local(x_080, "048_080", "QA2", "1")
1901 validator.add_dissection(
1902 [0x01, 0x01, 0x20, 0x02, 0x00],
1903 "asterix.048_080",
1904 dict_local(x_080, "048_080", "QA1", "1")
1906 validator.add_dissection(
1907 [0x01, 0x01, 0x20, 0x01, 0x00],
1908 "asterix.048_080",
1909 dict_local(x_080, "048_080", "QB4", "1")
1911 validator.add_dissection(
1912 [0x01, 0x01, 0x20, 0x00, 0x80],
1913 "asterix.048_080",
1914 dict_local(x_080, "048_080", "QB2", "1")
1916 validator.add_dissection(
1917 [0x01, 0x01, 0x20, 0x00, 0x40],
1918 "asterix.048_080",
1919 dict_local(x_080, "048_080", "QB1", "1")
1921 validator.add_dissection(
1922 [0x01, 0x01, 0x20, 0x00, 0x20],
1923 "asterix.048_080",
1924 dict_local(x_080, "048_080", "QC4", "1")
1926 validator.add_dissection(
1927 [0x01, 0x01, 0x20, 0x00, 0x10],
1928 "asterix.048_080",
1929 dict_local(x_080, "048_080", "QC2", "1")
1931 validator.add_dissection(
1932 [0x01, 0x01, 0x20, 0x00, 0x08],
1933 "asterix.048_080",
1934 dict_local(x_080, "048_080", "QC1", "1")
1936 validator.add_dissection(
1937 [0x01, 0x01, 0x20, 0x00, 0x04],
1938 "asterix.048_080",
1939 dict_local(x_080, "048_080", "QD4", "1")
1941 validator.add_dissection(
1942 [0x01, 0x01, 0x20, 0x00, 0x02],
1943 "asterix.048_080",
1944 dict_local(x_080, "048_080", "QD2", "1")
1946 validator.add_dissection(
1947 [0x01, 0x01, 0x20, 0x00, 0x01],
1948 "asterix.048_080",
1949 dict_local(x_080, "048_080", "QD1", "1")
1951 '''TODO: A,B,C,D values need to go to single subitem 'MODEC'
1952 x_100 = {
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],
1982 "asterix.048_100",
1983 dict_local(x_100, "048_100", "V", "1")
1985 validator.add_dissection(
1986 [0x01, 0x01, 0x10, 0x40, 0x00, 0x00, 0x00],
1987 "asterix.048_100",
1988 dict_local(x_100, "048_100", "G", "1")
1990 validator.add_dissection(
1991 [0x01, 0x01, 0x10, 0x08, 0x00, 0x00, 0x00],
1992 "asterix.048_100",
1993 dict_local(x_100, "048_100", "C1", "1")
1995 validator.add_dissection(
1996 [0x01, 0x01, 0x10, 0x04, 0x00, 0x00, 0x00],
1997 "asterix.048_100",
1998 dict_local(x_100, "048_100", "A1", "1")
2000 validator.add_dissection(
2001 [0x01, 0x01, 0x10, 0x02, 0x00, 0x00, 0x00],
2002 "asterix.048_100",
2003 dict_local(x_100, "048_100", "C2", "1")
2005 validator.add_dissection(
2006 [0x01, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00],
2007 "asterix.048_100",
2008 dict_local(x_100, "048_100", "A2", "1")
2010 validator.add_dissection(
2011 [0x01, 0x01, 0x10, 0x00, 0x80, 0x00, 0x00],
2012 "asterix.048_100",
2013 dict_local(x_100, "048_100", "C4", "1")
2015 validator.add_dissection(
2016 [0x01, 0x01, 0x10, 0x00, 0x40, 0x00, 0x00],
2017 "asterix.048_100",
2018 dict_local(x_100, "048_100", "A4", "1")
2020 validator.add_dissection(
2021 [0x01, 0x01, 0x10, 0x00, 0x20, 0x00, 0x00],
2022 "asterix.048_100",
2023 dict_local(x_100, "048_100", "B1", "1")
2025 validator.add_dissection(
2026 [0x01, 0x01, 0x10, 0x00, 0x10, 0x00, 0x00],
2027 "asterix.048_100",
2028 dict_local(x_100, "048_100", "D1", "1")
2030 validator.add_dissection(
2031 [0x01, 0x01, 0x10, 0x00, 0x08, 0x00, 0x00],
2032 "asterix.048_100",
2033 dict_local(x_100, "048_100", "B2", "1")
2035 validator.add_dissection(
2036 [0x01, 0x01, 0x10, 0x00, 0x04, 0x00, 0x00],
2037 "asterix.048_100",
2038 dict_local(x_100, "048_100", "D2", "1")
2040 validator.add_dissection(
2041 [0x01, 0x01, 0x10, 0x00, 0x02, 0x00, 0x00],
2042 "asterix.048_100",
2043 dict_local(x_100, "048_100", "B4", "1")
2045 validator.add_dissection(
2046 [0x01, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00],
2047 "asterix.048_100",
2048 dict_local(x_100, "048_100", "D4", "1")
2050 validator.add_dissection(
2051 [0x01, 0x01, 0x10, 0x00, 0x00, 0x08, 0x00],
2052 "asterix.048_100",
2053 dict_local(x_100, "048_100", "QC1", "1")
2055 validator.add_dissection(
2056 [0x01, 0x01, 0x10, 0x00, 0x00, 0x04, 0x00],
2057 "asterix.048_100",
2058 dict_local(x_100, "048_100", "QA1", "1")
2060 validator.add_dissection(
2061 [0x01, 0x01, 0x10, 0x00, 0x00, 0x02, 0x00],
2062 "asterix.048_100",
2063 dict_local(x_100, "048_100", "QC2", "1")
2065 validator.add_dissection(
2066 [0x01, 0x01, 0x10, 0x00, 0x00, 0x01, 0x00],
2067 "asterix.048_100",
2068 dict_local(x_100, "048_100", "QA2", "1")
2070 validator.add_dissection(
2071 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x80],
2072 "asterix.048_100",
2073 dict_local(x_100, "048_100", "QC4", "1")
2075 validator.add_dissection(
2076 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x40],
2077 "asterix.048_100",
2078 dict_local(x_100, "048_100", "QA4", "1")
2080 validator.add_dissection(
2081 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x20],
2082 "asterix.048_100",
2083 dict_local(x_100, "048_100", "QB1", "1")
2085 validator.add_dissection(
2086 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x10],
2087 "asterix.048_100",
2088 dict_local(x_100, "048_100", "QD1", "1")
2090 validator.add_dissection(
2091 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x08],
2092 "asterix.048_100",
2093 dict_local(x_100, "048_100", "QB2", "1")
2095 validator.add_dissection(
2096 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x04],
2097 "asterix.048_100",
2098 dict_local(x_100, "048_100", "QD2", "1")
2100 validator.add_dissection(
2101 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x02],
2102 "asterix.048_100",
2103 dict_local(x_100, "048_100", "QB4", "1")
2105 validator.add_dissection(
2106 [0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x01],
2107 "asterix.048_100",
2108 dict_local(x_100, "048_100", "QD4", "1")
2111 validator.add_dissection(
2112 [0x01, 0x01, 0x08, 0x1f, 0xff],
2113 "asterix.048_110",
2115 "asterix.048_110_3DH": "204775"
2118 validator.add_dissection(
2119 [0x01, 0x01, 0x08, 0x20, 0x00],
2120 "asterix.048_110",
2122 "asterix.048_110_3DH": "-204800"
2125 x_120_01 = {
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],
2131 "asterix.048_120",
2132 dict_fspec_local(x_120_01, "048_120_CAL", "D", "1")
2134 validator.add_dissection(
2135 [0x01, 0x01, 0x04, 0x80, 0x01, 0xff],
2136 "asterix.048_120",
2137 dict_fspec_local(x_120_01, "048_120_CAL", "CAL", "511")
2139 validator.add_dissection(
2140 [0x01, 0x01, 0x04, 0x80, 0x02, 0x00],
2141 "asterix.048_120",
2142 dict_fspec_local(x_120_01, "048_120_CAL", "CAL", "-512")
2144 x_120_RDS = {
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],
2151 "asterix.048_120",
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],
2156 "asterix.048_120",
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],
2161 "asterix.048_120",
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],
2166 "asterix.048_120",
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,
2172 0xff],
2173 "asterix.048_120",
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")
2188 x_230 = {
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],
2200 "asterix.048_230",
2201 dict_local(x_230, "048_230", "COM", "7")
2203 validator.add_dissection(
2204 [0x01, 0x01, 0x02, 0x1c, 0x00],
2205 "asterix.048_230",
2206 dict_local(x_230, "048_230", "STAT", "7")
2208 validator.add_dissection(
2209 [0x01, 0x01, 0x02, 0x02, 0x00],
2210 "asterix.048_230",
2211 dict_local(x_230, "048_230", "SI", "1")
2213 validator.add_dissection(
2214 [0x01, 0x01, 0x02, 0x00, 0x80],
2215 "asterix.048_230",
2216 dict_local(x_230, "048_230", "MSSC", "1")
2218 validator.add_dissection(
2219 [0x01, 0x01, 0x02, 0x00, 0x40],
2220 "asterix.048_230",
2221 dict_local(x_230, "048_230", "ARC", "1")
2223 validator.add_dissection(
2224 [0x01, 0x01, 0x02, 0x00, 0x20],
2225 "asterix.048_230",
2226 dict_local(x_230, "048_230", "AIC", "1")
2228 validator.add_dissection(
2229 [0x01, 0x01, 0x02, 0x00, 0x10],
2230 "asterix.048_230",
2231 dict_local(x_230, "048_230", "B1A", "1")
2233 validator.add_dissection(
2234 [0x01, 0x01, 0x02, 0x00, 0x0f],
2235 "asterix.048_230",
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],
2240 "asterix.048_260",
2242 "asterix.048_260_VALUE": '0x0011223344556677'
2245 x_055 = {
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],
2253 "asterix.048_055",
2254 dict_local(x_055, "048_055", "V", "1")
2256 validator.add_dissection(
2257 [0x01, 0x01, 0x01, 0x40, 0x40],
2258 "asterix.048_055",
2259 dict_local(x_055, "048_055", "G", "1")
2261 validator.add_dissection(
2262 [0x01, 0x01, 0x01, 0x40, 0x20],
2263 "asterix.048_055",
2264 dict_local(x_055, "048_055", "L", "1")
2266 validator.add_dissection(
2267 [0x01, 0x01, 0x01, 0x40, 0x1f],
2268 "asterix.048_055",
2269 dict_local(x_055, "048_055", "MODE1", "31")
2271 x_050 = {
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],
2279 "asterix.048_050",
2280 dict_local(x_050, "048_050", "V", "1")
2282 validator.add_dissection(
2283 [0x01, 0x01, 0x01, 0x20, 0x40, 0x00],
2284 "asterix.048_050",
2285 dict_local(x_050, "048_050", "G", "1")
2287 validator.add_dissection(
2288 [0x01, 0x01, 0x01, 0x20, 0x20, 0x00],
2289 "asterix.048_050",
2290 dict_local(x_050, "048_050", "L", "1")
2292 validator.add_dissection(
2293 [0x01, 0x01, 0x01, 0x20, 0x0f, 0xff],
2294 "asterix.048_050",
2295 dict_local(x_050, "048_050", "MODE2", "4095")
2297 x_065 = {
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],
2306 "asterix.048_065",
2307 dict_local(x_065, "048_065", "QA4", "1")
2309 validator.add_dissection(
2310 [0x01, 0x01, 0x01, 0x10, 0x08],
2311 "asterix.048_065",
2312 dict_local(x_065, "048_065", "QA2", "1")
2314 validator.add_dissection(
2315 [0x01, 0x01, 0x01, 0x10, 0x04],
2316 "asterix.048_065",
2317 dict_local(x_065, "048_065", "QA1", "1")
2319 validator.add_dissection(
2320 [0x01, 0x01, 0x01, 0x10, 0x02],
2321 "asterix.048_065",
2322 dict_local(x_065, "048_065", "QB2", "1")
2324 validator.add_dissection(
2325 [0x01, 0x01, 0x01, 0x10, 0x01],
2326 "asterix.048_065",
2327 dict_local(x_065, "048_065", "QB1", "1")
2329 x_060 = {
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],
2345 "asterix.048_060",
2346 dict_local(x_060, "048_060", "QA4", "1")
2348 validator.add_dissection(
2349 [0x01, 0x01, 0x01, 0x08, 0x04, 0x00],
2350 "asterix.048_060",
2351 dict_local(x_060, "048_060", "QA2", "1")
2353 validator.add_dissection(
2354 [0x01, 0x01, 0x01, 0x08, 0x02, 0x00],
2355 "asterix.048_060",
2356 dict_local(x_060, "048_060", "QA1", "1")
2358 validator.add_dissection(
2359 [0x01, 0x01, 0x01, 0x08, 0x01, 0x00],
2360 "asterix.048_060",
2361 dict_local(x_060, "048_060", "QB4", "1")
2363 validator.add_dissection(
2364 [0x01, 0x01, 0x01, 0x08, 0x00, 0x80],
2365 "asterix.048_060",
2366 dict_local(x_060, "048_060", "QB2", "1")
2368 validator.add_dissection(
2369 [0x01, 0x01, 0x01, 0x08, 0x00, 0x40],
2370 "asterix.048_060",
2371 dict_local(x_060, "048_060", "QB1", "1")
2373 validator.add_dissection(
2374 [0x01, 0x01, 0x01, 0x08, 0x00, 0x20],
2375 "asterix.048_060",
2376 dict_local(x_060, "048_060", "QC4", "1")
2378 validator.add_dissection(
2379 [0x01, 0x01, 0x01, 0x08, 0x00, 0x10],
2380 "asterix.048_060",
2381 dict_local(x_060, "048_060", "QC2", "1")
2383 validator.add_dissection(
2384 [0x01, 0x01, 0x01, 0x08, 0x00, 0x08],
2385 "asterix.048_060",
2386 dict_local(x_060, "048_060", "QC1", "1")
2388 validator.add_dissection(
2389 [0x01, 0x01, 0x01, 0x08, 0x00, 0x04],
2390 "asterix.048_060",
2391 dict_local(x_060, "048_060", "QD4", "1")
2393 validator.add_dissection(
2394 [0x01, 0x01, 0x01, 0x08, 0x00, 0x02],
2395 "asterix.048_060",
2396 dict_local(x_060, "048_060", "QD2", "1")
2398 validator.add_dissection(
2399 [0x01, 0x01, 0x01, 0x08, 0x00, 0x01],
2400 "asterix.048_060",
2401 dict_local(x_060, "048_060", "QD1", "1")
2403 validator.add_dissection(
2404 [0x01, 0x01, 0x01, 0x04, 0x01],
2405 "asterix.048_SP",
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],
2411 "asterix.048_SP",
2414 '''TODO: re-enable RE and SP tests when implemented
2415 x_re_md5 = {
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(
2425 [0x80, 0x80, 0x80],
2426 "MD5",
2427 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M5", "1")
2429 validator.add_re_dissection(
2430 [0x80, 0x80, 0x40],
2431 "MD5",
2432 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "ID", "1")
2434 validator.add_re_dissection(
2435 [0x80, 0x80, 0x20],
2436 "MD5",
2437 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "DA", "1")
2439 validator.add_re_dissection(
2440 [0x80, 0x80, 0x10],
2441 "MD5",
2442 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M1", "1")
2444 validator.add_re_dissection(
2445 [0x80, 0x80, 0x08],
2446 "MD5",
2447 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M2", "1")
2449 validator.add_re_dissection(
2450 [0x80, 0x80, 0x04],
2451 "MD5",
2452 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M3", "1")
2454 validator.add_re_dissection(
2455 [0x80, 0x80, 0x02],
2456 "MD5",
2457 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "MC", "1")
2459 x_re_pmn = {
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],
2467 "MD5",
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],
2472 "MD5",
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],
2477 "MD5",
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],
2482 "MD5",
2483 dict_fspec_local(x_re_pmn, "048_RE_MD5_02", "MIS", "63")
2485 x_re_pos = {
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],
2491 "MD5",
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],
2496 "MD5",
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],
2501 "MD5",
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],
2507 "MD5",
2508 dict_fspec_local(x_re_pos, "048_RE_MD5_03", "LON", "-180")
2510 x_re_ga = {
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],
2516 "MD5",
2517 dict_fspec_local(x_re_ga, "048_RE_MD5_04", "RES", "1")
2519 validator.add_re_dissection(
2520 [0x80, 0x10, 0x1f, 0xff],
2521 "MD5",
2522 dict_fspec_local(x_re_ga, "048_RE_MD5_04", "GA", "204775")
2524 validator.add_re_dissection(
2525 [0x80, 0x10, 0x20, 0x00],
2526 "MD5",
2527 dict_fspec_local(x_re_ga, "048_RE_MD5_04", "GA", "-204800")
2529 x_re_em1 = {
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],
2537 "MD5",
2538 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "V", "1")
2540 validator.add_re_dissection(
2541 [0x80, 0x08, 0x40, 0x00],
2542 "MD5",
2543 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "G", "1")
2545 validator.add_re_dissection(
2546 [0x80, 0x08, 0x20, 0x00],
2547 "MD5",
2548 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "L", "1")
2550 validator.add_re_dissection(
2551 [0x80, 0x08, 0x0f, 0xff],
2552 "MD5",
2553 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "MODE3A", "4095")
2555 validator.add_re_dissection(
2556 [0x80, 0x04, 0x7f],
2557 "MD5",
2558 fspec_local("048_RE_MD5_06", "TOS", "0.9921875")
2560 validator.add_re_dissection(
2561 [0x80, 0x04, 0x80],
2562 "MD5",
2563 fspec_local("048_RE_MD5_06", "TOS", "-1")
2565 x_re_xp = {
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(
2574 [0x80, 0x02, 0x20],
2575 "MD5",
2576 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "XP", "1")
2578 validator.add_re_dissection(
2579 [0x80, 0x02, 0x10],
2580 "MD5",
2581 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X5", "1")
2583 validator.add_re_dissection(
2584 [0x80, 0x02, 0x08],
2585 "MD5",
2586 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "XC", "1")
2588 validator.add_re_dissection(
2589 [0x80, 0x02, 0x04],
2590 "MD5",
2591 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X3", "1")
2593 validator.add_re_dissection(
2594 [0x80, 0x02, 0x02],
2595 "MD5",
2596 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X2", "1")
2598 validator.add_re_dissection(
2599 [0x80, 0x02, 0x01],
2600 "MD5",
2601 dict_fspec_local(x_re_xp, "048_RE_MD5_07", "X1", "1")
2603 x_re_md5 = {
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(
2613 [0x40, 0x80, 0x80],
2614 "M5N",
2615 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M5", "1")
2617 validator.add_re_dissection(
2618 [0x40, 0x80, 0x40],
2619 "M5N",
2620 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "ID", "1")
2622 validator.add_re_dissection(
2623 [0x40, 0x80, 0x20],
2624 "M5N",
2625 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "DA", "1")
2627 validator.add_re_dissection(
2628 [0x40, 0x80, 0x10],
2629 "M5N",
2630 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M1", "1")
2632 validator.add_re_dissection(
2633 [0x40, 0x80, 0x08],
2634 "M5N",
2635 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M2", "1")
2637 validator.add_re_dissection(
2638 [0x40, 0x80, 0x04],
2639 "M5N",
2640 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M3", "1")
2642 validator.add_re_dissection(
2643 [0x40, 0x80, 0x02],
2644 "M5N",
2645 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "MC", "1")
2647 x_re_pmn = {
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],
2654 "M5N",
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],
2659 "M5N",
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],
2664 "M5N",
2665 dict_fspec_local(x_re_pmn, "048_RE_M5N_02", "NO", "2047")
2667 x_re_pos = {
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],
2673 "M5N",
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],
2678 "M5N",
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],
2683 "M5N",
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],
2689 "M5N",
2690 dict_fspec_local(x_re_pos, "048_RE_M5N_03", "LON", "-180")
2692 x_re_ga = {
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],
2698 "M5N",
2699 dict_fspec_local(x_re_ga, "048_RE_M5N_04", "RES", "1")
2701 validator.add_re_dissection(
2702 [0x40, 0x10, 0x1f, 0xff],
2703 "M5N",
2704 dict_fspec_local(x_re_ga, "048_RE_M5N_04", "GA", "204775")
2706 validator.add_re_dissection(
2707 [0x40, 0x10, 0x20, 0x00],
2708 "M5N",
2709 dict_fspec_local(x_re_ga, "048_RE_M5N_04", "GA", "-204800")
2711 x_re_em1 = {
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],
2719 "M5N",
2720 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "V", "1")
2722 validator.add_re_dissection(
2723 [0x40, 0x08, 0x40, 0x00],
2724 "M5N",
2725 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "G", "1")
2727 validator.add_re_dissection(
2728 [0x40, 0x08, 0x20, 0x00],
2729 "M5N",
2730 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "L", "1")
2732 validator.add_re_dissection(
2733 [0x40, 0x08, 0x0f, 0xff],
2734 "M5N",
2735 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "MODE3A", "4095")
2737 validator.add_re_dissection(
2738 [0x40, 0x04, 0x7f],
2739 "M5N",
2740 fspec_local("048_RE_M5N_06", "TOS", "0.9921875")
2742 validator.add_re_dissection(
2743 [0x40, 0x04, 0x80],
2744 "M5N",
2745 fspec_local("048_RE_M5N_06", "TOS", "-1")
2747 x_re_xp = {
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(
2756 [0x40, 0x02, 0x20],
2757 "M5N",
2758 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "XP", "1")
2760 validator.add_re_dissection(
2761 [0x40, 0x02, 0x10],
2762 "M5N",
2763 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X5", "1")
2765 validator.add_re_dissection(
2766 [0x40, 0x02, 0x08],
2767 "M5N",
2768 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "XC", "1")
2770 validator.add_re_dissection(
2771 [0x40, 0x02, 0x04],
2772 "M5N",
2773 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X3", "1")
2775 validator.add_re_dissection(
2776 [0x40, 0x02, 0x02],
2777 "M5N",
2778 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X2", "1")
2780 validator.add_re_dissection(
2781 [0x40, 0x02, 0x01],
2782 "M5N",
2783 dict_fspec_local(x_re_xp, "048_RE_M5N_07", "X1", "1")
2785 validator.add_re_dissection(
2786 [0x40, 0x01, 0x80, 0x1f],
2787 "M5N",
2788 fspec_local("048_RE_M5N_08", "FOM", "31")
2790 validator.add_re_dissection(
2791 [0x20, 0x06],
2792 "M4E",
2794 "asterix.048_RE_M4E_FOE_FRI": "3",
2795 "asterix.FX": "0"
2798 validator.add_re_dissection(
2799 [0x10, 0x80, 0xff],
2800 "RPC",
2801 fspec_local("048_RE_RPC_01", "SCO", "255")
2803 validator.add_re_dissection(
2804 [0x10, 0x40, 0xff, 0xff],
2805 "RPC",
2806 fspec_local("048_RE_RPC_02", "SCR", "6553.5")
2808 validator.add_re_dissection(
2809 [0x10, 0x20, 0xff, 0xff],
2810 "RPC",
2811 fspec_local("048_RE_RPC_03", "RW", "255.99609375")
2813 validator.add_re_dissection(
2814 [0x10, 0x10, 0xff, 0xff],
2815 "RPC",
2816 fspec_local("048_RE_RPC_04", "AR", "255.99609375")
2818 validator.add_re_dissection(
2819 [0x08, 0xff, 0xff, 0xff],
2820 "ERR",
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(
2836 [0x08, 0x10, 0x00],
2837 "asterix.048_070",
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],
2847 "asterix.048_161",
2849 "asterix.048_161_TRN": "0"
2852 validator.add_dissection(
2853 [0x01, 0x02, 0x01, 0x0e],
2854 "asterix.048_170",
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",
2865 "asterix.FX": "0"
2868 validator.add_dissection(
2869 [0x01, 0x01, 0x40, 0xfe],
2870 "asterix.048_030",
2872 "asterix.048_030_Subitem": "127",
2873 "asterix.FX": "0"
2876 validator.add_dissection(
2877 [0x01, 0x01, 0x20, 0xf0, 0x00],
2878 "asterix.048_080",
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],
2897 "asterix.048_100",
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],
2928 "asterix.048_120",
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],
2941 "asterix.048_120",
2943 "asterix.fspec": ""
2946 validator.add_dissection(
2947 [0x01, 0x01, 0x02, 0x01, 0x00],
2948 "asterix.048_230",
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],
2962 "asterix.048_050",
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],
2972 "asterix.048_065",
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
2982 x_re_md5 = {
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],
2993 "MD5",
2994 dict_fspec_local(x_re_md5, "048_RE_MD5_01", "M5", "0")
2996 x_re_pmn = {
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],
3004 "MD5",
3005 dict_fspec_local(x_re_pmn, "048_RE_MD5_02", "PIN", "0")
3007 x_re_em1 = {
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],
3015 "MD5",
3016 dict_fspec_local(x_re_em1, "048_RE_MD5_05", "V", "0")
3018 x_re_md5 = {
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],
3029 "M5N",
3030 dict_fspec_local(x_re_md5, "048_RE_M5N_01", "M5", "0")
3032 x_re_pmn = {
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],
3039 "M5N",
3040 dict_fspec_local(x_re_pmn, "048_RE_M5N_02", "PIN", "0")
3042 x_re_em1 = {
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],
3050 "M5N",
3051 dict_fspec_local(x_re_em1, "048_RE_M5N_05", "V", "0")
3053 validator.add_re_dissection(
3054 [0x40, 0x01, 0x80, 0xe0],
3055 "M5N",
3056 fspec_local("048_RE_M5N_08", "FOM", "0")
3058 validator.add_re_dissection(
3059 [0x20, 0xf8],
3060 "M4E",
3062 "asterix.048_RE_M4E_FOE_FRI": "0",
3063 "asterix.FX": "0"
3066 validator.add_re_dissection(
3067 [0x20, 0x01, 0x00],
3068 "M4E",
3070 "asterix.048_RE_M4E_FOE_FRI": "0",
3071 "asterix.FX": "1"
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
3104 12 - spare -
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(
3116 [0x80, 0xff, 0x00],
3117 "asterix.063_010",
3119 "asterix.063_010_SAC": "0xff",
3120 "asterix.063_010_SIC": "0x00"
3123 validator.add_dissection(
3124 [0x80, 0x00, 0xff],
3125 "asterix.063_010",
3127 "asterix.063_010_SAC": "0x00",
3128 "asterix.063_010_SIC": "0xff"
3131 validator.add_dissection(
3132 [0x40, 0xff],
3133 "asterix.063_015",
3135 "asterix.063_015_VALUE": "0xff"
3138 validator.add_dissection(
3139 [0x20, 0xa8, 0xbf, 0xff],
3140 "asterix.063_030",
3142 "asterix.063_030_VALUE": "86399.9921875"
3145 validator.add_dissection(
3146 [0x10, 0xff, 0x00],
3147 "asterix.063_050",
3149 "asterix.063_050_SAC": "0xff",
3150 "asterix.063_050_SIC": "0x00"
3153 validator.add_dissection(
3154 [0x10, 0x00, 0xff],
3155 "asterix.063_050",
3157 "asterix.063_050_SAC": "0x00",
3158 "asterix.063_050_SIC": "0xff"
3161 validator.add_dissection(
3162 [0x08, 0xc0],
3163 "asterix.063_060",
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",
3171 "asterix.FX": "0"
3174 validator.add_dissection(
3175 [0x08, 0x20],
3176 "asterix.063_060",
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",
3184 "asterix.FX": "0"
3187 validator.add_dissection(
3188 [0x08, 0x10],
3189 "asterix.063_060",
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",
3197 "asterix.FX": "0"
3200 validator.add_dissection(
3201 [0x08, 0x08],
3202 "asterix.063_060",
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",
3210 "asterix.FX": "0"
3213 validator.add_dissection(
3214 [0x08, 0x04],
3215 "asterix.063_060",
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",
3223 "asterix.FX": "0"
3226 validator.add_dissection(
3227 [0x08, 0x02],
3228 "asterix.063_060",
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",
3236 "asterix.FX": "0"
3239 validator.add_dissection(
3240 [0x08, 0x01, 0x80],
3241 "asterix.063_060",
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",
3255 "asterix.FX": "0"
3258 validator.add_dissection(
3259 [0x08, 0x01, 0x40],
3260 "asterix.063_060",
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",
3274 "asterix.FX": "0"
3277 validator.add_dissection(
3278 [0x08, 0x01, 0x20],
3279 "asterix.063_060",
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",
3293 "asterix.FX": "0"
3296 validator.add_dissection(
3297 [0x08, 0x01, 0x10],
3298 "asterix.063_060",
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",
3312 "asterix.FX": "0"
3315 validator.add_dissection(
3316 [0x08, 0x01, 0x08],
3317 "asterix.063_060",
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",
3331 "asterix.FX": "0"
3334 validator.add_dissection(
3335 [0x08, 0x01, 0x04],
3336 "asterix.063_060",
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",
3350 "asterix.FX": "0"
3353 validator.add_dissection(
3354 [0x04, 0xff, 0xff],
3355 "asterix.063_070",
3357 "asterix.063_070_VALUE": "-1"
3360 validator.add_dissection(
3361 [0x02, 0x7f, 0xff, 0x00, 0x00],
3362 "asterix.063_080",
3364 "asterix.063_080_SRG": "0.32767",
3365 "asterix.063_080_SRB": "0"
3368 validator.add_dissection(
3369 [0x02, 0x80, 0x00, 0x00, 0x00],
3370 "asterix.063_080",
3372 "asterix.063_080_SRG": "-0.32768",
3373 "asterix.063_080_SRB": "0"
3376 validator.add_dissection(
3377 [0x02, 0x00, 0x00, 0x7f, 0xff],
3378 "asterix.063_080",
3380 "asterix.063_080_SRG": "0",
3381 "asterix.063_080_SRB": "255.9921875"
3384 validator.add_dissection(
3385 [0x02, 0x00, 0x00, 0x80, 0x00],
3386 "asterix.063_080",
3388 "asterix.063_080_SRG": "0",
3389 "asterix.063_080_SRB": "-256"
3392 validator.add_dissection(
3393 [0x01, 0x80, 0x7f, 0xff],
3394 "asterix.063_081",
3396 "asterix.063_081_VALUE": "179.994506835938"
3399 validator.add_dissection(
3400 [0x01, 0x80, 0x80, 0x00],
3401 "asterix.063_081",
3403 "asterix.063_081_VALUE": "-180"
3406 validator.add_dissection(
3407 [0x01, 0x40, 0x7f, 0xff, 0x00, 0x00],
3408 "asterix.063_090",
3410 "asterix.063_090_PRG": "0.32767",
3411 "asterix.063_090_PRB": "0"
3414 validator.add_dissection(
3415 [0x01, 0x40, 0x80, 0x00, 0x00, 0x00],
3416 "asterix.063_090",
3418 "asterix.063_090_PRG": "-0.32768",
3419 "asterix.063_090_PRB": "0"
3422 validator.add_dissection(
3423 [0x01, 0x40, 0x00, 0x00, 0x7f, 0xff],
3424 "asterix.063_090",
3426 "asterix.063_090_PRG": "0",
3427 "asterix.063_090_PRB": "255.9921875"
3430 validator.add_dissection(
3431 [0x01, 0x40, 0x00, 0x00, 0x80, 0x00],
3432 "asterix.063_090",
3434 "asterix.063_090_PRG": "0",
3435 "asterix.063_090_PRB": "-256"
3438 validator.add_dissection(
3439 [0x01, 0x20, 0x7f, 0xff],
3440 "asterix.063_091",
3442 "asterix.063_091_VALUE": "179.994506835938"
3445 validator.add_dissection(
3446 [0x01, 0x20, 0x80, 0x00],
3447 "asterix.063_091",
3449 "asterix.063_091_VALUE": "-180"
3452 validator.add_dissection(
3453 [0x01, 0x10, 0x7f, 0xff],
3454 "asterix.063_092",
3456 "asterix.063_092_VALUE": "179.994506835938"
3459 validator.add_dissection(
3460 [0x01, 0x10, 0x80, 0x00],
3461 "asterix.063_092",
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(
3476 [0x01, 0x08],
3477 "asterix.spare",
3480 '''TODO: re-enable RE and SP tests when implemented
3481 validator.add_dissection(
3482 [0x01, 0x04, 0x02, 0x00],
3483 "asterix.063_RE",
3485 "asterix.re_field_len": "2",
3486 "asterix.fspec": ""
3489 validator.add_dissection(
3490 [0x01, 0x04, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
3491 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
3492 "asterix.063_RE",
3494 "asterix.fspec": "",
3495 "asterix.re_field_len": "16"
3498 validator.add_dissection(
3499 [0x01, 0x02, 0x01],
3500 "asterix.063_SP",
3503 validator.add_dissection(
3504 [0x01, 0x02, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
3505 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
3506 "asterix.063_SP",
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 -
3536 8 - Spare -
3537 9 - Spare -
3538 10 - Spare -
3539 11 - Spare -
3540 12 - Spare -
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(
3552 [0x80, 0xff, 0x00],
3553 "asterix.065_010",
3555 "asterix.065_010_SAC": "0xff",
3556 "asterix.065_010_SIC": "0x00"
3559 validator.add_dissection(
3560 [0x80, 0x00, 0xff],
3561 "asterix.065_010",
3563 "asterix.065_010_SAC": "0x00",
3564 "asterix.065_010_SIC": "0xff"
3567 validator.add_dissection(
3568 [0x40, 0x03],
3569 "asterix.065_000",
3571 "asterix.065_000_VALUE": "3"
3574 validator.add_dissection(
3575 [0x20, 0xff],
3576 "asterix.065_015",
3578 "asterix.065_015_VALUE": "0xff"
3581 validator.add_dissection(
3582 [0x10, 0xa8, 0xbf, 0xff],
3583 "asterix.065_030",
3585 "asterix.065_030_VALUE": "86399.9921875"
3588 validator.add_dissection(
3589 [0x08, 0xff],
3590 "asterix.065_020",
3592 "asterix.065_020_VALUE": "255"
3595 validator.add_dissection(
3596 [0x04, 0xc0],
3597 "asterix.065_040",
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(
3607 [0x04, 0x20],
3608 "asterix.065_040",
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(
3618 [0x04, 0x10],
3619 "asterix.065_040",
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(
3629 [0x04, 0x0c],
3630 "asterix.065_040",
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(
3640 [0x04, 0x02],
3641 "asterix.065_040",
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(
3651 [0x02, 0xff],
3652 "asterix.065_050",
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],
3660 "asterix.065_RE",
3662 "asterix.re_field_len": "2",
3663 "asterix.fspec": ""
3666 validator.add_dissection(
3667 [0x01, 0x04, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3668 0x00],
3669 "asterix.065_RE",
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,
3682 0x00],
3683 "asterix.065_RE",
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,
3696 0x00],
3697 "asterix.065_RE",
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,
3710 0x00],
3711 "asterix.065_RE",
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],
3724 "asterix.065_RE",
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(
3745 [0x40, 0xff],
3746 "asterix.065_000",
3748 "asterix.065_000_VALUE": "255"
3751 validator.add_dissection(
3752 [0x10, 0xff, 0xff, 0xff],
3753 "asterix.065_030",
3755 "asterix.065_030_VALUE": "131071.9921875"
3758 validator.add_dissection(
3759 [0x04, 0x01],
3760 "asterix.065_040",
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(
3770 [0x01, 0x80],
3771 "asterix.spare",
3774 validator.add_dissection(
3775 [0x01, 0x40],
3776 "asterix.spare",
3779 validator.add_dissection(
3780 [0x01, 0x20],
3781 "asterix.spare",
3784 validator.add_dissection(
3785 [0x01, 0x10],
3786 "asterix.spare",
3789 validator.add_dissection(
3790 [0x01, 0x08],
3791 "asterix.spare",
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,
3797 0x00],
3798 "asterix.065_RE",
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,
3811 0x00],
3812 "asterix.065_RE",
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,
3825 0xff],
3826 "asterix.065_RE",
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,
3839 0x00],
3840 "asterix.065_RE",
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],
3853 "asterix.065_RE",
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(
3864 [0x01, 0x02, 0x01],
3865 "asterix.065_SP",
3868 validator.add_dissection(
3869 [0x01, 0x02, 0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
3870 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff],
3871 "asterix.065_SP",
3876 validator.check_dissections()