Treat ADS-R as a separate source type (higher priority than TIS-B, lower priority than direct ADS-B)

This commit is contained in:
Oliver Jowett 2019-12-11 12:43:19 -06:00
parent 404ac5dced
commit 886b0d3f81
3 changed files with 5 additions and 0 deletions

View File

@ -138,6 +138,7 @@ typedef enum {
SOURCE_MODE_S, /* data from a Mode S message, no full CRC */
SOURCE_MODE_S_CHECKED, /* data from a Mode S message with full CRC */
SOURCE_TISB, /* data from a TIS-B extended squitter message */
SOURCE_ADSR, /* data from a ADS-R extended squitter message */
SOURCE_ADSB, /* data from a ADS-B extended squitter message */
} datasource_t;

View File

@ -1400,6 +1400,7 @@ static void decodeExtendedSquitter(struct modesMessage *mm)
// IMF=0: AA field holds 24-bit ICAO aircraft address
// IMF=1: AA field holds anonymous address or ground vehicle address or fixed obstruction address
mm->addrtype = ADDR_ADSR_ICAO;
mm->source = SOURCE_ADSR;
check_imf = 1;
break;

View File

@ -2096,6 +2096,9 @@ static inline float heading_difference(float h1, float h2)
case SOURCE_TISB:
sourcetype = "T";
break;
case SOURCE_ADSR:
sourcetype = "R";
break;
case SOURCE_ADSB:
sourcetype = "A";
break;