Merge branch 'no-decode'

Conflicts:
	mode_s.c
This commit is contained in:
Oliver Jowett 2014-09-23 00:01:54 +01:00
commit e6e92b1e8e
3 changed files with 40 additions and 2 deletions

View file

@ -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) && (!mm->correctedbits)) { 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
@ -1178,6 +1181,12 @@ void displayModesMessage(struct modesMessage *mm) {
printf("SNR: %d.%d dB\n", mm->signalLevel/5, 2*(mm->signalLevel%5));
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");
@ -1937,8 +1946,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) {