diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2013-02-28 14:39:50 -0800 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-02-28 14:39:50 -0800 |
commit | ff9e66ad7c9f22bf2741e760940bb6609848ede8 (patch) | |
tree | 2e8d51f764a2d6266c1a6c89bb0d3ce034585b04 /gnuradio-core/src/lib/general | |
parent | 1d093decc5bf37b8d173ce7769a14af6765f45a6 (diff) |
core: removed PDU related blocks
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r-- | gnuradio-core/src/lib/general/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/general.i | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_random_pdu.cc | 85 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_random_pdu.h | 64 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_random_pdu.i | 30 |
5 files changed, 0 insertions, 182 deletions
diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index b844cf302c..12e0bf0346 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -164,7 +164,6 @@ set(gr_core_general_triple_threats gr_null_source gr_pa_2x2_phase_combiner gr_prefs - gr_random_pdu gr_remez gr_skiphead gr_test diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index ff4c95631b..04d524ee5c 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -38,7 +38,6 @@ //#include <gr_endianness.h> #include <gr_endian_swap.h> #include <gr_firdes.h> -#include <gr_random_pdu.h> #include <gr_fake_channel_coder_pp.h> #include <gr_vco_f.h> #include <gr_pa_2x2_phase_combiner.h> @@ -76,7 +75,6 @@ //%include "gr_endianness.i" %include "gr_endian_swap.i" %include "gr_firdes.i" -%include "gr_random_pdu.i" %include "gr_fake_channel_coder_pp.i" %include "gr_vco_f.i" %include "gr_pa_2x2_phase_combiner.i" diff --git a/gnuradio-core/src/lib/general/gr_random_pdu.cc b/gnuradio-core/src/lib/general/gr_random_pdu.cc deleted file mode 100644 index 746f8944a2..0000000000 --- a/gnuradio-core/src/lib/general/gr_random_pdu.cc +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio 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. - * - * GNU Radio 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 GNU Radio; 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 <gr_random_pdu.h> -#include <gr_io_signature.h> -#include <cstdio> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <stdexcept> -#include <string.h> -#include <iostream> -#include <vector> - -// public constructor that returns a shared_ptr - -gr_random_pdu_sptr -gr_make_random_pdu (int items_min, int items_max) -{ - return gnuradio::get_initial_sptr(new gr_random_pdu(items_min, items_max)); -} - -gr_random_pdu::gr_random_pdu (int items_min, int items_max) - : gr_block("random_pdu", - gr_make_io_signature(0, 0, 0), - gr_make_io_signature(0, 0, 0)), - urange(items_min, items_max), - brange(0, 255), - rvar(rng, urange), - bvar(rng, brange) -{ - message_port_register_out(pmt::mp("pdus")); - message_port_register_in(pmt::mp("generate")); - set_msg_handler(pmt::mp("generate"), boost::bind(&gr_random_pdu::generate_pdu, this, _1)); -} - -bool gr_random_pdu::start(){ - output_random(); - return true; -} - -void gr_random_pdu::output_random(){ - - // pick a random vector length - int len = rvar(); - - // fill it with random bytes - std::vector<unsigned char> vec; - for(int i=0; i<len; i++){ - vec.push_back((unsigned char) bvar()); - } - - // send the vector - pmt::pmt_t vecpmt( pmt::make_blob( &vec[0], len ) ); - pmt::pmt_t pdu( pmt::cons( pmt::PMT_NIL, vecpmt ) ); - - message_port_pub( pmt::mp("pdus"), pdu ); - - std::cout << "sending new random vector of length " << len << "\n"; -} - diff --git a/gnuradio-core/src/lib/general/gr_random_pdu.h b/gnuradio-core/src/lib/general/gr_random_pdu.h deleted file mode 100644 index e6457d21b6..0000000000 --- a/gnuradio-core/src/lib/general/gr_random_pdu.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio 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. - * - * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_RANDOM_PDU_H -#define INCLUDED_GR_RANDOM_PDU_H - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gr_message.h> -#include <gr_msg_queue.h> - -#include <boost/random.hpp> -#include <boost/generator_iterator.hpp> - -class gr_random_pdu; -typedef boost::shared_ptr<gr_random_pdu> gr_random_pdu_sptr; - -GR_CORE_API gr_random_pdu_sptr gr_make_random_pdu (int mintime, int maxtime); - -/*! - * \brief Send message at defined interval - * \ingroup msg_blk - */ -class GR_CORE_API gr_random_pdu : public gr_block -{ - private: - friend GR_CORE_API gr_random_pdu_sptr - gr_make_random_pdu(int mintime, int maxtime); - - void output_random(); - - boost::mt19937 rng; - boost::uniform_int<> urange; - boost::uniform_int<> brange; - boost::variate_generator< boost::mt19937, boost::uniform_int<> > rvar; // pdu length - boost::variate_generator< boost::mt19937, boost::uniform_int<> > bvar; // pdu contents - - public: - gr_random_pdu (int, int); - bool start(); - void generate_pdu(pmt::pmt_t msg){ output_random(); } - void generate_pdu(){ output_random(); } -}; - -#endif /* INCLUDED_GR_RANDOM_PDU_H */ diff --git a/gnuradio-core/src/lib/general/gr_random_pdu.i b/gnuradio-core/src/lib/general/gr_random_pdu.i deleted file mode 100644 index 045a330605..0000000000 --- a/gnuradio-core/src/lib/general/gr_random_pdu.i +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio 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. - * - * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,random_pdu); - -%{ -#include <gr_random_pdu.h> -%} - -%include "gr_random_pdu.h" - |