[hamradio-commits] [dump1090] 196/373: Change mm.crc checks to mm.correctedbits
Matthew Ernisse
mernisse-guest at moszumanska.debian.org
Thu Oct 23 14:58:19 UTC 2014
This is an automated email from the git hooks/post-receive script.
mernisse-guest pushed a commit to branch backport
in repository dump1090.
commit 08ffc3f54182a2e0cff4b75d1a4a09002132d1b8
Author: Malcolm Robb <Support at ATTAvionics.com>
Date: Tue May 21 23:16:49 2013 +0100
Change mm.crc checks to mm.correctedbits
Instead of force clearing mm.crc to zero if we successfully correct bit
errors, just use the mm.correctedbits variable. This allows us to print
out the crc value containing the errors during list output modes.
---
dump1090.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/dump1090.c b/dump1090.c
index 49cf851..5b98438 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -1748,14 +1748,8 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) {
mm->crcok = (mm->crc == 0);
mm->addr = (msg[1] << 16) | (msg[2] << 8) | (msg[3]);
- if (0 != mm->correctedbits) {
- // DF 17 : if (error corrected) force crc = 0 but do not try to add this address
- // to the whitelist of recently seen ICAO addresses.
- mm->crc = 0;
-
- } else if (0 == mm->crc) {
- // DF 17 : if uncorrected and crc == 0 add this address to the whitelist of
- // recently seen ICAO addresses.
+ if (0 == mm->crc) {
+ // DF 17 : if crc == 0 try to populate our ICAO addresses whitelist.
addRecentlySeenICAOAddr(mm->addr);
}
@@ -2465,7 +2459,7 @@ void detectModeS(uint16_t *m, uint32_t mlen) {
// Update statistics
if (Modes.stats) {
- if (mm.crcok || use_correction || !mm.crc) {
+ if (mm.crcok || use_correction || mm.correctedbits) {
if (errors == 0) Modes.stat_demodulated++;
if (mm.correctedbits == 0) {
if (mm.crcok) {Modes.stat_goodcrc++;}
@@ -2542,7 +2536,7 @@ void detectModeS(uint16_t *m, uint32_t mlen) {
// processing and visualization
//
void useModesMessage(struct modesMessage *mm) {
- if ((Modes.check_crc == 0) || (mm->crcok) || (mm->crc == 0)) { // not checking, ok or fixed
+ if ((Modes.check_crc == 0) || (mm->crcok) || (mm->correctedbits)) { // not checking, ok or fixed
// Track aircrafts if...
if ( (Modes.interactive) // in interactive mode
@@ -2917,7 +2911,7 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm) {
struct aircraft *a, *aux;
// Return if (checking crc) AND (not crcok) AND (not fixed)
- if (Modes.check_crc && (mm->crcok == 0) && mm->crc)
+ if (Modes.check_crc && (mm->crcok == 0) && (mm->correctedbits == 0))
return NULL;
// Loookup our aircraft or create a new one
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git
More information about the pkg-hamradio-commits
mailing list