libSDRForge
Loading...
Searching...
No Matches
sdrforge.adsb.protocol Namespace Reference

Decode CRC-validated Mode S and ADS-B Extended Squitter frames. More...

Classes

class  AdsbMessage
 Parsed ADS-B frame fields and optional aircraft telemetry. More...

Functions

int modes_crc (bytes message)
 Calculate the Mode S CRC remainder including transmitted parity.
bytes append_crc (bytes payload)
 Append a plain CRC to an eleven-byte DF17 payload.
int _field (int frame, int total_bits, int start, int length)
AdsbMessage|None decode_message (bytes|str message)
 Decode a CRC-valid DF17 frame without inferring missing telemetry.

Variables

int _POLY = 0xFFF409
str _CHARSET = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ#####_###############0123456789######"

Detailed Description

Decode CRC-validated Mode S and ADS-B Extended Squitter frames.

Only DF17 messages with a valid 24-bit parity are accepted. This first milestone decodes identification, barometric altitude and airborne velocity. It does not demodulate IQ, decode CPR coordinates, or track aircraft.

Function Documentation

◆ _field()

int sdrforge.adsb.protocol._field ( int frame,
int total_bits,
int start,
int length )
protected
Extract a field using the specification's 1-based, MSB-first positions.

◆ append_crc()

bytes sdrforge.adsb.protocol.append_crc ( bytes payload)

Append a plain CRC to an eleven-byte DF17 payload.

Parameters
payloadEleven-byte payload.
Returns
Fourteen-byte frame with appended CRC.

◆ decode_message()

AdsbMessage | None sdrforge.adsb.protocol.decode_message ( bytes | str message)

Decode a CRC-valid DF17 frame without inferring missing telemetry.

Parameters
messageFrame bytes or hexadecimal text.
Returns
Decoded ADS-B message or None for unsupported frames.

Strings may contain hex bytes, optionally wrapped in *...; as used by common text-based Mode S feeds.

◆ modes_crc()

int sdrforge.adsb.protocol.modes_crc ( bytes message)

Calculate the Mode S CRC remainder including transmitted parity.

Parameters
messageSeven- or fourteen-byte Mode S frame.
Returns
CRC remainder, zero for valid plain-CRC DF17 frames.

A valid plain-CRC DF17 frame has remainder zero. Other Mode S downlink formats can use ICAO-address parity and are not supported here.

Variable Documentation

◆ _CHARSET

str sdrforge.adsb.protocol._CHARSET = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ#####_###############0123456789######"
protected

◆ _POLY

int sdrforge.adsb.protocol._POLY = 0xFFF409
protected