ASTERIX Field Specification (FSPEC) processing.
More...
ASTERIX Field Specification (FSPEC) processing.
- Description:
- The Field Specification (FSPEC) prefixes a data record and indicates, by one bit per Field Reference Number (FRN), which data items of the UAP are present in the record. The last bit of each FSPEC octet (FX) extends the FSPEC to a following octet.
◆ ast_fspec_copy()
FSPEC copy function.
- Parameters
-
| buffer | Buffer to write destination FSPEC data |
| bufsize | Buffer size |
| src | Original FSPEC, must be valid |
- Returns
- Copied FSPEC
This function copies the original FSPEC to the specified buffer. If the FSPEC has been successfully copied, the returned FSPEC will be marked as "valid". If any error occurs, the returned FSPEC will be marked as "invalid".
◆ ast_fspec_decode()
| ast_fspec_t ast_fspec_decode |
( |
const unsigned char *const | buffer, |
|
|
const size_t | bufsize ) |
FSPEC decode function.
- Parameters
-
| buffer | Buffer to read FSPEC data |
| bufsize | Buffer size |
- Returns
- Decoded FSPEC
This function reads the FSPEC octets (FX extension included) from buffer and counts the data items present. If the FSPEC can be successfully decoded, the returned FSPEC will be marked as "valid". If any error occurs, the returned FSPEC will be marked as "invalid".
◆ ast_fspec_is_set()
| bool ast_fspec_is_set |
( |
const ast_fspec_t * | fspec, |
|
|
const unsigned int | frn ) |
Test whether a data item is present.
- Parameters
-
| fspec | FSPEC to check |
| frn | Field Reference Number (FRN) of the data item |
- Returns
- true, if the data item with the given FRN is present
◆ ast_fspec_set()
| bool ast_fspec_set |
( |
unsigned char *const | buffer, |
|
|
const size_t | bufsize, |
|
|
const unsigned int | frn, |
|
|
const bool | set ) |
Set or clear the presence bit of a data item.
- Parameters
-
| buffer | Buffer holding the FSPEC data to modify |
| bufsize | Buffer size |
| frn | Field Reference Number (FRN) of the data item |
| set | true to set the bit, false to clear it |
- Returns
- true, if the bit has been successfully modified
This function modifies the FSPEC octets in buffer directly; the FX extension bits are not changed.