datablock.h
Go to the documentation of this file.
1/*
2 * $COPYRIGHT-BEGIN$
3 * libasterix
4 * Copyright [2013-2026] SinoATC <http://www.sinoatc.com>.
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 SinoATC 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 * $COPYRIGHT-END$
17 */
18
27
28#ifndef LIBASTERIX_DATABLOCK_H
29#define LIBASTERIX_DATABLOCK_H
30
31#include "category.h"
32#include "uap.h"
33#include "datarecord.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39
53
55#define AST_MAX_DATARECORDS 64
56
58typedef struct _ast_datablock_t
59{
60 const unsigned char* data;
61 size_t size;
62
65
66 const unsigned char* datarecords_data;
70
71 bool valid;
73
83
95AST_API ast_datablock_t ast_datablock_decode(const unsigned char* const buffer, const size_t bufsize, const ast_uap_t uap);
96
107AST_API ast_datablock_t ast_datablock_smart_decode(const unsigned char* const buffer, const size_t bufsize);
108
122
123AST_API ast_datablock_t ast_datablock_encode(unsigned char* const buffer, const size_t bufsize, const ast_datablock_ex_t xdb);
124
141AST_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);
142
143 /* end of group db_datablock */
145
146#ifdef __cplusplus
147 }
148#endif // extern "C"
149
150#endif //LIBASTERIX_DATABLOCK_H
151
152// vim:set ft=c.doxygen sw=2 sts=2 fenc=utf8:
This file includes the common used data items shares by different categories.
ast_category_t
Definition of category ID.
Definition category.h:38
ASTERIX data record.
ast_datablock_t ast_datablock_smart_decode(const unsigned char *const buffer, const size_t bufsize)
Datablock smart decode function.
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)
Datablock modify function.
ast_datablock_t ast_datablock_encode(unsigned char *const buffer, const size_t bufsize, const ast_datablock_ex_t xdb)
Datablock encode function.
#define AST_MAX_DATARECORDS
Maximum number of data records in a data block.
Definition datablock.h:55
ast_datablock_t ast_datablock_decode(const unsigned char *const buffer, const size_t bufsize, const ast_uap_t uap)
Datablock decode function.
#define AST_API
Definition platform.h:63
Extracted datablock.
Definition datablock.h:76
ast_datarecord_ex_t datarecords[64]
Data records.
Definition datablock.h:80
ast_uap_t uap
UAP of data block.
Definition datablock.h:78
ast_category_t category
Category of data block.
Definition datablock.h:77
size_t n_datarecords
Number of data records.
Definition datablock.h:81
Datablock.
Definition datablock.h:59
const unsigned char * data
Address of data block.
Definition datablock.h:60
ast_category_t category
Category of data block.
Definition datablock.h:63
size_t n_datarecords
Number of data records.
Definition datablock.h:69
size_t datarecords_size
Size of data records.
Definition datablock.h:67
ast_datarecord_t datarecords[64]
Data records.
Definition datablock.h:68
size_t size
Size of data block.
Definition datablock.h:61
ast_uap_t uap
UAP of data block.
Definition datablock.h:64
bool valid
True, if data block is correctly decoded.
Definition datablock.h:71
const unsigned char * datarecords_data
Address of data records.
Definition datablock.h:66
Extracted datarecord.
Definition datarecord.h:77
Datarecord modifier.
Definition datarecord.h:87
Datarecord.
Definition datarecord.h:61
Definition uap.h:42
ASTERIX User Application Profile (UAP).