cat001.h
Go to the documentation of this file.
1 /*
2  * libasterix
3  * Copyright [2013-2021] SinoATC <http://www.sinoatc.com>.
4  * All Rights Reserved.
5  *
6  * NOTICE: All information contained herein is, and remains
7  * the property of SinoATC and its suppliers, if any.
8  * The intellectual and technical concepts contained herein
9  * are proprietary to Aerosys Corporation and its suppliers and may be
10  * covered by U.S. and Foreign Patents, patents in process,
11  * and are protected by trade secret or copyright law.
12  * Dissemination of this information or reproduction of this material
13  * is strictly forbidden unless prior written permission is obtained
14  * from SinoATC.
15  */
16 
24 #ifndef LIBASTERIX_CAT001_H
25 #define LIBASTERIX_CAT001_H
26 
27 #include "dataitem.h"
28 #include "datarecord.h"
29 #include "datablock.h"
30 #include "cat_generic.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 // Data Item
37 
40 
48 
50 #define ast_dataitem_001_010_get_size ast_dataitem_data_source_identifier_get_size
51 
53 #define ast_dataitem_001_010_decode ast_dataitem_data_source_identifier_decode
54 
56 #define ast_dataitem_001_010_encode ast_dataitem_data_source_identifier_encode
57 
59 #define ast_dataitem_001_010_get_summary ast_dataitem_data_source_identifier_get_summary
60 
62 #define ast_dataitem_001_010_get_detail_html ast_dataitem_data_source_identifier_get_detail_html
63 
72 typedef enum _ast_conventional_radar_target_type_t
73 {
77 
78 typedef enum _ast_radar_detection_type_t
79 {
85 
86 typedef enum _ast_radar_emergency_type_t
87 {
93 
95 typedef struct _ast_dataitem_001_020_t
96 {
97  bool valid;
98 
100  bool simulated;
102  int antenna;
103  bool spi;
105  bool test;
110 
112 #define ast_dataitem_001_020_get_size ast_dataitem_get_size_var_2_byte
113 
116 
118 AST_API ast_dataitem_t ast_dataitem_001_020_encode(unsigned char* const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi);
119 
121 AST_API void ast_dataitem_001_020_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
122 
124 AST_API void ast_dataitem_001_020_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di);
125 
134 typedef struct _ast_dataitem_001_030_t
136 {
137  bool valid;
138 
140 
142 #define ast_dataitem_001_030_get_size ast_dataitem_get_size_var_2_byte
143 
145 //AST_API ast_dataitem_001_030_t ast_dataitem_001_030_decode(const ast_dataitem_t di);
146 
148 //AST_API void ast_dataitem_001_030_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
149 
151 //AST_API void ast_dataitem_001_030_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
152 
161 typedef struct _ast_dataitem_001_040_t
163 {
164  bool valid;
165 
166  int raw_rho;
167  int raw_theta;
168 
169  double rho;
170  double theta;
172 
174 #define ast_dataitem_001_040_get_size ast_dataitem_get_size_fixed_4_byte
175 
178 
180 AST_API ast_dataitem_t ast_dataitem_001_040_encode(unsigned char* const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi);
181 
183 AST_API void ast_dataitem_001_040_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
184 
186 AST_API void ast_dataitem_001_040_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
187 
196 typedef struct _ast_dataitem_001_042_t
198 {
199  bool valid;
200 
201  int raw_x;
202  int raw_y;
203 
204  double x;
205  double y;
207 
209 #define ast_dataitem_001_042_get_size ast_dataitem_get_size_fixed_4_byte
210 
213 
215 AST_API ast_dataitem_t ast_dataitem_001_042_encode(unsigned char* const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi);
216 
218 AST_API void ast_dataitem_001_042_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
219 
221 AST_API void ast_dataitem_001_042_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
222 
230 #define ast_dataitem_001_050_get_size ast_dataitem_mode_2_code_get_size
232 
241 typedef struct _ast_dataitem_001_060_t
243 {
244  bool valid;
245 
247 
249 #define ast_dataitem_001_060_get_size ast_dataitem_get_size_fixed_2_byte
250 
252 //AST_API ast_dataitem_001_060_t ast_dataitem_001_060_decode(const ast_dataitem_t di);
253 
255 //AST_API void ast_dataitem_001_060_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
256 
258 //AST_API void ast_dataitem_001_060_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
259 
270 
272 #define ast_dataitem_001_070_get_size ast_dataitem_mode_3a_code_get_size
273 
275 #define ast_dataitem_001_070_decode ast_dataitem_mode_3a_code_decode
276 
278 #define ast_dataitem_001_070_encode ast_dataitem_mode_3a_code_encode
279 
281 #define ast_dataitem_001_070_get_summary ast_dataitem_mode_3a_code_get_summary
282 
284 #define ast_dataitem_001_070_get_detail_html ast_dataitem_mode_3a_code_get_detail_html
285 
296 
298 #define ast_dataitem_001_080_get_size ast_dataitem_mode_3a_confidence_get_size
299 
301 #define ast_dataitem_001_080_decode ast_dataitem_mode_3a_confidence_decode
302 
304 #define ast_dataitem_001_080_get_summary ast_dataitem_mode_3a_confidence_get_summary
305 
307 #define ast_dataitem_001_080_get_detail_html ast_dataitem_mode_3a_confidence_get_detail_html
308 
319 
321 #define ast_dataitem_001_090_get_size ast_dataitem_mode_c_code_get_size
322 
324 #define ast_dataitem_001_090_decode ast_dataitem_mode_c_code_decode
325 
327 #define ast_dataitem_001_090_encode ast_dataitem_mode_c_code_encode
328 
330 #define ast_dataitem_001_090_get_summary ast_dataitem_mode_c_code_get_summary
331 
333 #define ast_dataitem_001_090_get_detail_html ast_dataitem_mode_c_code_get_detail_html
334 
345 
347 #define ast_dataitem_001_100_get_size ast_dataitem_mode_c_confidence_get_size
348 
350 #define ast_dataitem_001_100_decode ast_dataitem_mode_c_confidence_decode
351 
353 #define ast_dataitem_001_100_get_summary ast_dataitem_mode_c_confidence_get_summary
354 
356 #define ast_dataitem_001_100_get_detail_html ast_dataitem_mode_c_confidence_get_detail_html
357 
366 typedef struct _ast_dataitem_001_120_t
368 {
369  bool valid;
370 
372 
374 #define ast_dataitem_001_120_get_size ast_dataitem_get_size_fixed_1_byte
375 
377 //AST_API ast_dataitem_001_120_t ast_dataitem_001_120_decode(const ast_dataitem_t di);
378 
380 //AST_API void ast_dataitem_001_120_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
381 
383 //AST_API void ast_dataitem_001_120_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
384 
393 #define ast_dataitem_001_130_get_size ast_dataitem_get_size_var_2_byte
395 
397 #define ast_dataitem_001_130_get_summary ast_dataitem_binary_data_get_summary
398 
400 #define ast_dataitem_001_130_get_detail_html ast_dataitem_get_detail_html_dummy
401 
409 #define ast_dataitem_001_131_get_size ast_dataitem_get_size_fixed_1_byte
411 
420 typedef struct _ast_dataitem_001_141_t
422 {
423  bool valid;
424 
425  unsigned int raw_time;
426 
427  unsigned int sec;
428  unsigned int msec;
430 
432 #define ast_dataitem_001_141_get_size ast_dataitem_get_size_fixed_2_byte
433 
436 
438 AST_API ast_dataitem_t ast_dataitem_001_141_encode(unsigned char* const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi);
439 
441 AST_API void ast_dataitem_001_141_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
442 
444 AST_API void ast_dataitem_001_141_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
445 
456 
458 #define ast_dataitem_001_161_get_size ast_dataitem_track_number_get_size
459 
461 #define ast_dataitem_001_161_decode ast_dataitem_track_number_decode
462 
464 #define ast_dataitem_001_161_encode ast_dataitem_track_number_encode
465 
467 #define ast_dataitem_001_161_get_summary ast_dataitem_track_number_get_summary
468 
470 #define ast_dataitem_001_161_get_detail_html ast_dataitem_track_number_get_detail_html
471 
480 typedef enum _ast_conventional_radar_track_type_t
481 {
485 
487 typedef struct _ast_dataitem_001_170
488 {
489  bool valid;
490 
491  bool tentative;
493  bool manoeuvre;
496  bool ghost;
499 
501 #define ast_dataitem_001_170_get_size ast_dataitem_get_size_var_2_byte
502 
505 
507 AST_API ast_dataitem_t ast_dataitem_001_170_encode(unsigned char* const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi);
508 
510 AST_API void ast_dataitem_001_170_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
511 
513 AST_API void ast_dataitem_001_170_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
514 
525 
527 #define ast_dataitem_001_200_get_size ast_dataitem_velocity_polar_get_size
528 
530 #define ast_dataitem_001_200_decode ast_dataitem_velocity_polar_decode
531 
533 #define ast_dataitem_001_200_encode ast_dataitem_velocity_polar_encode
534 
536 #define ast_dataitem_001_200_get_summary ast_dataitem_velocity_polar_get_summary
537 
539 #define ast_dataitem_001_200_get_detail_html ast_dataitem_velocity_polar_get_detail_html
540 
549 typedef struct _ast_dataitem_001_210
551 {
552  bool valid;
553 
554  int quality1;
555  int quality2;
557 
559 #define ast_dataitem_001_210_get_size ast_dataitem_get_size_var_2_byte
560 
563 
565 AST_API void ast_dataitem_001_210_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
566 
568 AST_API void ast_dataitem_001_210_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
569 
578 #define ast_dataitem_001_REF_get_size ast_dataitem_reserved_expansion_field_get_size
580 
582 //ast_dataitem_001_REF_t ast_dataitem_062_REF_decode(const ast_dataitem_t di);
583 
585 #define ast_dataitem_001_REF_get_summary ast_dataitem_reserved_expansion_field_get_summary
586 
588 #define ast_dataitem_001_REF_get_detail_html ast_dataitem_reserved_expansion_field_get_detail_html
589 
593 // Data Record
594 
597 
599 #define ast_datarecord_001_get_timeofday 0
600 
603 
606 
609 
611 #define ast_datarecord_001_get_callsign 0
612 
614 #define ast_datarecord_001_get_icaoaddr 0
615 
617 #define ast_datarecord_001_get_coordinate 0
618 
621 
624 
626 #define ast_datarecord_001_get_heading 0
627 
629 #define ast_datarecord_001_get_speed 0
630 
636 typedef struct _ast_datarecord_001_t
638 {
639  bool valid;
640 
652  //ast_dataitem_001_130_t dataitem_001_130;
658 
660 
663 
665 AST_API ast_datarecord_t ast_datarecord_001_assemble(unsigned char* const buffer, const size_t bufsize, const ast_datarecord_001_t dr, const ast_uap_t uap);
666 
669 // Data Block
670 
673 
680 ast_datablock_t ast_datablock_001_mixuap_decode(const unsigned char* const buffer, const size_t bufsize);
681 
682 
683 #ifdef __cplusplus
684  }
685 #endif // extern "C"
686 
687 #endif //LIBASTERIX_CAT001_H
688 
689 // vim:set ft=c sw=2 sts=2 fenc=utf8:
bool valid
Definition: cat001.h:244
Altitude.
Definition: type.h:111
Datablock.
Definition: datablock.h:42
ast_dataitem_001_010_t dataitem_001_010
Definition: cat001.h:641
bool doubt_association
Definition: cat001.h:494
ast_radar_emergency_type_t emergency
Definition: cat001.h:106
bool test
Definition: cat001.h:105
Extracted dataitem.
Definition: dataitem.h:433
Definition: cat001.h:90
ast_sacsic_t ast_datarecord_001_get_sacsic(const ast_datarecord_t dr)
Get SAC/SIC function.
int raw_y
Raw format as defined in doc, resolution 1/2^(6+f) nm.
Definition: cat001.h:202
const char * ast_dataitem_001_get_name(const ast_dataitem_type_t type)
Get name function.
bool valid
Definition: cat001.h:97
Implementation of Datarecord concept defined by ASTERIX.
Data Source Identifier (aka SAC/SIC)
Definition: type.h:35
Definition: uap.h:36
ast_dataitem_t ast_dataitem_001_042_encode(unsigned char *const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi)
Encode function.
int raw_rho
Raw format as defined in doc, resolution 1/128 nm.
Definition: cat001.h:166
double y
nm
Definition: cat001.h:205
ast_conventional_radar_target_type_t target_type
Definition: cat001.h:99
bool manoeuvre
Definition: cat001.h:493
int antenna
Definition: cat001.h:102
Data Item Itrack_number - Track Number.
Definition: cat_generic.h:727
void ast_dataitem_001_210_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
Definition: cat001.h:83
ast_dataitem_001_100_t dataitem_001_100
Definition: cat001.h:650
ast_dataitem_mode_3a_code_t ast_dataitem_001_070_t
Data Item I001/070 - Mode-3/A Code in Octal Representation.
Definition: cat001.h:269
ast_dataitem_001_040_t dataitem_001_040
Definition: cat001.h:644
Definition: cat001.h:88
Data Item I001/120 - Calculated Position in Cartesian Coordinates.
Definition: cat001.h:367
#define AST_API
Definition: platform.h:63
Data Item - Data Source Identifier.
Definition: cat_generic.h:93
ast_conventional_radar_track_type_t type
Definition: cat001.h:492
bool valid
Definition: cat001.h:639
ast_dataitem_t ast_dataitem_001_141_encode(unsigned char *const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi)
Encode function.
bool valid
Definition: cat001.h:164
ast_dataitem_001_141_t dataitem_001_141
Definition: cat001.h:653
Data Item I001/042 - Calculated Position in Cartesian Coordinates.
Definition: cat001.h:197
double rho
nm
Definition: cat001.h:169
Data Item I001/210 - Track Quality.
Definition: cat001.h:550
void ast_dataitem_001_210_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
void ast_dataitem_001_170_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
void ast_dataitem_001_141_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
void ast_dataitem_001_020_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
bool last_report
Definition: cat001.h:497
ast_dataitem_001_141_t ast_dataitem_001_141_decode(const ast_dataitem_t di)
Decode function.
bool military_emergency
Definition: cat001.h:107
ast_tracknum_t ast_datarecord_001_get_tracknum(const ast_datarecord_t dr)
Get track number function.
ast_dataitem_mode_c_code_t ast_dataitem_001_090_t
Data Item I001/090 - Mode-C in Binary Representation.
Definition: cat001.h:318
ast_radar_detection_type_t detection_type
Definition: cat001.h:101
bool valid
Definition: cat001.h:489
ast_dataitem_001_080_t dataitem_001_080
Definition: cat001.h:648
ast_dataitem_velocity_polar_t ast_dataitem_001_200_t
Data Item I001/200 - Calculated Track Velocity in Ploar Coordinates.
Definition: cat001.h:524
ast_dataitem_001_090_t dataitem_001_090
Definition: cat001.h:649
ast_dataitem_t ast_dataitem_001_020_encode(unsigned char *const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi)
Encode function.
ast_dataitem_001_210_t dataitem_001_210
Definition: cat001.h:657
Data Item - Mode-3/A Code Confidence Indicator.
Definition: cat_generic.h:524
double x
nm
Definition: cat001.h:204
bool tentative
Definition: cat001.h:491
bool spi
Definition: cat001.h:103
ast_dataitem_001_042_t ast_dataitem_001_042_decode(const ast_dataitem_t di)
Decode function.
ast_dataitem_001_210_t ast_dataitem_001_210_decode(const ast_dataitem_t di)
Decode function.
This file includes the common used data items shares by different categories.
Polar Coordinate.
Definition: type.h:129
Data Item I001/040 - Measured Position in Polar Coordinates.
Definition: cat001.h:162
bool valid
Definition: cat001.h:199
int quality2
Definition: cat001.h:555
Definition: type.h:66
ast_conventional_radar_target_type_t
Definition: cat001.h:72
ast_datablock_t ast_datablock_001_mixuap_decode(const unsigned char *const buffer, const size_t bufsize)
Decode CAT001 data block with data records using mixed track and plot UAP.
bool valid
Definition: cat001.h:369
ast_dataitem_001_200_t dataitem_001_200
Definition: cat001.h:656
bool ghost
Definition: cat001.h:496
ast_dataitem_001_040_t ast_dataitem_001_040_decode(const ast_dataitem_t di)
Decode function.
void ast_dataitem_001_020_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get Summary function.
Definition: cat001.h:74
ast_polar_coordinate_t ast_datarecord_001_get_polarcoord(const ast_datarecord_t dr)
Get polar coordinate function.
int raw_theta
Raw format as defined in doc, resolution 360/2^16 degree.
Definition: cat001.h:167
Data Item - Mode-C Code.
Definition: cat_generic.h:562
Definition: cat001.h:89
int rdp_chain
Definition: cat001.h:495
Data Item I001/020 - Target Report Descriptor.
Definition: cat001.h:95
double theta
degree
Definition: cat001.h:170
unsigned int msec
Definition: cat001.h:428
ast_conventional_radar_track_type_t
Definition: cat001.h:480
Squawk (aka Mode-3/A Code)
Definition: type.h:80
ast_dataitem_data_source_identifier_t ast_dataitem_001_010_t
Data Item I001/010 - Data Source Identifier.
Definition: cat001.h:47
Implementation of Dataitem concept defined by ASTERIX.
unsigned int raw_time
Definition: cat001.h:425
ast_dataitem_001_120_t dataitem_001_120
Definition: cat001.h:651
ast_dataitem_001_070_t dataitem_001_070
Definition: cat001.h:647
bool valid
Definition: cat001.h:423
int quality1
Definition: cat001.h:554
bool military_identification
Definition: cat001.h:108
Definition: cat001.h:80
ast_radar_detection_type_t
Definition: cat001.h:78
void ast_dataitem_001_141_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary funciton.
ast_dataitem_mode_c_confidence_t ast_dataitem_001_100_t
Data Item I001/100 - Mode-C Code and Code Confidence Indicator.
Definition: cat001.h:344
Data Item - Calculated Track Track Velocity in Polar Co-ordinates.
Definition: cat_generic.h:765
ast_squawk_t ast_datarecord_001_get_squawk(const ast_datarecord_t dr)
Get Mode-3/A code function.
Dataitem.
Definition: dataitem.h:422
int raw_x
Raw format as defined in doc, resolution 1/2^(6+f) nm.
Definition: cat001.h:201
ast_dataitem_001_020_t dataitem_001_020
Definition: cat001.h:642
Data Item - Mode-3/A Code in Octal Representation.
Definition: cat_generic.h:478
void ast_dataitem_001_170_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
Data Item - Mode-C Code and Code Confidence Indicator.
Definition: cat_generic.h:605
Definition: cat001.h:91
ast_dataitem_type_t
Definition of data item id in each category.
Definition: dataitem.h:67
ast_dataitem_001_060_t dataitem_001_060
Definition: cat001.h:646
Implementation of Datablock concept defined by ASTERIX.
ast_altitude_t ast_datarecord_001_get_flightlevel(const ast_datarecord_t dr)
Get flight level function.
unsigned int sec
Raw format as defined in doc, reset zero at mid night and every 512 seconds, resolution 1/128s.
Definition: cat001.h:427
ast_radar_emergency_type_t
Definition: cat001.h:86
ast_dataitem_001_020_t ast_dataitem_001_020_decode(const ast_dataitem_t di)
Decode function.
ast_msgtype_t ast_datarecord_001_get_msgtype(const ast_datarecord_t dr)
Get message type function.
ast_datarecord_t ast_datarecord_001_assemble(unsigned char *const buffer, const size_t bufsize, const ast_datarecord_001_t dr, const ast_uap_t uap)
Assemble function.
ast_dataitem_mode_3a_confidence_t ast_dataitem_001_080_t
Data Item I001/080 - Mode-3/A Code Confidence Indicator.
Definition: cat001.h:295
ast_dataitem_001_170_t ast_dataitem_001_170_decode(const ast_dataitem_t di)
Decode function.
bool simulated
Definition: cat001.h:100
Datarecord.
Definition: datarecord.h:40
ast_datarecord_001_t ast_datarecord_001_disassemble(const ast_datarecord_t dr)
Disassemble function.
Data Record I001 - Monoradar Target Reports.
Definition: cat001.h:637
ast_dataitem_001_042_t dataitem_001_042
Definition: cat001.h:645
ast_dataitem_001_030_t dataitem_001_030
Definition: cat001.h:643
ast_dataitem_track_number_t ast_dataitem_001_161_t
Data Item I001/161 - Track Plot Number.
Definition: cat001.h:455
void ast_dataitem_001_042_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
Data Item I001/060 - Mode-2 Code Confidence Indicator.
Definition: cat001.h:242
bool valid
Definition: cat001.h:137
ast_dataitem_t ast_dataitem_001_040_encode(unsigned char *const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi)
Encode function.
bool valid
Definition: cat001.h:552
void ast_dataitem_001_040_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
Data Item I001/141 - Truncated Time of Day.
Definition: cat001.h:421
void ast_dataitem_001_040_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
Data Item I001/030 - Warning/Error Conditions.
Definition: cat001.h:135
ast_dataitem_001_170_t dataitem_001_170
Definition: cat001.h:655
Data Item I001/170 - Track Status.
Definition: cat001.h:487
void ast_dataitem_001_042_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
Definition: cat001.h:82
ast_dataitem_t ast_dataitem_001_170_encode(unsigned char *const buffer, const size_t buf_size, const ast_dataitem_ex_t xdi)
Encode function.
bool fixed_transponder
Definition: cat001.h:104
ast_dataitem_001_161_t dataitem_001_161
Definition: cat001.h:654
Definition: cat001.h:482
Track Number.
Definition: type.h:73
Definition: cat001.h:81