From 583f24299a6540504d9d6f4eb86896d60073d344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=A4b?= Date: Wed, 14 May 2014 19:36:36 +0200 Subject: [PATCH] Fixed: now skipping correct number of values in magnitude buffer Variable j points to the current location in the magnitude vector. When decoding a message (MODES_PREAMBLE_US+msglen)*2 is added to j. In the loop head j is increased by 1, so one value was skipped. --- mode_s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mode_s.c b/mode_s.c index e5e9c81..780e650 100644 --- a/mode_s.c +++ b/mode_s.c @@ -1774,7 +1774,7 @@ void detectModeS(uint16_t *m, uint32_t mlen) { // Skip this message if we are sure it's fine if (mm.crcok) { - j += (MODES_PREAMBLE_US+msglen)*2; + j += (MODES_PREAMBLE_US+msglen)*2 - 1; } // Pass data to the next layer @@ -2092,4 +2092,4 @@ int decodeCPRrelative(struct aircraft *a, int fflag, int surface) { } // // ===================== Mode S detection and decoding =================== -// \ No newline at end of file +//