datablock.h
Go to the documentation of this file.
1 // vim:set ft=c sw=2 sts=2 fenc=utf8:
2 
3 /*
4  * libasterix
5  * Copyright [2013-2018] Aerosys Corporation (http://www.aerosys.cn/).
6  * All Rights Reserved.
7  *
8  * NOTICE: All information contained herein is, and remains
9  * the property of SinoATC and its suppliers, if any.
10  * The intellectual and technical concepts contained herein
11  * are proprietary to Aerosys Corporation and its suppliers and may be
12  * covered by U.S. and Foreign Patents, patents in process,
13  * and are protected by trade secret or copyright law.
14  * Dissemination of this information or reproduction of this material
15  * is strictly forbidden unless prior written permission is obtained
16  * from SinoATC.
17  */
18 
24 #ifndef LIBASTERIX_DATABLOCK_H
25 #define LIBASTERIX_DATABLOCK_H
26 
27 #include "category.h"
28 #include "uap.h"
29 #include "datarecord.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
41 #define AST_MAX_DATARECORDS 64
42 
44 typedef struct _ast_datablock_t
45 {
46  const unsigned char* data;
47  size_t size;
48 
51 
52  const unsigned char* datarecords_data;
55  size_t n_datarecords;
56 
57  bool valid;
59 
61 typedef struct _ast_datablock_ex_t
62 {
65 
67  size_t n_datarecords;
69 
81 AST_API ast_datablock_t ast_datablock_decode(const unsigned char* const buffer, const size_t bufsize, const ast_uap_t uap);
82 
93 AST_API ast_datablock_t ast_datablock_smart_decode(const unsigned char* const buffer, const size_t bufsize);
94 
109 AST_API ast_datablock_t ast_datablock_encode(unsigned char* const buffer, const size_t bufsize, const ast_datablock_ex_t xdb);
110 
111 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);
112 
113 
116 #ifdef __cplusplus
117  }
118 #endif // extern "C"
119 
120 #endif //LIBASTERIX_DATABLOCK_H
121 
Datablock.
Definition: datablock.h:44
ast_uap_t uap
UAP of data block.
Definition: datablock.h:64
Extracted datablock.
Definition: datablock.h:61
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:38
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:63
ast_category_t
Definition of category ID.
Definition: category.h:35
ast_category_t category
Size of data block.
Definition: datablock.h:49
size_t n_datarecords
Definition: datablock.h:55
Extracted datarecord.
Definition: datarecord.h:58
ast_uap_t uap
Category of data block.
Definition: datablock.h:50
size_t size
Address of data block.
Definition: datablock.h:47
Datarecord modifier.
Definition: datarecord.h:68
#define AST_MAX_DATARECORDS
Definition: datablock.h:41
size_t n_datarecords
Definition: datablock.h:67
bool valid
Definition: datablock.h:57
size_t datarecords_size
Address of data records.
Definition: datablock.h:53
const unsigned char * data
Definition: datablock.h:46
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:52
Datarecord.
Definition: datarecord.h:42