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
3 changed files with 40 additions and 2 deletions
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.
|
||||
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
|
||||
if (mm->msgtype == 0 || mm->msgtype == 16) {
|
||||
if (msg[0] & 0x04) { // VS Bit
|
||||
|
|
@ -1176,6 +1179,12 @@ void displayModesMessage(struct modesMessage *mm) {
|
|||
if (mm->correctedbits != 0)
|
||||
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
|
||||
printf("DF 0: Short Air-Air Surveillance.\n");
|
||||
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) {
|
||||
if ((Modes.check_crc == 0) || (mm->crcok) || (mm->correctedbits)) { // not checking, ok or fixed
|
||||
|
||||
// Always track aircraft
|
||||
interactiveReceiveData(mm);
|
||||
// If we are decoding, track aircraft
|
||||
if (!Modes.no_decode) {
|
||||
interactiveReceiveData(mm);
|
||||
}
|
||||
|
||||
// In non-interactive non-quiet mode, display messages on standard output
|
||||
if (!Modes.interactive && !Modes.quiet) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue