Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions beastblackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
//
#include "beastblackbox.h"

struct Modes Modes;

//
// ============================= Utility functions ==========================
Expand Down Expand Up @@ -239,16 +240,16 @@ int main(int argc, char **argv) {
// Main routine
readbeastfile();

printf("\n");
fprintf(stderr, "\n");
if(Modes.find_icao) {
icaoPrintDB();
} else {

if (Modes.msg_extracted) printf("Extracted %llu messages\n", Modes.msg_extracted);
printf("Total processed %llu messages\n", Modes.msg_processed);
if (Modes.msg_extracted) fprintf(stderr, "Extracted %llu messages\n", Modes.msg_extracted);
fprintf(stderr, "Total processed %llu messages\n", Modes.msg_processed);

if(Modes.err_bad_crc) printf("WARNING! Found %d messages with bad CRC\n", Modes.err_bad_crc);
if(Modes.err_not_known_ICAO) printf("WARNING! Found %d messages that might be valid, but we couldn't validate the CRC against a known ICAO\n", Modes.err_not_known_ICAO);
if(Modes.err_bad_crc) fprintf(stderr, "WARNING! Found %d messages with bad CRC\n", Modes.err_bad_crc);
if(Modes.err_not_known_ICAO) fprintf(stderr, "WARNING! Found %d messages that might be valid, but we couldn't validate the CRC against a known ICAO\n", Modes.err_not_known_ICAO);
}

// Close all files
Expand Down
6 changes: 4 additions & 2 deletions beastblackbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ typedef void (*mlatprocessor_t)(struct timespec *msgTime, uint64_t mlatTimestamp
//======================== structure declarations =========================

// Program global state
struct { // Internal state
struct Modes { // Internal state
int exit; // Flag when user press Ctrl+C

// File
Expand Down Expand Up @@ -235,7 +235,9 @@ struct { // Internal state

// State tracking
struct aircraft *aircrafts;
} Modes;
};

extern struct Modes Modes;

// The struct we use to store information about a decoded message.
struct modesMessage {
Expand Down