From 1a2926b31140e59e49795740c88642d4ff528ef6 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 22 Jan 2016 14:36:59 +0000 Subject: [PATCH] Display ES data for DF=18, CF=2 when showing messages verbosely. Always show an address for DF=18, using the NON_ICAO flag as needed. --- mode_s.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mode_s.c b/mode_s.c index c77f83c..dbb6344 100644 --- a/mode_s.c +++ b/mode_s.c @@ -1200,12 +1200,12 @@ void displayModesMessage(struct modesMessage *mm) { } else if (mm->msgtype == 18) { // DF 18 printf("DF 18: Extended Squitter.\n"); printf(" Control Field : %d (%s)\n", mm->cf, cf_str[mm->cf]); - if ((mm->cf == 0) || (mm->cf == 1) || (mm->cf == 5) || (mm->cf == 6)) { - if (mm->cf == 1 || mm->cf == 5) { - printf(" Other Address : %06x\n", mm->addr); - } else { - printf(" ICAO Address : %06x\n", mm->addr); - } + if (mm->addr & MODES_NON_ICAO_ADDRESS) { + printf(" Other Address : %06x\n", mm->addr); + } else { + printf(" ICAO Address : %06x\n", mm->addr); + } + if ((mm->cf == 0) || (mm->cf == 1) || (mm->cf == 2) || (mm->cf == 5) || (mm->cf == 6)) { displayExtendedSquitter(mm); }