Add --no-decode option.
This disables most decoding of the contents of Mode S messages, aircraft tracking, and some output modes that depend on them. It's intended for edge receivers that just forward to a central hub rather than processing data locally.
This commit is contained in:
parent
a82df07c0c
commit
5683001164
26
dump1090.c
26
dump1090.c
|
@ -434,6 +434,7 @@ void showHelp(void) {
|
||||||
"--debug <flags> Debug mode (verbose), see README for details\n"
|
"--debug <flags> Debug mode (verbose), see README for details\n"
|
||||||
"--quiet Disable output to stdout. Use for daemon applications\n"
|
"--quiet Disable output to stdout. Use for daemon applications\n"
|
||||||
"--ppm <error> Set receiver error in parts per million (default 0)\n"
|
"--ppm <error> Set receiver error in parts per million (default 0)\n"
|
||||||
|
"--no-decode Don't decode the message contents beyond the minimum necessary\n"
|
||||||
"--help Show this help\n"
|
"--help Show this help\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Debug mode flags: d = Log frames decoded with errors\n"
|
"Debug mode flags: d = Log frames decoded with errors\n"
|
||||||
|
@ -681,6 +682,8 @@ int main(int argc, char **argv) {
|
||||||
} else if (!strcmp(argv[j],"--interactive-rtl1090")) {
|
} else if (!strcmp(argv[j],"--interactive-rtl1090")) {
|
||||||
Modes.interactive = 1;
|
Modes.interactive = 1;
|
||||||
Modes.interactive_rtl1090 = 1;
|
Modes.interactive_rtl1090 = 1;
|
||||||
|
} else if (!strcmp(argv[j],"--no-decode")) {
|
||||||
|
Modes.no_decode = 1;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Unknown or not enough arguments for option '%s'.\n\n",
|
"Unknown or not enough arguments for option '%s'.\n\n",
|
||||||
|
@ -690,6 +693,29 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle --no-decode, which turns off various parts of decoding
|
||||||
|
// that are not useful for an "edge" dump1090 that purely forwards
|
||||||
|
// raw data to a central hub elsewhere.
|
||||||
|
if (Modes.no_decode) {
|
||||||
|
if (Modes.interactive) {
|
||||||
|
fprintf(stderr, "--no-decode and --interactive cannot be specified together.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Modes.net_output_sbs_port != MODES_NET_OUTPUT_SBS_PORT) {
|
||||||
|
fprintf(stderr, "--no-decode and --net-sbs-port cannot be specified together.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Modes.net_http_port != MODES_NET_HTTP_PORT) {
|
||||||
|
fprintf(stderr, "--no-decode and --net-http-port cannot be specified together.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Modes.net_output_sbs_port = 0;
|
||||||
|
Modes.net_http_port = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Try to comply with the Copyright license conditions for binary distribution
|
// Try to comply with the Copyright license conditions for binary distribution
|
||||||
if (!Modes.quiet) {showCopyright();}
|
if (!Modes.quiet) {showCopyright();}
|
||||||
|
|
|
@ -317,6 +317,7 @@ struct { // Internal state
|
||||||
int metric; // Use metric units
|
int metric; // Use metric units
|
||||||
int mlat; // Use Beast ascii format for raw data output, i.e. @...; iso *...;
|
int mlat; // Use Beast ascii format for raw data output, i.e. @...; iso *...;
|
||||||
int interactive_rtl1090; // flight table in interactive mode is formatted like RTL1090
|
int interactive_rtl1090; // flight table in interactive mode is formatted like RTL1090
|
||||||
|
int no_decode; // Disable decoding and aircraft tracking
|
||||||
|
|
||||||
// User details
|
// User details
|
||||||
double fUserLat; // Users receiver/antenna lat/lon needed for initial surface location
|
double fUserLat; // Users receiver/antenna lat/lon needed for initial surface location
|
||||||
|
|
15
mode_s.c
15
mode_s.c
|
@ -911,6 +911,9 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) {
|
||||||
// of the data contents, so save time and give up now.
|
// of the data contents, so save time and give up now.
|
||||||
if ((Modes.check_crc) && (!mm->crcok)) { return;}
|
if ((Modes.check_crc) && (!mm->crcok)) { return;}
|
||||||
|
|
||||||
|
// If decoding is disabled, this is as far as we go.
|
||||||
|
if (Modes.no_decode) return;
|
||||||
|
|
||||||
// Fields for DF0, DF16
|
// Fields for DF0, DF16
|
||||||
if (mm->msgtype == 0 || mm->msgtype == 16) {
|
if (mm->msgtype == 0 || mm->msgtype == 16) {
|
||||||
if (msg[0] & 0x04) { // VS Bit
|
if (msg[0] & 0x04) { // VS Bit
|
||||||
|
@ -1176,6 +1179,12 @@ void displayModesMessage(struct modesMessage *mm) {
|
||||||
if (mm->correctedbits != 0)
|
if (mm->correctedbits != 0)
|
||||||
printf("No. of bit errors fixed: %d\n", mm->correctedbits);
|
printf("No. of bit errors fixed: %d\n", mm->correctedbits);
|
||||||
|
|
||||||
|
if (Modes.no_decode) {
|
||||||
|
// Show DF type and address only; the rest is not decoded.
|
||||||
|
printf("DF %d; address: %06x\n", mm->msgtype, mm->addr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mm->msgtype == 0) { // DF 0
|
if (mm->msgtype == 0) { // DF 0
|
||||||
printf("DF 0: Short Air-Air Surveillance.\n");
|
printf("DF 0: Short Air-Air Surveillance.\n");
|
||||||
printf(" VS : %s\n", (mm->msg[0] & 0x04) ? "Ground" : "Airborne");
|
printf(" VS : %s\n", (mm->msg[0] & 0x04) ? "Ground" : "Airborne");
|
||||||
|
@ -1900,8 +1909,10 @@ void detectModeS(uint16_t *m, uint32_t mlen) {
|
||||||
void useModesMessage(struct modesMessage *mm) {
|
void useModesMessage(struct modesMessage *mm) {
|
||||||
if ((Modes.check_crc == 0) || (mm->crcok) || (mm->correctedbits)) { // not checking, ok or fixed
|
if ((Modes.check_crc == 0) || (mm->crcok) || (mm->correctedbits)) { // not checking, ok or fixed
|
||||||
|
|
||||||
// Always track aircraft
|
// If we are decoding, track aircraft
|
||||||
interactiveReceiveData(mm);
|
if (!Modes.no_decode) {
|
||||||
|
interactiveReceiveData(mm);
|
||||||
|
}
|
||||||
|
|
||||||
// In non-interactive non-quiet mode, display messages on standard output
|
// In non-interactive non-quiet mode, display messages on standard output
|
||||||
if (!Modes.interactive && !Modes.quiet) {
|
if (!Modes.interactive && !Modes.quiet) {
|
||||||
|
|
Loading…
Reference in a new issue