From 8870de2b9a9c445810725cacdad0341a1d4f2c0b Mon Sep 17 00:00:00 2001 From: Malcolm Robb Date: Wed, 1 May 2013 12:54:37 +0100 Subject: [PATCH] Update --interactive with DF20/21 callsigns --- dump1090.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dump1090.c b/dump1090.c index 4f71111..7bbf9a9 100644 --- a/dump1090.c +++ b/dump1090.c @@ -56,7 +56,7 @@ // MinorVer changes when additional features are added, but not for bug fixes (range 00-99) // DayDate & Year changes for all changes, including for bug fixes. It represent the release date of the update // -#define MODES_DUMP1090_VERSION "1.04.3004.13" +#define MODES_DUMP1090_VERSION "1.04.0105.13" #define MODES_DEFAULT_RATE 2000000 #define MODES_DEFAULT_FREQ 1090000000 @@ -1617,7 +1617,7 @@ void displayModesMessage(struct modesMessage *mm) { printf(" Comm-B BDS : %x\n", mm->msg[4]); // Decode the extended squitter message - if ( mm->msg[4] == 0x20) { // Aircraft identification + if ( mm->msg[4] == 0x20) { // BDS 2,0 Aircraft identification printf(" BDS 2,0 Aircraft Identification : %s\n", mm->flight); } } @@ -1635,7 +1635,7 @@ void displayModesMessage(struct modesMessage *mm) { printf(" Comm-B BDS : %x\n", mm->msg[4]); // Decode the extended squitter message - if ( mm->msg[4] == 0x20) { // Aircraft identification + if ( mm->msg[4] == 0x20) { // BDS 2,0 Aircraft identification printf(" BDS 2,0 Aircraft Identification : %s\n", mm->flight); } } @@ -2530,6 +2530,11 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm) { } a->altitude = mm->altitude; a->modeC = (mm->altitude + 49) / 100; + + if ((mm->msgtype == 20) && (mm->msg[4] == 0x20)) { + memcpy(a->flight, mm->flight, sizeof(a->flight)); + } + } else if(mm->msgtype == 5 || mm->msgtype == 21) { if (a->modeA != mm->modeA) { a->modeAcount = 0; // Squawk has changed, so zero the hit count @@ -2537,6 +2542,10 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm) { } a->modeA = mm->modeA; + if ((mm->msgtype == 21) && (mm->msg[4] == 0x20)) { + memcpy(a->flight, mm->flight, sizeof(a->flight)); + } + } else if (mm->msgtype == 17) { if (mm->metype >= 1 && mm->metype <= 4) { memcpy(a->flight, mm->flight, sizeof(a->flight)); @@ -2574,6 +2583,7 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm) { a->track = mm->heading; } } + } else if(mm->msgtype == 32) { int flags = a->modeACflags;