From d48e066a666418a537404bb0fd5f8b4de38e4a77 Mon Sep 17 00:00:00 2001 From: Manolis Surligas Date: Fri, 27 Dec 2019 19:51:54 +0200 Subject: [PATCH] Improve AX.25 filtering to reduce false positives The CRC16 of the AX.25 seems that is too weak for the new decoding approach and we get many false positives. Now the AX.25 decoder, makes waits for at least two occurances of the AX.25 SYNC flag. --- include/satnogs/ax25.h | 2 +- lib/ax25_decoder.cc | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/satnogs/ax25.h b/include/satnogs/ax25.h index d367bed..cabff44 100644 --- a/include/satnogs/ax25.h +++ b/include/satnogs/ax25.h @@ -31,7 +31,7 @@ namespace gr { namespace satnogs { const size_t AX25_MIN_ADDR_LEN = 14; -const size_t AX25_MAX_ADDR_LEN = 28; +const size_t AX25_MAX_ADDR_LEN = (2 * 7 + 8 * 7); const size_t AX25_MIN_CTRL_LEN = 1; const size_t AX25_MAX_CTRL_LEN = 2; const size_t AX25_MAX_FRAME_LEN = 256; diff --git a/lib/ax25_decoder.cc b/lib/ax25_decoder.cc index 476a5a4..1757da3 100644 --- a/lib/ax25_decoder.cc +++ b/lib/ax25_decoder.cc @@ -120,13 +120,8 @@ ax25_decoder::_decode(decoder_status_t &status) * AX.25 flag. We believe that such transmissions are yet rare. */ bool have_sync = false; - if (d_descramble) { - have_sync = (d_shift_reg >> 8) == AX25_SYNC_FLAG; - } - else { - have_sync = ((d_shift_reg & 0xFF) == AX25_SYNC_FLAG) - && (d_shift_reg >> 8) == AX25_SYNC_FLAG; - } + have_sync = ((d_shift_reg & 0xFF) == AX25_SYNC_FLAG) + && (d_shift_reg >> 8) == AX25_SYNC_FLAG; if (have_sync) { d_bitstream.erase(d_bitstream.begin(), d_bitstream.begin() + i + 1);