datablock.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 
23 #ifndef LIBASTERIX_DATABLOCK_H
24 #define LIBASTERIX_DATABLOCK_H
25 
26 #include "category.h"
27 #include "uap.h"
28 #include "datarecord.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 
40 #define AST_MAX_DATARECORDS 64
41 
43 typedef struct _ast_datablock_t
44 {
45  const unsigned char* data;
46  size_t size;
47 
50 
51  const unsigned char* datarecords_data;
54  size_t n_datarecords;
55 
56  bool valid;
58 
60 typedef struct _ast_datablock_ex_t
61 {
64 
66  size_t n_datarecords;
68 
80 AST_API ast_datablock_t ast_datablock_decode(const unsigned char* const buffer, const size_t bufsize, const ast_uap_t uap);
81 
92 AST_API ast_datablock_t ast_datablock_smart_decode(const unsigned char* const buffer, const size_t bufsize);
93 
108 AST_API ast_datablock_t ast_datablock_encode(unsigned char* const buffer, const size_t bufsize, const ast_datablock_ex_t xdb);
109 
110 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);
111 
112 
115 #ifdef __cplusplus
116  }
117 #endif // extern "C"
118 
119 #endif //LIBASTERIX_DATABLOCK_H
120 
121 // vim:set ft=c.doxygen sw=2 sts=2 fenc=utf8:
Datablock.
Definition: datablock.h:43
ast_uap_t uap
UAP of data block.
Definition: datablock.h:63
Extracted datablock.
Definition: datablock.h:60
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:37
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:62
ast_category_t
Definition of category ID.
Definition: category.h:35
ast_category_t category
Size of data block.
Definition: datablock.h:48
size_t n_datarecords
Definition: datablock.h:54
Extracted datarecord.
Definition: datarecord.h:57
ast_uap_t uap
Category of data block.
Definition: datablock.h:49
size_t size
Address of data block.
Definition: datablock.h:46
Datarecord modifier.
Definition: datarecord.h:67
#define AST_MAX_DATARECORDS
Definition: datablock.h:40
size_t n_datarecords
Definition: datablock.h:66
bool valid
Definition: datablock.h:56
size_t datarecords_size
Address of data records.
Definition: datablock.h:52
const unsigned char * data
Definition: datablock.h:45
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:51
Datarecord.
Definition: datarecord.h:41