Data record for radar video transmission. More...

Collaboration diagram for Data Record I240 - Radar Video Transmission:

Data Structures

struct  ast_datarecord_240_t
 Data Record I240 - Radar Video Transmission. More...
struct  ast_videovector_t
 Fully decoded video vector of a CAT240 data record. More...

Macros

#define ast_datarecord_240_get_tracknum   0
 Get track number function (not applicable for CAT240).
#define ast_datarecord_240_get_squawk   0
 Get Mode-3/A code function (not applicable for CAT240).
#define ast_datarecord_240_get_callsign   0
 Get callsign function (not applicable for CAT240).
#define ast_datarecord_240_get_icaoaddr   0
 Get ICAO 24-bit address function (not applicable for CAT240).
#define ast_datarecord_240_get_coordinate   0
 Get coordinate function (not applicable for CAT240).
#define ast_datarecord_240_get_flightlevel   0
 Get flight level function (not applicable for CAT240).
#define ast_datarecord_240_get_polarcoord   0
 Get polar coordinate function (not applicable for CAT240).
#define ast_datarecord_240_get_heading   0
 Get heading function (not applicable for CAT240).
#define ast_datarecord_240_get_speed   0
 Get speed function (not applicable for CAT240).
#define ast_datarecord_240_get_selaltitude   0
 Get selected altitude function (not applicable for CAT240).
#define ast_datarecord_240_get_cartesianvel   0
 Get cartesian velocity function (not applicable for CAT240).
#define ast_datarecord_240_get_vrate   0
 Get vertical rate function (not applicable for CAT240).

Enumerations

enum  ast_videovector_error_t {
  AST_VIDEOVECTOR_OK = 0 , AST_VIDEOVECTOR_ERR_RECORD_INVALID , AST_VIDEOVECTOR_ERR_MSGTYPE_SUMMARY , AST_VIDEOVECTOR_ERR_MSGTYPE_UNKNOWN ,
  AST_VIDEOVECTOR_ERR_NO_VIDEO_HEADER , AST_VIDEOVECTOR_ERR_AMBIGUOUS_HEADER , AST_VIDEOVECTOR_ERR_NO_RESOLUTION , AST_VIDEOVECTOR_ERR_RESOLUTION_INVALID ,
  AST_VIDEOVECTOR_ERR_RESOLUTION_UNSUPPORTED , AST_VIDEOVECTOR_ERR_COMPRESSED , AST_VIDEOVECTOR_ERR_NO_VIDEO_BLOCK , AST_VIDEOVECTOR_ERR_AMBIGUOUS_BLOCK ,
  AST_VIDEOVECTOR_ERR_TRUNCATED_BLOCK , AST_VIDEOVECTOR_ERR_REP_EXCEEDED , AST_VIDEOVECTOR_ERR_BUFFER_TOO_SMALL
}
 Video vector error codes. More...

Functions

ast_datarecord_240_t ast_datarecord_240_disassemble (const ast_datarecord_t dr)
 Disassemble CAT240 data record.
ast_videovector_t ast_datarecord_240_get_vector (const ast_datarecord_240_t dr, unsigned int *amplitude_buffer, const size_t amplitude_buffer_size)
 Get the fully decoded video vector of a CAT240 data record.
ast_sacsic_t ast_datarecord_240_get_sacsic (const ast_datarecord_t dr)
 Get SAC/SIC from CAT240 data record.
ast_timeofday_t ast_datarecord_240_get_timeofday (const ast_datarecord_t dr)
 Get time of day from CAT240 data record.
ast_msgtype_t ast_datarecord_240_get_msgtype (const ast_datarecord_t dr)
 Get message type from CAT240 data record.

Detailed Description

Data record for radar video transmission.

Macro Definition Documentation

◆ ast_datarecord_240_get_callsign

#define ast_datarecord_240_get_callsign   0

Get callsign function (not applicable for CAT240).

◆ ast_datarecord_240_get_cartesianvel

#define ast_datarecord_240_get_cartesianvel   0

Get cartesian velocity function (not applicable for CAT240).

◆ ast_datarecord_240_get_coordinate

#define ast_datarecord_240_get_coordinate   0

Get coordinate function (not applicable for CAT240).

◆ ast_datarecord_240_get_flightlevel

#define ast_datarecord_240_get_flightlevel   0

Get flight level function (not applicable for CAT240).

◆ ast_datarecord_240_get_heading

#define ast_datarecord_240_get_heading   0

Get heading function (not applicable for CAT240).

◆ ast_datarecord_240_get_icaoaddr

#define ast_datarecord_240_get_icaoaddr   0

Get ICAO 24-bit address function (not applicable for CAT240).

◆ ast_datarecord_240_get_polarcoord

#define ast_datarecord_240_get_polarcoord   0

Get polar coordinate function (not applicable for CAT240).

◆ ast_datarecord_240_get_selaltitude

#define ast_datarecord_240_get_selaltitude   0

Get selected altitude function (not applicable for CAT240).

◆ ast_datarecord_240_get_speed

#define ast_datarecord_240_get_speed   0

Get speed function (not applicable for CAT240).

◆ ast_datarecord_240_get_squawk

#define ast_datarecord_240_get_squawk   0

Get Mode-3/A code function (not applicable for CAT240).

◆ ast_datarecord_240_get_tracknum

#define ast_datarecord_240_get_tracknum   0

Get track number function (not applicable for CAT240).

◆ ast_datarecord_240_get_vrate

#define ast_datarecord_240_get_vrate   0

Get vertical rate function (not applicable for CAT240).

Enumeration Type Documentation

◆ ast_videovector_error_t

Video vector error codes.

The error code tells the upper layer application why a video vector could not be decoded.

Enumerator
AST_VIDEOVECTOR_OK 

Vector decoded successfully.

AST_VIDEOVECTOR_ERR_RECORD_INVALID 

Record is not a valid CAT240 data record.

AST_VIDEOVECTOR_ERR_MSGTYPE_SUMMARY 

I240/000 is a Video Summary message, no video payload.

AST_VIDEOVECTOR_ERR_MSGTYPE_UNKNOWN 

I240/000 absent or unknown message type.

AST_VIDEOVECTOR_ERR_NO_VIDEO_HEADER 

Neither I240/040 nor I240/041 present/valid.

AST_VIDEOVECTOR_ERR_AMBIGUOUS_HEADER 

Both I240/040 and I240/041 present (ICD allows only one).

AST_VIDEOVECTOR_ERR_NO_RESOLUTION 

I240/048 absent/invalid.

AST_VIDEOVECTOR_ERR_RESOLUTION_INVALID 

I240/048 resolution is not a standard value [1-6].

AST_VIDEOVECTOR_ERR_RESOLUTION_UNSUPPORTED 

Resolution is standard but not implemented (16/32-bits).

AST_VIDEOVECTOR_ERR_COMPRESSED 

Compression indicator set, decompression not implemented.

AST_VIDEOVECTOR_ERR_NO_VIDEO_BLOCK 

None of I240/050, I240/051, I240/052 present.

AST_VIDEOVECTOR_ERR_AMBIGUOUS_BLOCK 

More than one video block item present.

AST_VIDEOVECTOR_ERR_TRUNCATED_BLOCK 

Video block REP claims more bytes than the item carries.

AST_VIDEOVECTOR_ERR_REP_EXCEEDED 

I240/052 REP exceeds the maximum 254.

AST_VIDEOVECTOR_ERR_BUFFER_TOO_SMALL 

Caller cell buffer too small, n_cells holds the needed size.

Function Documentation

◆ ast_datarecord_240_disassemble()

ast_datarecord_240_t ast_datarecord_240_disassemble ( const ast_datarecord_t dr)

Disassemble CAT240 data record.

Parameters
drData record
Returns
Disassembled data record structure

◆ ast_datarecord_240_get_msgtype()

ast_msgtype_t ast_datarecord_240_get_msgtype ( const ast_datarecord_t dr)

Get message type from CAT240 data record.

Parameters
drData record
Returns
Message type identifier

◆ ast_datarecord_240_get_sacsic()

ast_sacsic_t ast_datarecord_240_get_sacsic ( const ast_datarecord_t dr)

Get SAC/SIC from CAT240 data record.

Parameters
drData record
Returns
SAC/SIC identifier

◆ ast_datarecord_240_get_timeofday()

ast_timeofday_t ast_datarecord_240_get_timeofday ( const ast_datarecord_t dr)

Get time of day from CAT240 data record.

Parameters
drData record
Returns
Time of day in seconds since midnight

◆ ast_datarecord_240_get_vector()

ast_videovector_t ast_datarecord_240_get_vector ( const ast_datarecord_240_t dr,
unsigned int * amplitude_buffer,
const size_t amplitude_buffer_size )

Get the fully decoded video vector of a CAT240 data record.

The function decodes the video block into one amplitude value per cell so that the upper layer application does not need to know CAT240 details. Cells are unpacked MSB-first according to the I240/048 resolution; empty cells are reported with amplitude 0 (dense representation).

The required buffer size is known before unpacking: geometrically n_cells = video_size * 8 / bits, with video_size from the video block item present in the record (I240/050, I240/051 or I240/052) and bits from the I240/048 resolution. When I240/049 is present, its NB_VB / NB_CELLS counters are authoritative and n_cells may be smaller than the geometric value when the block carries trailing padding; sizing the buffer by the geometric value is always safe. When amplitude_buffer is NULL or too small, the function returns AST_VIDEOVECTOR_ERR_BUFFER_TOO_SMALL with n_cells set to the required number of unsigned int entries.

The amplitudes member points into the caller-provided buffer, which stays owned by the caller. The video block items are zero-copy views into the source data block: if a video block item is present but damaged (truncated, or I240/052 REP over 254), the decoded item struct is invalid with video_size set to the REP-claimed size and video == NULL; a fully zeroed struct means the item is absent.

Parameters
drDisassembled CAT240 data record
amplitude_bufferCaller-provided amplitude buffer of at least n_cells entries
amplitude_buffer_sizeNumber of unsigned int entries in amplitude_buffer
Returns
Decoded video vector with error code