From d73f0bb850ae072598933357a67795acf8a0adb4 Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 24 Apr 2014 11:58:52 +0200 Subject: [PATCH] Removed get_ccch_bursts block --- grc/CMakeLists.txt | 2 - grc/gsm_get_ccch_bursts.xml | 16 ------ include/gsm/CMakeLists.txt | 1 - include/gsm/get_ccch_bursts.h | 56 -------------------- lib/CMakeLists.txt | 4 +- lib/get_ccch_bursts_impl.cc | 96 ----------------------------------- lib/get_ccch_bursts_impl.h | 44 ---------------- swig/gsm_swig.i | 4 +- 8 files changed, 2 insertions(+), 221 deletions(-) delete mode 100644 grc/gsm_get_ccch_bursts.xml delete mode 100644 include/gsm/get_ccch_bursts.h delete mode 100644 lib/get_ccch_bursts_impl.cc delete mode 100644 lib/get_ccch_bursts_impl.h diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt index 5c0ee65..2c73b8d 100644 --- a/grc/CMakeLists.txt +++ b/grc/CMakeLists.txt @@ -16,9 +16,7 @@ # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. - install(FILES gsm_receiver_hier.xml - gsm_get_ccch_bursts.xml gsm_bursts_printer.xml DESTINATION share/gnuradio/grc/blocks ) diff --git a/grc/gsm_get_ccch_bursts.xml b/grc/gsm_get_ccch_bursts.xml deleted file mode 100644 index ca96dcf..0000000 --- a/grc/gsm_get_ccch_bursts.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - get_ccch_bursts - gsm_get_ccch_bursts - GSM - import gsm - gsm.get_ccch_bursts() - - bursts_in - message - - - bursts_out - message - - diff --git a/include/gsm/CMakeLists.txt b/include/gsm/CMakeLists.txt index 746f718..c7f4fb3 100644 --- a/include/gsm/CMakeLists.txt +++ b/include/gsm/CMakeLists.txt @@ -23,6 +23,5 @@ install(FILES api.h receiver.h - get_ccch_bursts.h bursts_printer.h DESTINATION include/gsm ) diff --git a/include/gsm/get_ccch_bursts.h b/include/gsm/get_ccch_bursts.h deleted file mode 100644 index e0bbb1d..0000000 --- a/include/gsm/get_ccch_bursts.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2014 <+YOU OR YOUR COMPANY+>. - * - * This 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. - * - * This software 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 this software; 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_CCCH_BURSTS_H -#define INCLUDED_GSM_GET_CCCH_BURSTS_H - -#include -#include - -namespace gr { - namespace gsm { - - /*! - * \brief <+description of block+> - * \ingroup gsm - * - */ - class GSM_API get_ccch_bursts : virtual public gr::block - { - public: - typedef boost::shared_ptr sptr; - - /*! - * \brief Return a shared_ptr to a new instance of gsm::get_ccch_bursts. - * - * To avoid accidental use of raw pointers, gsm::get_ccch_bursts's - * constructor is in a private implementation - * class. gsm::get_ccch_bursts::make is the public interface for - * creating new instances. - */ - static sptr make(); - }; - - } // namespace gsm -} // namespace gr - -#endif /* INCLUDED_GSM_GET_CCCH_BURSTS_H */ - diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 38539da..99207d8 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -24,15 +24,13 @@ include(GrPlatform) #define LIB_SUFFIX include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIRS}) - list(APPEND gsm_sources receiver_impl.cc receiver_config.cc viterbi_detector.cc sch.c bursts_printer_impl.cc - get_ccch_bursts_impl.cc -) + ) add_library(gnuradio-gsm SHARED ${gsm_sources}) target_link_libraries(gnuradio-gsm ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} diff --git a/lib/get_ccch_bursts_impl.cc b/lib/get_ccch_bursts_impl.cc deleted file mode 100644 index 066382b..0000000 --- a/lib/get_ccch_bursts_impl.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2014 . - * - * This 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. - * - * This software 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 this software; 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 -#include "get_ccch_bursts_impl.h" -#include - -namespace gr { - namespace gsm { - - void get_ccch_bursts_impl::filter_ccch(pmt::pmt_t msg) - { - pmt::pmt_t header_blob = pmt::car(msg); - pmt::pmt_t content = pmt::cdr(msg); - gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_blob); - uint32_t frame_nr = header->frame_number; - uint32_t frame_numbers[4]; - uint32_t fn_mod51 = header->frame_number % 51; - - if(header->timeslot==0){ - if(fn_mod51>=2 && fn_mod51<=5){ - uint32_t ii = fn_mod51-2; - frame_numbers[ii]=header->frame_number; - d_msgs[ii] = msg; - } - - if(fn_mod51==5){ - //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((frame_numbers[jj]-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_out"), d_msgs[jj]); - } - } - } - } - } - - get_ccch_bursts::sptr - get_ccch_bursts::make() - { - return gnuradio::get_initial_sptr - (new get_ccch_bursts_impl()); - } - - /* - * The private constructor - */ - get_ccch_bursts_impl::get_ccch_bursts_impl() - : gr::block("get_ccch_bursts", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(0, 0, 0)) - { - message_port_register_in(pmt::mp("bursts_in")); - set_msg_handler(pmt::mp("bursts_in"), boost::bind(&get_ccch_bursts_impl::filter_ccch, this, _1)); - message_port_register_out(pmt::mp("bursts_out")); - } - - /* - * Our virtual destructor. - */ - get_ccch_bursts_impl::~get_ccch_bursts_impl() - { - } - - } /* namespace gsm */ -} /* namespace gr */ - diff --git a/lib/get_ccch_bursts_impl.h b/lib/get_ccch_bursts_impl.h deleted file mode 100644 index c0e7dd9..0000000 --- a/lib/get_ccch_bursts_impl.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2014 <+YOU OR YOUR COMPANY+>. - * - * This 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. - * - * This software 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 this software; 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_CCCH_BURSTS_IMPL_H -#define INCLUDED_GSM_GET_CCCH_BURSTS_IMPL_H - -#include -#include - -namespace gr { - namespace gsm { - - class get_ccch_bursts_impl : public get_ccch_bursts - { - private: - pmt::pmt_t d_bursts[4]; - public: - get_ccch_bursts_impl(); - ~get_ccch_bursts_impl(); - void filter_ccch(pmt::pmt_t msg); - }; - - } // namespace gsm -} // namespace gr - -#endif /* INCLUDED_GSM_GET_CCCH_BURSTS_IMPL_H */ - diff --git a/swig/gsm_swig.i b/swig/gsm_swig.i index fd0751b..12f48a4 100644 --- a/swig/gsm_swig.i +++ b/swig/gsm_swig.i @@ -10,7 +10,6 @@ %{ #include "gsm/receiver.h" #include "gsm/bursts_printer.h" -#include "gsm/get_ccch_bursts.h" %} @@ -18,5 +17,4 @@ GR_SWIG_BLOCK_MAGIC2(gsm, receiver); %include "gsm/bursts_printer.h" GR_SWIG_BLOCK_MAGIC2(gsm, bursts_printer); -%include "gsm/get_ccch_bursts.h" -GR_SWIG_BLOCK_MAGIC2(gsm, get_ccch_bursts); +