datablock.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 
22 #ifndef LIBASTERIX_DATABLOCK_H
23 #define LIBASTERIX_DATABLOCK_H
24 
25 #include "category.h"
26 #include "uap.h"
27 #include "datarecord.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
39 #define AST_MAX_DATARECORDS 64
40 
42 typedef struct _ast_datablock_t
43 {
44  const unsigned char* data;
45  size_t size;
46 
49 
50  const unsigned char* datarecords_data;
53  size_t n_datarecords;
54 
55  bool valid;
57 
59 typedef struct _ast_datablock_ex_t
60 {
63 
65  size_t n_datarecords;
67 
79 AST_API ast_datablock_t ast_datablock_decode(const unsigned char* const buffer, const size_t bufsize, const ast_uap_t uap);
80 
91 AST_API ast_datablock_t ast_datablock_smart_decode(const unsigned char* const buffer, const size_t bufsize);
92 
107 AST_API ast_datablock_t ast_datablock_encode(unsigned char* const buffer, const size_t bufsize, const ast_datablock_ex_t xdb);
108 
109 AST_API ast_datablock_t ast_datablock_modify(unsigned char* const buffer, const size_t bufsize, const ast_datablock_t src, const ast_datarecord_modifier_t mod);
110 
111 
114 #ifdef __cplusplus
115  }
116 #endif // extern "C"
117 
118 #endif //LIBASTERIX_DATABLOCK_H
119 
120 // vim:set ft=c.doxygen sw=2 sts=2 fenc=utf8:
Datablock.
Definition: datablock.h:42
ast_uap_t uap
UAP of data block.
Definition: datablock.h:62
Extracted datablock.
Definition: datablock.h:59
ast_datablock_t ast_datablock_encode(unsigned char *const buffer, const size_t bufsize, const ast_datablock_ex_t xdb)
Datablock encode function.
Implementation of Datarecord concept defined by ASTERIX.
Definition: uap.h:36
ast_datablock_t ast_datablock_decode(const unsigned char *const buffer, const size_t bufsize, const ast_uap_t uap)
Datablock decode function.
This file includes the common used data items shares by different categories.
#define AST_API
Definition: platform.h:63
Implementation of UAP concept defined by ASTERIX.
ast_datablock_t ast_datablock_modify(unsigned char *const buffer, const size_t bufsize, const ast_datablock_t src, const ast_datarecord_modifier_t mod)
ast_category_t category
Category of data block.
Definition: datablock.h:61
ast_category_t
Definition of category ID.
Definition: category.h:35
ast_category_t category
Size of data block.
Definition: datablock.h:47
size_t n_datarecords
Definition: datablock.h:53
Extracted datarecord.
Definition: datarecord.h:56
ast_uap_t uap
Category of data block.
Definition: datablock.h:48
size_t size
Address of data block.
Definition: datablock.h:45
Datarecord modifier.
Definition: datarecord.h:66
#define AST_MAX_DATARECORDS
Definition: datablock.h:39
size_t n_datarecords
Definition: datablock.h:65
bool valid
Definition: datablock.h:55
size_t datarecords_size
Address of data records.
Definition: datablock.h:51
const unsigned char * data
Definition: datablock.h:44
ast_datablock_t ast_datablock_smart_decode(const unsigned char *const buffer, const size_t bufsize)
Datablock smart decode function.
const unsigned char * datarecords_data
UAP of data block.
Definition: datablock.h:50
Datarecord.
Definition: datarecord.h:40