cat240.h
Go to the documentation of this file.
1 /*
2  * libasterix
3  * Copyright [2020] SinoATC (http://www.sinoatc.com/).
4  * Copyright [2013-2020] Aerosys Corporation (http://www.aerosys.cn/).
5  * All Rights Reserved.
6  *
7  * NOTICE: All information contained herein is, and remains
8  * the property of SinoATC and its suppliers, if any.
9  * The intellectual and technical concepts contained herein
10  * are proprietary to Aerosys Corporation and its suppliers and may be
11  * covered by U.S. and Foreign Patents, patents in process,
12  * and are protected by trade secret or copyright law.
13  * Dissemination of this information or reproduction of this material
14  * is strictly forbidden unless prior written permission is obtained
15  * from SinoATC.
16  */
17 
25 #ifndef LIBASTERIX_CAT240_H
26 #define LIBASTERIX_CAT240_H
27 
28 #include "dataitem.h"
29 #include "datarecord.h"
30 #include "cat_generic.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 // Data Record functions
37 
40 
43 
46 
48 #define ast_datarecord_240_get_tracknum 0
49 
51 #define ast_datarecord_240_get_squawk 0
52 
54 #define ast_datarecord_240_get_callsign 0
55 
57 #define ast_datarecord_240_get_icaoaddr 0
58 
60 #define ast_datarecord_240_get_coordinate 0
61 
63 #define ast_datarecord_240_get_flightlevel 0
64 
66 #define ast_datarecord_240_get_polarcoord 0
67 
69 #define ast_datarecord_240_get_heading 0
70 
72 #define ast_datarecord_240_get_speed 0
73 
74 
75 //CAT240 special functions
76 
78 typedef enum _ast_video_resolution_type_t
79 {
88 
91 
93 typedef struct _ast_videocell_t
94 {
95  unsigned int number;
96  double range;
97  unsigned int amplitude;
99 
101 #define AST_MAX_VIDEO_CELLS 1024
102 
104 typedef struct _ast_videocells_t
105 {
106  bool valid;
107 
109 
111  size_t n_videocells;
113 
114 
116 ast_videocells_t ast_videocell_decode(const unsigned char* video, const size_t video_size, const ast_video_resolution_type_t resolution, const unsigned int start_range, double cell_duration);
117 
119 void ast_videocells_get_detail_html(char* detail, const size_t detail_size, const ast_videocells_t vc);
120 
121 // Data Item functions
122 
125 
131 typedef enum _ast_video_message_type_t
133 {
137 
140 
142 #define ast_dataitem_240_000_get_size ast_dataitem_message_type_get_size
143 
145 #define ast_dataitem_240_000_decode ast_dataitem_message_type_decode
146 
148 #define ast_dataitem_240_000_encode ast_dataitem_message_type_encode
149 
151 AST_API void ast_dataitem_240_000_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
152 
154 #define ast_dataitem_240_000_get_detail_html ast_dataitem_get_detail_html_dummy
155 
166 
168 #define ast_dataitem_240_010_get_size ast_dataitem_data_source_identifier_get_size
169 
171 #define ast_dataitem_240_010_decode ast_dataitem_data_source_identifier_decode
172 
174 #define ast_dataitem_240_010_encode ast_dataitem_data_source_identifier_encode
175 
177 #define ast_dataitem_240_010_get_summary ast_dataitem_data_source_identifier_get_summary
178 
180 #define ast_dataitem_240_010_get_detail_html ast_dataitem_data_source_identifier_get_detail_html
181 
190 typedef struct _ast_dataitem_240_020_t
192 {
193  bool valid;
194 
195  unsigned int msg_index;
197 
199 #define ast_dataitem_240_020_get_size ast_dataitem_get_size_fixed_4_byte
200 
203 
205 
207 AST_API void ast_dataitem_240_020_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
208 
210 //AST_API void ast_dataitem_240_020_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
211 #define ast_dataitem_240_020_get_detail_html ast_dataitem_get_detail_html_dummy
212 
221 #define AST_VIDEO_SUMMARY_MAX_CHARS 257
223 
225 typedef struct _ast_dataitem_240_030_t
226 {
227  bool valid;
228 
229  unsigned int num_chars;
232 
234 #define ast_dataitem_240_030_get_size ast_dataitem_get_size_rep_1_byte
235 
238 
240 
242 AST_API void ast_dataitem_240_030_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
243 
245 AST_API void ast_dataitem_240_030_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
246 
257 
259 #define ast_dataitem_240_040_get_size ast_dataitem_video_header_get_size
260 
263 
265 AST_API void ast_dataitem_240_040_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
266 
268 AST_API void ast_dataitem_240_040_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
269 
280 
282 #define ast_dataitem_240_041_get_size ast_dataitem_video_header_get_size
283 
286 
288 AST_API void ast_dataitem_240_041_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
289 
291 AST_API void ast_dataitem_240_041_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
292 
301 typedef struct _ast_dataitem_240_048_t
303 {
304  bool valid;
305 
309 
311 #define ast_dataitem_240_048_get_size ast_dataitem_get_size_fixed_2_byte
312 
315 
317 AST_API void ast_dataitem_240_048_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
318 
320 AST_API void ast_dataitem_240_048_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
321 
330 typedef struct _ast_dataitem_240_049_t
332 {
333  bool valid;
334 
335  unsigned int num_valid_octets;
336  unsigned int num_valid_cells;
338 
340 #define ast_dataitem_240_049_get_size ast_dataitem_get_size_fixed_5_byte
341 
344 
346 AST_API void ast_dataitem_240_049_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
347 
349 AST_API void ast_dataitem_240_049_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
350 
359 typedef struct _ast_dataitem_240_050_t
361 {
362  bool valid;
363 
364  size_t video_size;
365  unsigned char video[4 * 256];
367 
369 #define ast_dataitem_240_050_get_size ast_dataitem_get_size_rep_4_byte
370 
373 
375 AST_API void ast_dataitem_240_050_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
376 
378 AST_API void ast_dataitem_240_050_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
379 
388 typedef struct _ast_dataitem_240_051_t
390 {
391  bool valid;
392 
393  unsigned int video_size;
394  char video[64 * 256];
396 
398 #define ast_dataitem_240_051_get_size ast_dataitem_get_size_rep_64_byte
399 
402 
404 AST_API void ast_dataitem_240_051_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
405 
407 AST_API void ast_dataitem_240_051_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
408 
417 typedef struct _ast_dataitem_240_052_t
419 {
420  bool valid;
421 
422  unsigned int video_size;
423  char video[254 * 256];
425 
427 #define ast_dataitem_240_052_get_size ast_dataitem_get_size_rep_256_byte
428 
431 
433 AST_API void ast_dataitem_240_052_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
434 
436 AST_API void ast_dataitem_240_052_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
437 
448 
450 #define ast_dataitem_240_140_get_size ast_dataitem_time_of_day_get_size
451 
453 #define ast_dataitem_240_140_decode ast_dataitem_time_of_day_decode
454 
456 #define ast_dataitem_240_140_encode ast_dataitem_time_of_day_encode
457 
459 #define ast_dataitem_240_140_get_summary ast_dataitem_time_of_day_get_summary
460 
462 #define ast_dataitem_240_140_get_detail_html ast_dataitem_time_of_day_get_detail_html
463 
472 #define ast_dataitem_240_REF_get_size ast_dataitem_reserved_expansion_field_get_size
474 
476 //ast_dataitem_240_REF_t ast_dataitem_240_REF_decode(const ast_dataitem_t di);
477 
479 #define ast_dataitem_240_REF_get_summary ast_dataitem_reserved_expansion_field_get_summary
480 
482 #define ast_dataitem_240_REF_get_detail_html ast_dataitem_reserved_expansion_field_get_detail_html
483 
493 #define ast_dataitem_240_SPF_get_size ast_dataitem_special_purpose_field_get_size
495 
497 //ast_dataitem_240_SPF_t ast_dataitem_240_SPF_decode(const ast_dataitem_t di);
498 
500 #define ast_dataitem_240_SPF_get_summary ast_dataitem_special_purpose_field_get_summary
501 
503 #define ast_dataitem_240_SPF_get_detail_html ast_dataitem_special_purpose_field_get_detail_html
504 
507 #ifdef __cplusplus
508  }
509 #endif // extern "C"
510 
511 #endif //LIBASTERIX_CAT240_H
512 
513 // vim:set ft=c sw=2 sts=2 fenc=utf8:
bool valid
Definition: cat240.h:333
void ast_dataitem_240_020_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Encode function.
Data Item - Message Type.
Definition: cat_generic.h:51
void ast_dataitem_240_049_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
const char * ast_dataitem_240_get_name(const ast_dataitem_type_t type)
Get name function.
ast_video_resolution_type_t
Video Resolution Type.
Definition: cat240.h:78
ast_dataitem_240_049_t ast_dataitem_240_049_decode(const ast_dataitem_t di)
Decode function.
void ast_dataitem_240_052_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
Definition: cat240.h:80
void ast_dataitem_240_051_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
Implementation of Datarecord concept defined by ASTERIX.
Data Source Identifier (aka SAC/SIC)
Definition: type.h:35
ast_timeofday_t ast_datarecord_240_get_timeofday(const ast_datarecord_t dr)
Get time of day function.
unsigned int number
Definition: cat240.h:95
void ast_dataitem_240_041_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
unsigned int msg_index
Definition: cat240.h:195
#define AST_API
Definition: platform.h:63
Data Item - Data Source Identifier.
Definition: cat_generic.h:93
Definition: cat240.h:85
ast_dataitem_240_051_t ast_dataitem_240_051_decode(const ast_dataitem_t di)
Decode function.
bool valid
Definition: cat240.h:391
bool valid
Definition: cat240.h:420
void ast_dataitem_240_030_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
ast_dataitem_video_header_t ast_dataitem_240_040_decode(const ast_dataitem_t di)
Decode function.
ast_video_message_type_t
Video message type.
Definition: cat240.h:132
Video cells.
Definition: cat240.h:104
bool compression
Definition: cat240.h:306
Definition: cat240.h:134
Data Item - Time of Day.
Definition: cat_generic.h:216
void ast_dataitem_240_000_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
ast_dataitem_video_header_t ast_dataitem_240_041_t
Data Item I240/041 - Video Header Femto.
Definition: cat240.h:279
void ast_dataitem_240_040_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
bool valid
Definition: cat240.h:304
void ast_videocells_get_detail_html(char *detail, const size_t detail_size, const ast_videocells_t vc)
Get detail function.
This file includes the common used data items shares by different categories.
unsigned int num_valid_cells
Definition: cat240.h:336
ast_dataitem_240_030_t ast_dataitem_240_030_decode(const ast_dataitem_t di)
Decode function.
Data Item I240/050 - Video Block Low Data Volume.
Definition: cat240.h:360
Definition: cat240.h:84
Definition: type.h:66
void ast_dataitem_240_051_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
Definition: cat240.h:135
unsigned int video_size
Definition: cat240.h:393
void ast_dataitem_240_049_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
void ast_dataitem_240_048_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
double range
Number of cells in its vector, 0 is the radar antena.
Definition: cat240.h:96
unsigned int amplitude
Range in meters.
Definition: cat240.h:97
Data Item I240/030 - Video Summary.
Definition: cat240.h:225
ast_dataitem_240_020_t ast_dataitem_240_020_decode(const ast_dataitem_t di)
Decode function.
bool valid
Definition: cat240.h:106
ast_dataitem_video_header_t ast_dataitem_240_040_t
Data Item I240/040 - Video Header Femto.
Definition: cat240.h:256
ast_dataitem_message_type_t ast_dataitem_240_000_t
Data Item I240/000 - Message Type.
Definition: cat240.h:139
ast_video_resolution_type_t resolution
Definition: cat240.h:307
bool valid
Definition: cat240.h:227
ast_msgtype_t ast_datarecord_240_get_msgtype(const ast_datarecord_t dr)
Get message type function.
void ast_dataitem_240_050_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
unsigned int video_size
Definition: cat240.h:422
Definition: cat240.h:82
ast_video_resolution_type_t resolution
Definition: cat240.h:108
size_t video_size
Definition: cat240.h:364
Implementation of Dataitem concept defined by ASTERIX.
ast_dataitem_240_050_t ast_dataitem_240_050_decode(const ast_dataitem_t di)
Decode function.
Data Item I240/052 - Video Block High Data Volume.
Definition: cat240.h:418
Data Item I240/048 - Video Cells Resolution & Data Compression Indicator.
Definition: cat240.h:302
Definition: cat240.h:81
void ast_dataitem_240_052_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
Data Item I240/020 - Video Record Header.
Definition: cat240.h:191
void ast_dataitem_240_030_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Encode function.
ast_sacsic_t ast_datarecord_240_get_sacsic(const ast_datarecord_t dr)
Get SAC/SIC function.
Data Item I240/051 - Video Block Medium Data Volume.
Definition: cat240.h:389
Dataitem.
Definition: dataitem.h:419
ast_dataitem_time_of_day_t ast_dataitem_240_140_t
Data Item I240/140 - Time of Day.
Definition: cat240.h:447
ast_dataitem_data_source_identifier_t ast_dataitem_240_010_t
Data Item I240/010 - Data Source Identifier.
Definition: cat240.h:165
unsigned int num_valid_octets
Definition: cat240.h:335
ast_videocells_t ast_videocell_decode(const unsigned char *video, const size_t video_size, const ast_video_resolution_type_t resolution, const unsigned int start_range, double cell_duration)
Decode function.
ast_dataitem_type_t
Definition of data item id in each category.
Definition: dataitem.h:66
Data Item - Video Header.
Definition: cat_generic.h:992
void ast_dataitem_240_050_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
void ast_dataitem_240_040_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
Time of day.
Definition: type.h:43
void ast_dataitem_240_048_get_summary(char *summary, const size_t summary_size, const ast_dataitem_t di)
Get summary function.
Definition: cat240.h:83
ast_dataitem_240_048_t ast_dataitem_240_048_decode(const ast_dataitem_t di)
Decode function.
size_t n_videocells
Definition: cat240.h:111
bool valid
Definition: cat240.h:362
bool valid
Definition: cat240.h:193
#define AST_VIDEO_SUMMARY_MAX_CHARS
Max number of chars in video summary.
Definition: cat240.h:222
Datarecord.
Definition: datarecord.h:42
unsigned int num_chars
Definition: cat240.h:229
unsigned int ast_video_resolution_get_bits(const ast_video_resolution_type_t t)
Get video resolution bits.
#define AST_MAX_VIDEO_CELLS
Max number of non-empty video cells.
Definition: cat240.h:101
void ast_dataitem_240_041_get_detail_html(char *detail, const size_t detail_size, const ast_dataitem_t di)
Get detail function.
Definition: cat240.h:86
ast_dataitem_240_052_t ast_dataitem_240_052_decode(const ast_dataitem_t di)
Decode function.
ast_dataitem_video_header_t ast_dataitem_240_041_decode(const ast_dataitem_t di)
Decode function.
Data Item I240/049 - Video Octets & Video Cells Counters.
Definition: cat240.h:331
Video cell.
Definition: cat240.h:93