diff options
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_message_strobe.cc | 18 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_message_strobe.h | 15 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_message_debug.cc | 17 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_message_debug.h | 12 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_message_debug.i | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_pdu.cc | 36 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_pdu.h | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.cc | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.h | 4 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.i | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.cc | 12 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.h | 4 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.i | 2 |
13 files changed, 64 insertions, 64 deletions
diff --git a/gnuradio-core/src/lib/general/gr_message_strobe.cc b/gnuradio-core/src/lib/general/gr_message_strobe.cc index 371f472ef..6a9f807d1 100644 --- a/gnuradio-core/src/lib/general/gr_message_strobe.cc +++ b/gnuradio-core/src/lib/general/gr_message_strobe.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -44,9 +44,9 @@ gr_make_message_strobe (pmt::pmt_t msg, float period_ms) } gr_message_strobe::gr_message_strobe (pmt::pmt_t msg, float period_ms) - : gr_sync_block("message_strobe", - gr_make_io_signature(0, 0, 0), - gr_make_io_signature(0, 0, 0)), + : gr_block("message_strobe", + gr_make_io_signature(0, 0, 0), + gr_make_io_signature(0, 0, 0)), d_finished(false), d_period_ms(period_ms), d_msg(msg) @@ -69,15 +69,7 @@ void gr_message_strobe::run(){ while(!d_finished) { boost::this_thread::sleep(boost::posix_time::milliseconds(d_period_ms)); if(d_finished){ return; } -// std::cout << "strobing...\n"; + message_port_pub( pmt::mp("strobe"), d_msg ); } } - -int -gr_message_strobe::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - return 0; // FIXME: replace with default NOP work function in gr_block -} diff --git a/gnuradio-core/src/lib/general/gr_message_strobe.h b/gnuradio-core/src/lib/general/gr_message_strobe.h index a5151a30b..89046ffc0 100644 --- a/gnuradio-core/src/lib/general/gr_message_strobe.h +++ b/gnuradio-core/src/lib/general/gr_message_strobe.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,7 +24,7 @@ #define INCLUDED_GR_MESSAGE_STROBE_H #include <gr_core_api.h> -#include <gr_sync_block.h> +#include <gr_block.h> #include <gr_message.h> #include <gr_msg_queue.h> @@ -34,14 +34,15 @@ typedef boost::shared_ptr<gr_message_strobe> gr_message_strobe_sptr; GR_CORE_API gr_message_strobe_sptr gr_make_message_strobe (pmt::pmt_t msg, float period_ms); /*! - * \brief Gather received items into messages and insert into msgq - * \ingroup sink_blk + * \brief Send message at defined interval + * \ingroup msg_blk */ -class GR_CORE_API gr_message_strobe : public gr_sync_block +class GR_CORE_API gr_message_strobe : public gr_block { private: friend GR_CORE_API gr_message_strobe_sptr gr_make_message_strobe(pmt::pmt_t msg, float period_ms); + boost::shared_ptr<boost::thread> d_thread; bool d_finished; float d_period_ms; @@ -56,10 +57,6 @@ class GR_CORE_API gr_message_strobe : public gr_sync_block ~gr_message_strobe (); void set_msg(pmt::pmt_t msg){ d_msg = msg; } - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_MESSAGE_STROBE_H */ diff --git a/gnuradio-core/src/lib/io/gr_message_debug.cc b/gnuradio-core/src/lib/io/gr_message_debug.cc index 99f4a1f7b..d98954576 100644 --- a/gnuradio-core/src/lib/io/gr_message_debug.cc +++ b/gnuradio-core/src/lib/io/gr_message_debug.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010 Free Software Foundation, Inc. + * Copyright 2005,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -51,9 +51,9 @@ void gr_message_debug::print(pmt::pmt_t msg){ gr_message_debug::gr_message_debug () - : gr_sync_block("message_debug", - gr_make_io_signature(0, 0, 0), - gr_make_io_signature(0, 0, 0)) + : gr_block("message_debug", + gr_make_io_signature(0, 0, 0), + gr_make_io_signature(0, 0, 0)) { message_port_register_in(pmt::mp("print")); set_msg_handler(pmt::mp("print"), boost::bind(&gr_message_debug::print, this, _1)); @@ -62,12 +62,3 @@ gr_message_debug::gr_message_debug () gr_message_debug::~gr_message_debug() { } - -int -gr_message_debug::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - printf("gr_message_debug::work\n"); - return 0; // FIXME: replace with default NOP work function in gr_block -} diff --git a/gnuradio-core/src/lib/io/gr_message_debug.h b/gnuradio-core/src/lib/io/gr_message_debug.h index 37d8b7a4d..120694a91 100644 --- a/gnuradio-core/src/lib/io/gr_message_debug.h +++ b/gnuradio-core/src/lib/io/gr_message_debug.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,7 +24,7 @@ #define INCLUDED_GR_MESSAGE_DEBUG_H #include <gr_core_api.h> -#include <gr_sync_block.h> +#include <gr_block.h> #include <gr_message.h> #include <gr_msg_queue.h> @@ -34,10 +34,10 @@ typedef boost::shared_ptr<gr_message_debug> gr_message_debug_sptr; GR_CORE_API gr_message_debug_sptr gr_make_message_debug (); /*! - * \brief Gather received items into messages and insert into msgq + * \brief Print received messages to stdout * \ingroup sink_blk */ -class GR_CORE_API gr_message_debug : public gr_sync_block +class GR_CORE_API gr_message_debug : public gr_block { private: friend GR_CORE_API gr_message_debug_sptr @@ -50,10 +50,6 @@ class GR_CORE_API gr_message_debug : public gr_sync_block public: ~gr_message_debug (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_MESSAGE_DEBUG_H */ diff --git a/gnuradio-core/src/lib/io/gr_message_debug.i b/gnuradio-core/src/lib/io/gr_message_debug.i index 7bd547c91..65d3bfc4a 100644 --- a/gnuradio-core/src/lib/io/gr_message_debug.i +++ b/gnuradio-core/src/lib/io/gr_message_debug.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/io/gr_pdu.cc b/gnuradio-core/src/lib/io/gr_pdu.cc index c5290b610..f33eed0a3 100644 --- a/gnuradio-core/src/lib/io/gr_pdu.cc +++ b/gnuradio-core/src/lib/io/gr_pdu.cc @@ -1,7 +1,33 @@ +/* -*- 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_pdu.h> -size_t gr_pdu_itemsize(gr_pdu_vector_type type){ +size_t +gr_pdu_itemsize(gr_pdu_vector_type type){ switch(type){ case BYTE: return 1; @@ -14,7 +40,8 @@ size_t gr_pdu_itemsize(gr_pdu_vector_type type){ } } -bool gr_pdu_type_matches(gr_pdu_vector_type type, pmt::pmt_t v){ +bool +gr_pdu_type_matches(gr_pdu_vector_type type, pmt::pmt_t v){ switch(type){ case BYTE: return pmt::pmt_is_u8vector(v); @@ -27,7 +54,8 @@ bool gr_pdu_type_matches(gr_pdu_vector_type type, pmt::pmt_t v){ } } -pmt::pmt_t gr_pdu_make_vector(gr_pdu_vector_type type, const uint8_t* buf, size_t items){ +pmt::pmt_t +gr_pdu_make_vector(gr_pdu_vector_type type, const uint8_t* buf, size_t items){ switch(type){ case BYTE: return pmt::pmt_init_u8vector(items, buf); @@ -39,5 +67,3 @@ pmt::pmt_t gr_pdu_make_vector(gr_pdu_vector_type type, const uint8_t* buf, size_ throw std::runtime_error("bad type!"); } } - - diff --git a/gnuradio-core/src/lib/io/gr_pdu.h b/gnuradio-core/src/lib/io/gr_pdu.h index 3bea83740..67519c89d 100644 --- a/gnuradio-core/src/lib/io/gr_pdu.h +++ b/gnuradio-core/src/lib/io/gr_pdu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.cc b/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.cc index 06a1c9596..5c319dc39 100644 --- a/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.cc +++ b/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.h b/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.h index 3eb2a078b..3105a3d38 100644 --- a/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.h +++ b/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -42,7 +42,7 @@ class GR_CORE_API gr_pdu_to_tagged_stream : public gr_sync_block { private: gr_pdu_vector_type d_vectortype; - size_t d_itemsize; + size_t d_itemsize; std::vector<uint8_t> d_remain; friend GR_CORE_API gr_pdu_to_tagged_stream_sptr diff --git a/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.i b/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.i index ddf1d8c05..ec760b309 100644 --- a/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.i +++ b/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.cc b/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.cc index 05ed8adc0..8211b7672 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.cc +++ b/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -34,8 +34,6 @@ #include <stdexcept> #include <string.h> - - // public constructor that returns a shared_ptr gr_tagged_stream_to_pdu_sptr @@ -51,18 +49,18 @@ gr_tagged_stream_to_pdu::gr_tagged_stream_to_pdu (gr_pdu_vector_type t) d_vectortype(t), d_itemsize(gr_pdu_itemsize(t)), d_inpdu(false), d_pdu_meta(pmt::PMT_NIL), d_pdu_vector(pmt::PMT_NIL) { - message_port_register_out(pdu_port_id); + message_port_register_out(pdu_port_id); } gr_tagged_stream_to_pdu::~gr_tagged_stream_to_pdu() { - printf("destructor running\n"); + printf("destructor running\n"); } int gr_tagged_stream_to_pdu::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const uint8_t *in = (const uint8_t*) input_items[0]; uint64_t abs_N = nitems_read(0); diff --git a/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.h b/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.h index 6a40e1c0c..c3fff3581 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.h +++ b/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -42,7 +42,7 @@ class GR_CORE_API gr_tagged_stream_to_pdu : public gr_sync_block { private: gr_pdu_vector_type d_vectortype; - size_t d_itemsize; + size_t d_itemsize; std::vector<uint8_t> d_save; diff --git a/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.i b/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.i index 66bd875aa..f12987b74 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.i +++ b/gnuradio-core/src/lib/io/gr_tagged_stream_to_pdu.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * |