aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decoding/control_channels_decoder_impl.cc
diff options
context:
space:
mode:
authorVasil Velichkov <vvvelichkov@gmail.com>2018-03-27 02:37:49 +0300
committerPiotr Krysik <ptrkrysik@gmail.com>2018-03-30 22:34:52 +0200
commitbc2a23e0e7454fcba9770644055ac4d048db61e5 (patch)
treec2207171341d937738695fd2e1812a37370ab494 /lib/decoding/control_channels_decoder_impl.cc
parent7476868d8ea79c6ba8944bb84d425afb35d5e1db (diff)
Check the gsm0503_xcch_decode return value
- Discard the message when gsm0503_xcch_decode returns -1 - Add automated decrypt test See https://groups.google.com/d/msg/gr-gsm/9nOkIdrGOck/qTZh47McCQAJ
Diffstat (limited to 'lib/decoding/control_channels_decoder_impl.cc')
-rw-r--r--lib/decoding/control_channels_decoder_impl.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc
index a6abaa3..bf0d976 100644
--- a/lib/decoding/control_channels_decoder_impl.cc
+++ b/lib/decoding/control_channels_decoder_impl.cc
@@ -105,7 +105,11 @@ namespace gr {
//convert to soft bits
ubits2sbits(bursts_u, bursts_s, 116 * 4);
//decode
- gsm0503_xcch_decode(result, bursts_s, &n_errors, &n_bits_total);
+ if (-1 == gsm0503_xcch_decode(result, bursts_s, &n_errors, &n_bits_total))
+ {
+ //Possibly an encrypted message
+ return;
+ }
//extract header of the first burst of the four bursts
pmt::pmt_t first_header_plus_burst = pmt::cdr(d_bursts[0]);