cat240.h
Go to the documentation of this file.
1 /*
2  * libasterix
3  * Copyright [2013-2020] 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_CAT240_H
25 #define LIBASTERIX_CAT240_H
26 
27 #include "dataitem.h"
28 #include "datarecord.h"
29 #include "cat_generic.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 // Data Record functions
36 
39 
42 
45 
47 #define ast_datarecord_240_get_tracknum 0
48 
50 #define ast_datarecord_240_get_squawk 0
51 
53 #define ast_datarecord_240_get_callsign 0
54 
56 #define ast_datarecord_240_get_icaoaddr 0
57 
59 #define ast_datarecord_240_get_coordinate 0
60 
62 #define ast_datarecord_240_get_flightlevel 0
63 
65 #define ast_datarecord_240_get_polarcoord 0
66 
68 #define ast_datarecord_240_get_heading 0
69 
71 #define ast_datarecord_240_get_speed 0
72 
73 
74 //CAT240 special functions
75 
77 typedef enum _ast_video_resolution_type_t
78 {
87 
90 
92 typedef struct _ast_videocell_t
93 {
94  unsigned int number;
95  double range;
96  unsigned int amplitude;
98 
100 #define AST_MAX_VIDEO_CELLS 1024
101 
103 typedef struct _ast_videocells_t
104 {
105  bool valid;
106 
108 
110  size_t n_videocells;
112 
113 
115 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);
116 
118 void ast_videocells_get_detail_html(char* detail, const size_t detail_size, const ast_videocells_t vc);
119 
120 // Data Item functions
121 
124 
130 typedef enum _ast_video_message_type_t
132 {
136 
139 
141 #define ast_dataitem_240_000_get_size ast_dataitem_message_type_get_size
142 
144 #define ast_dataitem_240_000_decode ast_dataitem_message_type_decode
145 
147 #define ast_dataitem_240_000_encode ast_dataitem_message_type_encode
148 
150 AST_API void ast_dataitem_240_000_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
151 
153 #define ast_dataitem_240_000_get_detail_html ast_dataitem_get_detail_html_dummy
154 
165 
167 #define ast_dataitem_240_010_get_size ast_dataitem_data_source_identifier_get_size
168 
170 #define ast_dataitem_240_010_decode ast_dataitem_data_source_identifier_decode
171 
173 #define ast_dataitem_240_010_encode ast_dataitem_data_source_identifier_encode
174 
176 #define ast_dataitem_240_010_get_summary ast_dataitem_data_source_identifier_get_summary
177 
179 #define ast_dataitem_240_010_get_detail_html ast_dataitem_data_source_identifier_get_detail_html
180 
189 typedef struct _ast_dataitem_240_020_t
191 {
192  bool valid;
193 
194  unsigned int msg_index;
196 
198 #define ast_dataitem_240_020_get_size ast_dataitem_get_size_fixed_4_byte
199 
202 
204 
206 AST_API void ast_dataitem_240_020_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
207 
209 //AST_API void ast_dataitem_240_020_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
210 #define ast_dataitem_240_020_get_detail_html ast_dataitem_get_detail_html_dummy
211 
220 #define AST_VIDEO_SUMMARY_MAX_CHARS 257
222 
224 typedef struct _ast_dataitem_240_030_t
225 {
226  bool valid;
227 
228  unsigned int num_chars;
231 
233 #define ast_dataitem_240_030_get_size ast_dataitem_get_size_rep_1_byte
234 
237 
239 
241 AST_API void ast_dataitem_240_030_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
242 
244 AST_API void ast_dataitem_240_030_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
245 
256 
258 #define ast_dataitem_240_040_get_size ast_dataitem_video_header_get_size
259 
262 
264 AST_API void ast_dataitem_240_040_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
265 
267 AST_API void ast_dataitem_240_040_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
268 
279 
281 #define ast_dataitem_240_041_get_size ast_dataitem_video_header_get_size
282 
285 
287 AST_API void ast_dataitem_240_041_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
288 
290 AST_API void ast_dataitem_240_041_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
291 
300 typedef struct _ast_dataitem_240_048_t
302 {
303  bool valid;
304 
308 
310 #define ast_dataitem_240_048_get_size ast_dataitem_get_size_fixed_2_byte
311 
314 
316 AST_API void ast_dataitem_240_048_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
317 
319 AST_API void ast_dataitem_240_048_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
320 
329 typedef struct _ast_dataitem_240_049_t
331 {
332  bool valid;
333 
334  unsigned int num_valid_octets;
335  unsigned int num_valid_cells;
337 
339 #define ast_dataitem_240_049_get_size ast_dataitem_get_size_fixed_5_byte
340 
343 
345 AST_API void ast_dataitem_240_049_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
346 
348 AST_API void ast_dataitem_240_049_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
349 
358 typedef struct _ast_dataitem_240_050_t
360 {
361  bool valid;
362 
363  size_t video_size;
364  unsigned char video[4 * 256];
366 
368 #define ast_dataitem_240_050_get_size ast_dataitem_get_size_rep_4_byte
369 
372 
374 AST_API void ast_dataitem_240_050_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
375 
377 AST_API void ast_dataitem_240_050_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
378 
387 typedef struct _ast_dataitem_240_051_t
389 {
390  bool valid;
391 
392  unsigned int video_size;
393  char video[64 * 256];
395 
397 #define ast_dataitem_240_051_get_size ast_dataitem_get_size_rep_64_byte
398 
401 
403 AST_API void ast_dataitem_240_051_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
404 
406 AST_API void ast_dataitem_240_051_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
407 
416 typedef struct _ast_dataitem_240_052_t
418 {
419  bool valid;
420 
421  unsigned int video_size;
422  char video[254 * 256];
424 
426 #define ast_dataitem_240_052_get_size ast_dataitem_get_size_rep_256_byte
427 
430 
432 AST_API void ast_dataitem_240_052_get_summary(char* summary, const size_t summary_size, const ast_dataitem_t di);
433 
435 AST_API void ast_dataitem_240_052_get_detail_html(char* detail, const size_t detail_size, const ast_dataitem_t di);
436 
447 
449 #define ast_dataitem_240_140_get_size ast_dataitem_time_of_day_get_size
450 
452 #define ast_dataitem_240_140_decode ast_dataitem_time_of_day_decode
453 
455 #define ast_dataitem_240_140_encode ast_dataitem_time_of_day_encode
456 
458 #define ast_dataitem_240_140_get_summary ast_dataitem_time_of_day_get_summary
459 
461 #define ast_dataitem_240_140_get_detail_html ast_dataitem_time_of_day_get_detail_html
462 
471 #define ast_dataitem_240_REF_get_size ast_dataitem_reserved_expansion_field_get_size
473 
475 //ast_dataitem_240_REF_t ast_dataitem_240_REF_decode(const ast_dataitem_t di);
476 
478 #define ast_dataitem_240_REF_get_summary ast_dataitem_reserved_expansion_field_get_summary
479 
481 #define ast_dataitem_240_REF_get_detail_html ast_dataitem_reserved_expansion_field_get_detail_html
482 
492 #define ast_dataitem_240_SPF_get_size ast_dataitem_special_purpose_field_get_size
494 
496 //ast_dataitem_240_SPF_t ast_dataitem_240_SPF_decode(const ast_dataitem_t di);
497 
499 #define ast_dataitem_240_SPF_get_summary ast_dataitem_special_purpose_field_get_summary
500 
502 #define ast_dataitem_240_SPF_get_detail_html ast_dataitem_special_purpose_field_get_detail_html
503 
506 #ifdef __cplusplus
507  }
508 #endif // extern "C"
509 
510 #endif //LIBASTERIX_CAT240_H
511 
512 // vim:set ft=c sw=2 sts=2 fenc=utf8:
bool valid
Definition: cat240.h:332
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:77
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:79
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:94
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:194
#define AST_API
Definition: platform.h:63
Data Item - Data Source Identifier.
Definition: cat_generic.h:93
Definition: cat240.h:84
ast_dataitem_240_051_t ast_dataitem_240_051_decode(const ast_dataitem_t di)
Decode function.
bool valid
Definition: cat240.h:390
bool valid
Definition: cat240.h:419
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:131
Video cells.
Definition: cat240.h:103
bool compression
Definition: cat240.h:305
Definition: cat240.h:133
Data Item - Time of Day.
Definition: cat_generic.h:219
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:278
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:303
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:335
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:359
Definition: cat240.h:83
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:134
unsigned int video_size
Definition: cat240.h:392
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:95
unsigned int amplitude
Range in meters.
Definition: cat240.h:96
Data Item I240/030 - Video Summary.
Definition: cat240.h:224
ast_dataitem_240_020_t ast_dataitem_240_020_decode(const ast_dataitem_t di)
Decode function.
bool valid
Definition: cat240.h:105
ast_dataitem_video_header_t ast_dataitem_240_040_t
Data Item I240/040 - Video Header Femto.
Definition: cat240.h:255
ast_dataitem_message_type_t ast_dataitem_240_000_t
Data Item I240/000 - Message Type.
Definition: cat240.h:138
ast_video_resolution_type_t resolution
Definition: cat240.h:306
bool valid
Definition: cat240.h:226
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:421
Definition: cat240.h:81
ast_video_resolution_type_t resolution
Definition: cat240.h:107
size_t video_size
Definition: cat240.h:363
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:417
Data Item I240/048 - Video Cells Resolution & Data Compression Indicator.
Definition: cat240.h:301
Definition: cat240.h:80
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:190
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:388
Dataitem.
Definition: dataitem.h:422
ast_dataitem_time_of_day_t ast_dataitem_240_140_t
Data Item I240/140 - Time of Day.
Definition: cat240.h:446
ast_dataitem_data_source_identifier_t ast_dataitem_240_010_t
Data Item I240/010 - Data Source Identifier.
Definition: cat240.h:164
unsigned int num_valid_octets
Definition: cat240.h:334
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:67
Data Item - Video Header.
Definition: cat_generic.h:1001
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:82
ast_dataitem_240_048_t ast_dataitem_240_048_decode(const ast_dataitem_t di)
Decode function.
size_t n_videocells
Definition: cat240.h:110
bool valid
Definition: cat240.h:361
bool valid
Definition: cat240.h:192
#define AST_VIDEO_SUMMARY_MAX_CHARS
Max number of chars in video summary.
Definition: cat240.h:221
Datarecord.
Definition: datarecord.h:40
unsigned int num_chars
Definition: cat240.h:228
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:100
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:85
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:330
Video cell.
Definition: cat240.h:92