From ab2af8d6da2991ada622a7de5e6246e43ece69a1 Mon Sep 17 00:00:00 2001 From: "Wilfried.Philips" Date: Mon, 17 Sep 2018 20:57:50 +0200 Subject: [PATCH] Reduced rate can also occur without implicit_header --- lib/decoder_impl.cc | 4 ++-- lib/decoder_impl.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/decoder_impl.cc b/lib/decoder_impl.cc index 6dacf84..3efc99b 100644 --- a/lib/decoder_impl.cc +++ b/lib/decoder_impl.cc @@ -830,7 +830,7 @@ namespace gr { //d_phy_crc = SM(decoded[1], 4, 0xf0) | MS(decoded[2], 0xf0, 4); // Calculate number of payload symbols needed - uint8_t redundancy = (d_sf > 10 ? 2 : 0); + uint8_t redundancy = ((d_sf > 10 || d_reduced_rate) ? 2 : 0); const int symbols_per_block = d_phdr.cr + 4u; const float bits_needed = float(d_payload_length) * 8.0f; const float symbols_needed = bits_needed * (symbols_per_block / 4.0f) / float(d_sf - redundancy); @@ -853,7 +853,7 @@ namespace gr { d_payload_symbols = 0; //d_demodulated.erase(d_demodulated.begin(), d_demodulated.begin() + 7u); // Test for SF 8 with header d_payload_length = (int32_t)(d_demodulated.size() / 2); - } else if (demodulate(input, d_implicit && d_reduced_rate)) { + } else if (demodulate(input, d_implicit || d_reduced_rate)) { if(!d_implicit) d_payload_symbols -= (4u + d_phdr.cr); } diff --git a/lib/decoder_impl.h b/lib/decoder_impl.h index 7272c2f..28febcf 100644 --- a/lib/decoder_impl.h +++ b/lib/decoder_impl.h @@ -297,7 +297,7 @@ namespace gr { * \param is_header * Whether the demodulated words were from the HDR. */ - bool demodulate(const gr_complex *samples, const bool is_header); + bool demodulate(const gr_complex *samples, const bool reduced_rate); /** * \brief Deinterleave the raw demodulated words by reversing the interleave pattern.