1#if !defined(RADIOLIB_ADSB_H)
4#include "../../TypeDef.h"
6#if !RADIOLIB_EXCLUDE_ADSB
8#include "../PhysicalLayer/PhysicalLayer.h"
10#define RADIOLIB_ADSB_CARRIER_FREQUENCY (1090.0f)
13#define RADIOLIB_ADSB_FRAME_LEN_BYTES (14)
14#define RADIOLIB_ADSB_FRAME_DF_CA_POS (0)
15#define RADIOLIB_ADSB_FRAME_ICAO_LEN_BYTES (3)
16#define RADIOLIB_ADSB_FRAME_ICAO_POS (1)
17#define RADIOLIB_ADSB_FRAME_MESSAGE_LEN_BYTES (7)
18#define RADIOLIB_ADSB_FRAME_MESSAGE_POS (4)
19#define RADIOLIB_ADSB_FRAME_PARITY_INTERROGATOR_LEN_BYTES (3)
20#define RADIOLIB_ADSB_FRAME_PARITY_INTERROGATOR_POS (11)
23#define RADIOLIB_ADSB_HEX_ID_LEN (6 + 1)
26#define RADIOLIB_ADSB_CALLSIGN_LEN (8 + 1)
32enum class ADSBMessageType {
35 AIRBORNE_POS_ALT_BARO,
37 AIRBORNE_POS_ALT_GNSS,
48enum class ADSBAircraftCategory {
56 ULTRALIGHT_PARAGLIDER,
82 uint8_t
icao[RADIOLIB_ADSB_FRAME_ICAO_LEN_BYTES];
88 uint8_t
message[RADIOLIB_ADSB_FRAME_MESSAGE_LEN_BYTES];
115 int16_t
decode(
const uint8_t in[RADIOLIB_ADSB_FRAME_LEN_BYTES],
ADSBFrame* out);
132 int16_t
parseCallsign(
const ADSBFrame* in,
char callsign[RADIOLIB_ADSB_CALLSIGN_LEN], ADSBAircraftCategory* cat = NULL);
160 float refPos[2] = { 0, 0 };
Client for receiving and decoding ADS-B broadcast.
Definition ADSB.h:95
int16_t begin()
Initialization method.
Definition ADSB.cpp:11
int16_t parseHexId(const ADSBFrame *in, char id[RADIOLIB_ADSB_HEX_ID_LEN])
Method to parse the transponder ICAO address (hex ID).
Definition ADSB.cpp:71
int16_t parseCallsign(const ADSBFrame *in, char callsign[RADIOLIB_ADSB_CALLSIGN_LEN], ADSBAircraftCategory *cat=NULL)
Method to parse callsign from a received frame.
Definition ADSB.cpp:82
int16_t decode(const uint8_t in[RADIOLIB_ADSB_FRAME_LEN_BYTES], ADSBFrame *out)
Frame decoding method, turns raw received binary data into ADS-B frame.
Definition ADSB.cpp:26
void setReferencePosition(float lat, float lon)
Method to set reference position to be used during airborne position calculation.
Definition ADSB.cpp:161
int16_t parseAirbornePosition(const ADSBFrame *in, int *alt, float *lat, float *lon, bool *altGnss=NULL)
Parse aircraft position from incoming frame, uasing reference position set by setReferencePosition....
Definition ADSB.cpp:183
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition PhysicalLayer.h:257
ADS-B Frame structure.
Definition ADSB.h:73
uint8_t downlinkFormat
Downlink format (DF). Received frames should always have DF = 17.
Definition ADSB.h:76
ADSBMessageType messageType
Message type.
Definition ADSB.h:85
uint8_t capability
Transponder capability.
Definition ADSB.h:79
uint8_t icao[RADIOLIB_ADSB_FRAME_ICAO_LEN_BYTES]
Transponder ICAO address.
Definition ADSB.h:82
uint8_t message[RADIOLIB_ADSB_FRAME_MESSAGE_LEN_BYTES]
Message buffer, interpretation is dependent on the value of messageType.
Definition ADSB.h:88