ASTERIX data block processing.
More...
ASTERIX data block processing.
- Description:
- A data block is the unit of exchange in ASTERIX. It consists of a one-octet data Category, a two-octet length field, and one or more data records composed according to the User Application Profile (UAP) of the Category.
◆ AST_MAX_DATARECORDS
| #define AST_MAX_DATARECORDS 64 |
Maximum number of data records in a data block.
◆ ast_datablock_decode()
Datablock decode function.
- Parameters
-
| buffer | Buffer to read datablock data |
| bufsize | Buffer size |
| uap | User application profile (UAP) used to decode data |
This function will read and check data against specified uap, and return decoded datablock. If data can be successfully decoded, the returned datablock will be marked as "valid". If any error occurs, the returned datablock will be marked as "invalid".
- Examples
- example.c.
◆ ast_datablock_encode()
Datablock encode function.
- Parameters
-
| buffer | Buffer to write encoded datablock data |
| bufsize | Buffer size |
| xdb | Extracted datablock container |
- Returns
- Encoded datablock
This function will check datarecords contained in xdb, encode them and write encoded data to buffer. If all datarecords are successfully encoded, the returned datablock will be marked as "valid". If any error occurs, the returned datablock will be marked as "invalid".
- Examples
- example.c.
◆ ast_datablock_modify()
Datablock modify function.
- Parameters
-
| buffer | Buffer to write modified datablock data |
| bufsize | Buffer size |
| src | Source datablock to be modified |
| mod | Data record modifier applied to every data record |
- Returns
- Modified datablock
This function applies the data record modifier to every data record of the source datablock and writes the modified data to buffer. If all datarecords are successfully modified, the returned datablock will be marked as "valid". If any error occurs, the returned datablock will be marked as "invalid".
- Examples
- example.c.
◆ ast_datablock_smart_decode()
| ast_datablock_t ast_datablock_smart_decode |
( |
const unsigned char *const | buffer, |
|
|
const size_t | bufsize ) |
Datablock smart decode function.
- Parameters
-
| buffer | Buffer to read datablock data |
| bufsize | Buffer size |
This function will read and decode data by using a automatically selected UAP, and return decoded datablock. If data can be successfully decoded, the returned datablock will be marked as "valid". If any error occurs, the returned datablock will be marked as "invalid".