diff options
-rw-r--r-- | grc/demapping/CMakeLists.txt | 1 | ||||
-rw-r--r-- | grc/demapping/gsm_get_bcch_or_ccch_bursts.xml | 22 | ||||
-rw-r--r-- | grc/gsm_block_tree.xml | 1 | ||||
-rw-r--r-- | include/grgsm/demapping/CMakeLists.txt | 3 | ||||
-rw-r--r-- | include/grgsm/demapping/get_bcch_or_ccch_bursts.h | 58 | ||||
-rw-r--r-- | lib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | lib/demapping/get_bcch_or_ccch_bursts_impl.cc | 102 | ||||
-rw-r--r-- | lib/demapping/get_bcch_or_ccch_bursts_impl.h | 47 | ||||
-rw-r--r-- | swig/grgsm_swig.i | 3 |
9 files changed, 1 insertions, 237 deletions
diff --git a/grc/demapping/CMakeLists.txt b/grc/demapping/CMakeLists.txt index a057d19..6d5e673 100644 --- a/grc/demapping/CMakeLists.txt +++ b/grc/demapping/CMakeLists.txt @@ -18,6 +18,5 @@ # Boston, MA 02110-1301, USA. install(FILES - gsm_get_bcch_or_ccch_bursts.xml gsm_universal_ctrl_chans_demapper.xml DESTINATION share/gnuradio/grc/blocks ) diff --git a/grc/demapping/gsm_get_bcch_or_ccch_bursts.xml b/grc/demapping/gsm_get_bcch_or_ccch_bursts.xml deleted file mode 100644 index cbc61a7..0000000 --- a/grc/demapping/gsm_get_bcch_or_ccch_bursts.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>Demapper for BCCH and CCCH</name> - <key>gsm_get_bcch_or_ccch_bursts</key> - <import>import grgsm</import> - <make>grgsm.get_bcch_or_ccch_bursts($d_fn51_start)</make> - <param> - <name>d_fn51_start</name> - <key>d_fn51_start</key> - <value>2</value> - <type>int</type> - </param> - - <sink> - <name>bursts</name> - <type>message</type> - </sink> - <source> - <name>bursts</name> - <type>message</type> - </source> -</block> diff --git a/grc/gsm_block_tree.xml b/grc/gsm_block_tree.xml index ebe2b13..d5b822b 100644 --- a/grc/gsm_block_tree.xml +++ b/grc/gsm_block_tree.xml @@ -21,7 +21,6 @@ </cat> <cat> <name>Logical channels demapping</name> - <block>gsm_get_bcch_or_ccch_bursts</block> <block>gsm_universal_ctrl_chans_demapper</block> </cat> <cat> diff --git a/include/grgsm/demapping/CMakeLists.txt b/include/grgsm/demapping/CMakeLists.txt index 912df3b..c451c3e 100644 --- a/include/grgsm/demapping/CMakeLists.txt +++ b/include/grgsm/demapping/CMakeLists.txt @@ -21,6 +21,5 @@ # Install public header files ######################################################################## install(FILES - universal_ctrl_chans_demapper.h - get_bcch_or_ccch_bursts.h DESTINATION include/grgsm/demapping + universal_ctrl_chans_demapper.h DESTINATION include/grgsm/demapping ) diff --git a/include/grgsm/demapping/get_bcch_or_ccch_bursts.h b/include/grgsm/demapping/get_bcch_or_ccch_bursts.h deleted file mode 100644 index 3745993..0000000 --- a/include/grgsm/demapping/get_bcch_or_ccch_bursts.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * @file - * @author Piotr Krysik <ptrkrysik@gmail.com> - * @section LICENSE - * - * Gr-gsm is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * Gr-gsm is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gr-gsm; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - - -#ifndef INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_H -#define INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_H - -#include <grgsm/api.h> -#include <gnuradio/block.h> - -namespace gr { - namespace gsm { - - /*! - * \brief <+description of block+> - * \ingroup gsm - * - */ - class GSM_API get_bcch_or_ccch_bursts : virtual public gr::block - { - public: - typedef boost::shared_ptr<get_bcch_or_ccch_bursts> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of gsm::get_bcch_or_ccch_bursts. - * - * To avoid accidental use of raw pointers, gsm::get_bcch_or_ccch_bursts's - * constructor is in a private implementation - * class. gsm::get_bcch_or_ccch_bursts::make is the public interface for - * creating new instances. - */ - static sptr make(unsigned int fn51_start); - }; - - } // namespace gsm -} // namespace gr - -#endif /* INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_H */ - diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c89bf26..feaf807 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -32,7 +32,6 @@ list(APPEND gsm_sources misc_utils/bursts_printer_impl.cc misc_utils/extract_system_info_impl.cc demapping/universal_ctrl_chans_demapper_impl.cc - demapping/get_bcch_or_ccch_bursts_impl.cc decoding/control_channels_decoder_impl.cc decoding/cch.c decoding/fire_crc.c diff --git a/lib/demapping/get_bcch_or_ccch_bursts_impl.cc b/lib/demapping/get_bcch_or_ccch_bursts_impl.cc deleted file mode 100644 index 5817627..0000000 --- a/lib/demapping/get_bcch_or_ccch_bursts_impl.cc +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- c++ -*- */ -/* - * @file - * @author Piotr Krysik <ptrkrysik@gmail.com> - * @section LICENSE - * - * Gr-gsm is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * Gr-gsm is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gr-gsm; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gnuradio/io_signature.h> -#include <grgsm/endian.h> -#include <grgsm/gsmtap.h> -#include "get_bcch_or_ccch_bursts_impl.h" - -namespace gr { - namespace gsm { - - get_bcch_or_ccch_bursts::sptr - get_bcch_or_ccch_bursts::make(unsigned int fn51_start) - { - return gnuradio::get_initial_sptr - (new get_bcch_or_ccch_bursts_impl(fn51_start)); - } - - /* - * The private constructor - */ - get_bcch_or_ccch_bursts_impl::get_bcch_or_ccch_bursts_impl(unsigned int fn51_start) - : gr::block("get_bcch_or_ccch_bursts", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(0, 0, 0)), - d_fn51_start(fn51_start) - { - message_port_register_in(pmt::mp("bursts")); - set_msg_handler(pmt::mp("bursts"), boost::bind(&get_bcch_or_ccch_bursts_impl::filter_ccch, this, _1)); - message_port_register_out(pmt::mp("bursts")); - } - - /* - * Our virtual destructor. - */ - get_bcch_or_ccch_bursts_impl::~get_bcch_or_ccch_bursts_impl() - { - } - - void get_bcch_or_ccch_bursts_impl::filter_ccch(pmt::pmt_t msg) - { - pmt::pmt_t header_plus_burst = pmt::cdr(msg); - gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_plus_burst); - uint32_t frame_nr = be32toh(header->frame_number); - - uint32_t fn_mod51 = frame_nr % 51; - int fn51_stop = d_fn51_start+3; - - if(header->timeslot==0){ - if(fn_mod51>=d_fn51_start && fn_mod51<=fn51_stop){ - uint32_t ii = fn_mod51-d_fn51_start; - d_frame_numbers[ii]=frame_nr; - d_bursts[ii] = msg; - } - - if(fn_mod51==fn51_stop){ - //check for a situation where some BCCH bursts were lost - //in this situation frame numbers won't be consecutive - bool frames_are_consecutive = true; - for(int jj=1; jj<4; jj++) - { - if((d_frame_numbers[jj]-d_frame_numbers[jj-1])!=1){ - frames_are_consecutive = false; - } - } - if(frames_are_consecutive) - { - //send bursts to the output - for(int jj=0; jj<4; jj++) - { - message_port_pub(pmt::mp("bursts"), d_bursts[jj]); - } - } - } - } - } - } /* namespace gsm */ -} /* namespace gr */ - diff --git a/lib/demapping/get_bcch_or_ccch_bursts_impl.h b/lib/demapping/get_bcch_or_ccch_bursts_impl.h deleted file mode 100644 index ebf63e3..0000000 --- a/lib/demapping/get_bcch_or_ccch_bursts_impl.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * @file - * @author Piotr Krysik <ptrkrysik@gmail.com> - * @section LICENSE - * - * Gr-gsm is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * Gr-gsm is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gr-gsm; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_IMPL_H -#define INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_IMPL_H - -#include <grgsm/demapping/get_bcch_or_ccch_bursts.h> - -namespace gr { - namespace gsm { - - class get_bcch_or_ccch_bursts_impl : public get_bcch_or_ccch_bursts - { - private: - unsigned int d_fn51_start; - uint32_t d_frame_numbers[4]; - pmt::pmt_t d_bursts[4]; - public: - get_bcch_or_ccch_bursts_impl(unsigned int fn51_start); - ~get_bcch_or_ccch_bursts_impl(); - void filter_ccch(pmt::pmt_t msg); - }; - - } // namespace gsm -} // namespace gr - -#endif /* INCLUDED_GSM_GET_BCCH_OR_CCCH_BURSTS_IMPL_H */ - diff --git a/swig/grgsm_swig.i b/swig/grgsm_swig.i index acb99f2..52b7d88 100644 --- a/swig/grgsm_swig.i +++ b/swig/grgsm_swig.i @@ -11,7 +11,6 @@ #include "grgsm/receiver/receiver.h" #include "grgsm/decoding/control_channels_decoder.h" #include "grgsm/decryption/decryption.h" -#include "grgsm/demapping/get_bcch_or_ccch_bursts.h" #include "grgsm/demapping/universal_ctrl_chans_demapper.h" #include "grgsm/misc_utils/bursts_printer.h" #include "grgsm/misc_utils/controlled_const_source_f.h" @@ -31,8 +30,6 @@ GR_SWIG_BLOCK_MAGIC2(gsm, control_channels_decoder); %include "grgsm/decryption/decryption.h" GR_SWIG_BLOCK_MAGIC2(gsm, decryption); -%include "grgsm/demapping/get_bcch_or_ccch_bursts.h" -GR_SWIG_BLOCK_MAGIC2(gsm, get_bcch_or_ccch_bursts); %include "grgsm/demapping/universal_ctrl_chans_demapper.h" GR_SWIG_BLOCK_MAGIC2(gsm, universal_ctrl_chans_demapper); |