[hamradio-commits] [dump1090] 184/373: VK1ET : Bugfix in Error correction table

Matthew Ernisse mernisse-guest at moszumanska.debian.org
Thu Oct 23 14:58:18 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 92fd06bcd6af8d8458abf5aac6b34bc61e7bdd2c
Author: Malcolm Robb <Support at ATTAvionics.com>
Date:   Tue May 21 11:28:56 2013 +0100

    VK1ET : Bugfix in Error correction table
    
    vk1etI believe there is an error in the way the CRC error syndromes are
    being created in the two bit case. The inner loop was introducing an
    extra error bit each time through rather than moving it. Below is the
    modified code fragment for syndrome creation collapsedSun 07:26
    19 May 2013 07:26vk1et [notifications at github.com]Actions
    To:Mantirez/dump1090 ‎[dump1090 at noreply.github.com]‎Cc:MMalcolmRobb
    ‎[Support at ATTAvionics.com]‎
    
    To help protect your privacy, some content in this message has been
    blocked. If you're sure this message is from a trusted sender and you
    want to re-enable the blocked features, click here.
    Bugfix first noted by VK1ET, and posted here :
    https://github.com/antirez/dump1090/pull/23#issuecomment-18113094
    
    I believe there is an error in the way the CRC error syndromes are being
    created in the two bit case. The inner loop was introducing an extra
    error bit each time through rather than moving it.
---
 dump1090.c | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/dump1090.c b/dump1090.c
index 59a02e8..d2ef607 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -56,7 +56,7 @@
 // MinorVer changes when additional features are added, but not for bug fixes (range 00-99)
 // DayDate & Year changes for all changes, including for bug fixes. It represent the release date of the update
 //
-#define MODES_DUMP1090_VERSION     "1.06.1405.13"
+#define MODES_DUMP1090_VERSION     "1.06.2105.13"
 #define MODES_USER_LATITUDE_DFLT   (0.0)
 #define MODES_USER_LONGITUDE_DFLT  (0.0)
 
@@ -1258,28 +1258,22 @@ void modesInitErrorInfo() {
         uint32_t crc;
         n = 0;
         memset(bitErrorTable, 0, sizeof(bitErrorTable));
-        /* First, insert infos about all possible single bit errors */
+        memset(msg, 0, MODES_LONG_MSG_BYTES);
+
+        /* Add all possible single and double bit errors */
         for (i = 0;  i < MODES_LONG_MSG_BITS;  i++) {
-                int bytepos = (i >> 3);
-                int mask = 1 << (7 - (i & 7));
-                memset(msg, 0, MODES_LONG_MSG_BYTES);
-                msg[bytepos] ^= mask;
+                int bytepos0 = (i >> 3);
+                int mask0 = 1 << (7 - (i & 7));
+                msg[bytepos0] ^= mask0;          // create error0
                 crc = modesChecksum(msg, MODES_LONG_MSG_BITS);
-                bitErrorTable[n].syndrome = crc;
+                bitErrorTable[n].syndrome = crc;      // single bit error case
                 bitErrorTable[n].pos0 = i;
                 bitErrorTable[n].pos1 = -1;
                 n += 1;
-        }
-        /* Add also all double bit errors */
-        for (i = 0;  i < MODES_LONG_MSG_BITS;  i++) {
-                int bytepos0 = (i >> 3);
-                int mask0 = 1 << (7 - (i & 7));
-                memset(msg, 0, MODES_LONG_MSG_BYTES);
-                msg[bytepos0] ^= mask0;
                 for (j = i+1;  j < MODES_LONG_MSG_BITS;  j++) {
                         int bytepos1 = (j >> 3);
                         int mask1 = 1 << (7 - (j & 7));
-                        msg[bytepos1] ^= mask1;
+                        msg[bytepos1] ^= mask1;  // create error1
                         crc = modesChecksum(msg, MODES_LONG_MSG_BITS);
                         if (n >= NERRORINFO) {
                                 /*
@@ -1289,11 +1283,13 @@ void modesInitErrorInfo() {
                                 */
                                 break;
                         }
-                        bitErrorTable[n].syndrome = crc;
+                        bitErrorTable[n].syndrome = crc;    // two bit error case
                         bitErrorTable[n].pos0 = i;
                         bitErrorTable[n].pos1 = j;
                         n += 1;
+                        msg[bytepos1] ^= mask1;  // revert error1
                 }
+                msg[bytepos0] ^= mask0;          // revert error0
         }
         qsort(bitErrorTable, NERRORINFO,
               sizeof(struct errorinfo), cmpErrorInfo);

-- 
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