summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/general
diff options
context:
space:
mode:
authorJohnathan Corgan2012-12-01 13:49:33 -0800
committerJohnathan Corgan2012-12-01 13:49:33 -0800
commit5dc1ccc01120a6f32f83f5e5fa79bc34b83f1619 (patch)
treebf641dd9f9ed0ed13a202fe25be1480a75f5fe25 /gnuradio-core/src/lib/general
parent6cc818260128df57c51a41e4e6aa459de5faf4fe (diff)
downloadgnuradio-5dc1ccc01120a6f32f83f5e5fa79bc34b83f1619.tar.gz
gnuradio-5dc1ccc01120a6f32f83f5e5fa79bc34b83f1619.tar.bz2
gnuradio-5dc1ccc01120a6f32f83f5e5fa79bc34b83f1619.zip
core: cleanup on pdu/msg blocks
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r--gnuradio-core/src/lib/general/gr_message_strobe.cc18
-rw-r--r--gnuradio-core/src/lib/general/gr_message_strobe.h15
2 files changed, 11 insertions, 22 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 */