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.
This commit is contained in:
parent
a55b9a76b5
commit
583f24299a
4
mode_s.c
4
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
|
// Skip this message if we are sure it's fine
|
||||||
if (mm.crcok) {
|
if (mm.crcok) {
|
||||||
j += (MODES_PREAMBLE_US+msglen)*2;
|
j += (MODES_PREAMBLE_US+msglen)*2 - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass data to the next layer
|
// Pass data to the next layer
|
||||||
|
@ -2092,4 +2092,4 @@ int decodeCPRrelative(struct aircraft *a, int fflag, int surface) {
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// ===================== Mode S detection and decoding ===================
|
// ===================== Mode S detection and decoding ===================
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue