diff --git a/dump1090.c b/dump1090.c index 8d7c8ca..1d22a5d 100644 --- a/dump1090.c +++ b/dump1090.c @@ -604,8 +604,8 @@ static void display_stats(void) { } printf("%d total usable messages\n", - Modes.stat_demod.goodcrc + Modes.stat_demod_phasecorrected.goodcrc + - Modes.stat_demod.fixed + Modes.stat_demod_phasecorrected.fixed); + Modes.stat_messages_total); + fflush(stdout); Modes.stat_cputime.tv_sec = 0; @@ -622,6 +622,8 @@ static void display_stats(void) { Modes.stat_DF_Type_Corrected = Modes.stat_out_of_phase = 0; + Modes.stat_messages_total = 0; + for (j = 0; j < MODES_MAX_PHASE_STATS; j++) { Modes.stat_preamble_phase[j] = 0; } diff --git a/dump1090.h b/dump1090.h index 00978fd..49c096a 100644 --- a/dump1090.h +++ b/dump1090.h @@ -394,6 +394,9 @@ struct { // Internal state unsigned int stat_blocks_dropped; struct timespec stat_cputime; + + // total messages: + unsigned int stat_messages_total; } Modes; // The struct we use to store information about a decoded message. diff --git a/mode_s.c b/mode_s.c index 40e4111..ea5a086 100644 --- a/mode_s.c +++ b/mode_s.c @@ -2381,6 +2381,8 @@ void detectModeS_oversample(uint16_t *m, uint32_t mlen) { // void useModesMessage(struct modesMessage *mm) { if ((Modes.check_crc == 0) || (mm->crcok) || (mm->correctedbits)) { // not checking, ok or fixed + ++Modes.stat_messages_total; + // If we are decoding, track aircraft interactiveReceiveData(mm); diff --git a/net_io.c b/net_io.c index 2918fba..4520edf 100644 --- a/net_io.c +++ b/net_io.c @@ -676,8 +676,9 @@ char *generateAircraftJson(int *len) { p += snprintf(p, end-p, "{ \"now\" : %d,\n" + " \"messages\" : %u,\n" " \"aircraft\" : [", - (int)now); + (int)now, Modes.stat_messages_total); while(a) { if (a->modeACflags & MODEAC_MSG_FLAG) { // skip any fudged ICAO records Mode A/C diff --git a/public_html/gmap.html b/public_html/gmap.html index 68a582f..b9fff8d 100644 --- a/public_html/gmap.html +++ b/public_html/gmap.html @@ -74,7 +74,7 @@