ASTERIX data record processing. More...

Data Structures | |
| struct | ast_datarecord_t |
| Datarecord. More... | |
| struct | ast_datarecord_ex_t |
| Extracted datarecord. More... | |
| struct | ast_datarecord_modifier_t |
| Datarecord modifier. More... | |
Macros | |
| #define | AST_MAX_DATAITEMS 32 |
| Maximum number of data items in a data record. | |
| #define | AST_DATARECORD_HEX_HTML_PREFERED_CHARS (AST_MAX_DATAITEMS * AST_MAX_DATAITEM_SIZE * 12 + 128) |
| Preferred number of chars of datarecord hexadecimal HTML snippet. | |
| #define | AST_DATARECORD_DETAIL_HTML_PREFERED_CHARS 20480 |
| Preferred number of chars of data item detail description HTML snippet. | |
| #define | AST_KEYWORD_VALUE_PREFERRED_CHARS 32 |
| Preferred number of chars of keyword string. | |
Functions | |
| ast_datarecord_t | ast_datarecord_decode (const unsigned char *buffer, const size_t bufsize, const ast_category_t category, const ast_uap_t uap) |
| Datarecord decode function. | |
| ast_datarecord_t | ast_datarecord_encode (unsigned char *const buffer, const size_t bufsize, const ast_datarecord_ex_t xdr) |
| Datarecord encode function. | |
| ast_datarecord_t | ast_datarecord_copy (unsigned char *buffer, const size_t bufsize, const ast_datarecord_t src) |
| Datarecord copy function. | |
| ast_datarecord_t | ast_datarecord_modify (unsigned char *buffer, const size_t bufsize, const ast_datarecord_t src, const ast_datarecord_modifier_t mod) |
| Datarecord modify function. | |
| void | ast_datarecord_get_hex_html (char *html, const size_t html_size, const ast_datarecord_t dr) |
| Function to get a html snippet of the raw datarecord data in hexadecimal format. | |
| void | ast_datarecord_get_detail_html (char *detail, const size_t detail_size, const ast_datarecord_t dr) |
| Function to get a html snippet of detailed description of data record. | |
| bool | ast_datarecord_contain_keyword (const ast_datarecord_t dr, const ast_keyword_t keyword) |
| Check if datarecord contains specified keyword type. | |
| bool | ast_datarecord_match_keyword (const ast_datarecord_t dr, const ast_keyword_t keyword, const char *challenge, bool case_sensitive) |
| Match a specified keyword in the datarecord. | |
| bool | ast_datarecord_get_keyword (char *keystr, const size_t keystr_size, const ast_datarecord_t dr, const ast_keyword_t keyword, const ast_keyword_format_t format) |
| Get keyword summary string from specified datarecord. | |
| ast_sacsic_t | ast_datarecord_get_sacsic (const ast_datarecord_t dr) |
| Get SAC/SIC from specified datarecord. | |
| ast_timeofday_t | ast_datarecord_get_timeofday (const ast_datarecord_t dr) |
| Get time of day from specified datarecord. | |
| ast_msgtype_t | ast_datarecord_get_msgtype (const ast_datarecord_t dr) |
| Get message type from specified datarecord. | |
| ast_tracknum_t | ast_datarecord_get_tracknum (const ast_datarecord_t dr) |
| Get track number from specified datarecord. | |
| ast_squawk_t | ast_datarecord_get_squawk (const ast_datarecord_t dr) |
| Get Mode-3/A code from specified datarecord. | |
| ast_callsign_t | ast_datarecord_get_callsign (const ast_datarecord_t dr) |
| Get callsign from specified datarecord. | |
| ast_icaoaddr_t | ast_datarecord_get_icaoaddr (const ast_datarecord_t dr) |
| Get ICAO 24-bit address from specified datarecord. | |
| ast_wgs84coord_t | ast_datarecord_get_wgs84coord (const ast_datarecord_t dr) |
| Get WGS-84 coordinate from specified datarecord. | |
| ast_altitude_t | ast_datarecord_get_flightlevel (const ast_datarecord_t dr) |
| Get flight level from specified datarecord. | |
| ast_altitude_t | ast_datarecord_get_selaltitude (const ast_datarecord_t dr) |
| Get FMS/MCP/FCU selected altitude from specified datarecord. | |
| ast_polar_coordinate_t | ast_datarecord_get_polarcoord (const ast_datarecord_t dr) |
| Get polar coordinate from specified datarecord. | |
| ast_range_t | ast_datarecord_get_range (const ast_datarecord_t dr) |
| Get range from specified datarecord. | |
| ast_azimuth_t | ast_datarecord_get_azimuth (const ast_datarecord_t dr) |
| Get azimuth from specified datarecord. | |
| ast_heading_t | ast_datarecord_get_heading (const ast_datarecord_t dr) |
| Get heading from specified datarecord. | |
| ast_speed_t | ast_datarecord_get_speed (const ast_datarecord_t dr) |
| Get speed from specified datarecord. | |
| ast_cartesian_velocity_t | ast_datarecord_get_cartesianvel (const ast_datarecord_t dr) |
| Get cartesian velocity from specified datarecord. | |
| ast_doppler_velocity_t | ast_datarecord_get_dopplervel (const ast_datarecord_t dr) |
| Get doppler velocity from specified datarecord. | |
| ast_vertical_rate_t | ast_datarecord_get_vrate (const ast_datarecord_t dr) |
| Get vertical rate from specified datarecord. | |
ASTERIX data record processing.
| #define AST_DATARECORD_DETAIL_HTML_PREFERED_CHARS 20480 |
Preferred number of chars of data item detail description HTML snippet.
| #define AST_DATARECORD_HEX_HTML_PREFERED_CHARS (AST_MAX_DATAITEMS * AST_MAX_DATAITEM_SIZE * 12 + 128) |
Preferred number of chars of datarecord hexadecimal HTML snippet.
| #define AST_KEYWORD_VALUE_PREFERRED_CHARS 32 |
Preferred number of chars of keyword string.
| #define AST_MAX_DATAITEMS 32 |
Maximum number of data items in a data record.
| bool ast_datarecord_contain_keyword | ( | const ast_datarecord_t | dr, |
| const ast_keyword_t | keyword ) |
Check if datarecord contains specified keyword type.
| dr | datarecord to check |
| keyword | keyword type |
| ast_datarecord_t ast_datarecord_copy | ( | unsigned char * | buffer, |
| const size_t | bufsize, | ||
| const ast_datarecord_t | src ) |
Datarecord copy function.
| buffer | Buffer to write destination datarecord data |
| bufsize | Buffer size |
| src | Original data record, must be valid |
This function will copy original data record, to specified buffer. If all fields in data record has been successfully copied, the returned datarecord will be marked as "valid". If any error occurs, the returned datarecord will be marked as "invalid".
| ast_datarecord_t ast_datarecord_decode | ( | const unsigned char * | buffer, |
| const size_t | bufsize, | ||
| const ast_category_t | category, | ||
| const ast_uap_t | uap ) |
Datarecord decode function.
| buffer | Buffer to read datarecord data |
| bufsize | Buffer size |
| category | Data category |
| uap | User application profile (UAP) used to decode data |
This function will read and check data against specified uap, and return decoded datarecord. If data can be successfully decoded, the returned datarecord will be marked as "valid". If any error occurs, the returned datarecord will be marked as "invalid".
| ast_datarecord_t ast_datarecord_encode | ( | unsigned char *const | buffer, |
| const size_t | bufsize, | ||
| const ast_datarecord_ex_t | xdr ) |
Datarecord encode function.
| buffer | Buffer to write encoded datarecord data |
| bufsize | Buffer size |
| xdr | Extracted datarecord container |
This function will check dataitems contained in xdr, encode them and write encoded data to buffer. If all data items are successfully encoded, the returned datarecord will be marked as "valid". If any error occurs, the returned datarecord will be marked as "invalid".
| ast_azimuth_t ast_datarecord_get_azimuth | ( | const ast_datarecord_t | dr | ) |
Get azimuth from specified datarecord.
| dr | datarecord to get |
| ast_callsign_t ast_datarecord_get_callsign | ( | const ast_datarecord_t | dr | ) |
Get callsign from specified datarecord.
| dr | datarecord to get |
| ast_cartesian_velocity_t ast_datarecord_get_cartesianvel | ( | const ast_datarecord_t | dr | ) |
Get cartesian velocity from specified datarecord.
| dr | datarecord to get |
| void ast_datarecord_get_detail_html | ( | char * | detail, |
| const size_t | detail_size, | ||
| const ast_datarecord_t | dr ) |
Function to get a html snippet of detailed description of data record.
| detail | Buffer to save the html snippet |
| detail_size | Buffer size |
| dr | Datarecord |
The returned html fragment contains only basic elements used in html body, such as <br/> <h> <table>....
This function will return only semantics markups, some elements will contain class name, and it is recommended for the library user to use CSS to format the html style.
| ast_doppler_velocity_t ast_datarecord_get_dopplervel | ( | const ast_datarecord_t | dr | ) |
Get doppler velocity from specified datarecord.
| dr | datarecord to get |
| ast_altitude_t ast_datarecord_get_flightlevel | ( | const ast_datarecord_t | dr | ) |
Get flight level from specified datarecord.
| dr | datarecord to get |
| ast_heading_t ast_datarecord_get_heading | ( | const ast_datarecord_t | dr | ) |
Get heading from specified datarecord.
| dr | datarecord to get |
| void ast_datarecord_get_hex_html | ( | char * | html, |
| const size_t | html_size, | ||
| const ast_datarecord_t | dr ) |
Function to get a html snippet of the raw datarecord data in hexadecimal format.
The returned text will be an html table with data in the cells.
| ast_icaoaddr_t ast_datarecord_get_icaoaddr | ( | const ast_datarecord_t | dr | ) |
Get ICAO 24-bit address from specified datarecord.
| dr | datarecord to get |
| bool ast_datarecord_get_keyword | ( | char * | keystr, |
| const size_t | keystr_size, | ||
| const ast_datarecord_t | dr, | ||
| const ast_keyword_t | keyword, | ||
| const ast_keyword_format_t | format ) |
Get keyword summary string from specified datarecord.
| keystr | the summary string of specified keyword value |
| keystr_size | the buffer size of keystr |
| dr | datarecord to get |
| keyword | keyword type |
| format | keyword format |
For different keyword, the summary string will include:
| ast_msgtype_t ast_datarecord_get_msgtype | ( | const ast_datarecord_t | dr | ) |
Get message type from specified datarecord.
| dr | datarecord to get |
| ast_polar_coordinate_t ast_datarecord_get_polarcoord | ( | const ast_datarecord_t | dr | ) |
Get polar coordinate from specified datarecord.
| dr | datarecord to get |
| ast_range_t ast_datarecord_get_range | ( | const ast_datarecord_t | dr | ) |
Get range from specified datarecord.
| dr | datarecord to get |
| ast_sacsic_t ast_datarecord_get_sacsic | ( | const ast_datarecord_t | dr | ) |
Get SAC/SIC from specified datarecord.
| dr | datarecord to get |
| ast_altitude_t ast_datarecord_get_selaltitude | ( | const ast_datarecord_t | dr | ) |
Get FMS/MCP/FCU selected altitude from specified datarecord.
| dr | datarecord to get |
| ast_speed_t ast_datarecord_get_speed | ( | const ast_datarecord_t | dr | ) |
Get speed from specified datarecord.
| dr | datarecord to get |
| ast_squawk_t ast_datarecord_get_squawk | ( | const ast_datarecord_t | dr | ) |
Get Mode-3/A code from specified datarecord.
| dr | datarecord to get |
| ast_timeofday_t ast_datarecord_get_timeofday | ( | const ast_datarecord_t | dr | ) |
Get time of day from specified datarecord.
| dr | datarecord to get |
| ast_tracknum_t ast_datarecord_get_tracknum | ( | const ast_datarecord_t | dr | ) |
Get track number from specified datarecord.
| dr | datarecord to get |
| ast_vertical_rate_t ast_datarecord_get_vrate | ( | const ast_datarecord_t | dr | ) |
Get vertical rate from specified datarecord.
| dr | datarecord to get |
| ast_wgs84coord_t ast_datarecord_get_wgs84coord | ( | const ast_datarecord_t | dr | ) |
Get WGS-84 coordinate from specified datarecord.
| dr | datarecord to get |
| bool ast_datarecord_match_keyword | ( | const ast_datarecord_t | dr, |
| const ast_keyword_t | keyword, | ||
| const char * | challenge, | ||
| bool | case_sensitive ) |
Match a specified keyword in the datarecord.
| dr | datarecord to match |
| keyword | type of keyword |
| challenge | c string of keyword |
| case_sensitive | case sensitive |
| ast_datarecord_t ast_datarecord_modify | ( | unsigned char * | buffer, |
| const size_t | bufsize, | ||
| const ast_datarecord_t | src, | ||
| const ast_datarecord_modifier_t | mod ) |
Datarecord modify function.
| buffer | Buffer to write modified datarecord data |
| bufsize | Buffer size |
| src | Original data record, must be valid |
| mod | Data item modifier |
This function will modify the original data record, according to data item modifier, and write modified data into buffer. For data items not specified by data modifier, the original one will be copied as is. If all data items can be successfully modified, the returned datarecord will be marked as "valid". If any error occurs, the returned datarecord will be marked as "invalid".