summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2013-02-17 10:21:55 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2013-02-17 10:21:55 -0800
commit45082a655dd333af50861b2c03d46c7d654e252c (patch)
tree09f3a92e8d4e1048fa92563d28e0c614abf4fce5 /gnuradio-core/src
parent9ca6c72a04991a0ec41afcc04b60a85eae52e921 (diff)
parent8b1d8bd78d21949c1812389986009f4f68f53981 (diff)
Merge branch 'master' into next
Conflicts: gnuradio-core/src/lib/io/gr_message_debug.cc gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/lib/io/gr_message_debug.cc10
-rw-r--r--gnuradio-core/src/lib/io/gr_message_debug.h13
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_pdu.py3
3 files changed, 21 insertions, 5 deletions
diff --git a/gnuradio-core/src/lib/io/gr_message_debug.cc b/gnuradio-core/src/lib/io/gr_message_debug.cc
index 5d889c9e05..07c0af1e34 100644
--- a/gnuradio-core/src/lib/io/gr_message_debug.cc
+++ b/gnuradio-core/src/lib/io/gr_message_debug.cc
@@ -59,10 +59,11 @@ gr_message_debug::store(pmt::pmt_t msg)
}
void
-gr_message_debug::print_verbose(pmt::pmt_t msg)
+gr_message_debug::print_pdu(pmt::pmt_t pdu)
{
- pmt::pmt_t meta = pmt::car(msg);
- pmt::pmt_t vector = pmt::cdr(msg);
+ pmt::pmt_t meta = pmt::car(pdu);
+ pmt::pmt_t vector = pmt::cdr(pdu);
+
std::cout << "* MESSAGE DEBUG PRINT PDU VERBOSE *\n";
pmt::print(meta);
size_t len = pmt::length(vector);
@@ -110,6 +111,9 @@ gr_message_debug::gr_message_debug()
message_port_register_in(pmt::mp("store"));
set_msg_handler(pmt::mp("store"), boost::bind(&gr_message_debug::store, this, _1));
+
+ message_port_register_in(pmt::mp("print_pdu"));
+ set_msg_handler(pmt::mp("print_pdu"), boost::bind(&gr_message_debug::print_pdu, this, _1));
}
gr_message_debug::~gr_message_debug()
diff --git a/gnuradio-core/src/lib/io/gr_message_debug.h b/gnuradio-core/src/lib/io/gr_message_debug.h
index 6e6e5103cb..f1374e8062 100644
--- a/gnuradio-core/src/lib/io/gr_message_debug.h
+++ b/gnuradio-core/src/lib/io/gr_message_debug.h
@@ -55,7 +55,18 @@ class GR_CORE_API gr_message_debug : public gr_block
* \param msg A pmt message passed from the scheduler's message handling.
*/
void print(pmt::pmt_t msg);
- void print_verbose(pmt::pmt_t msg);
+
+ /*!
+ * \brief PDU formatted messages received in this port are printed to stdout.
+ *
+ * This port receives messages from the scheduler's message handling
+ * mechanism and prints it to stdout. This message handler function
+ * is only meant to be used by the scheduler to handle messages
+ * posted to port 'print'.
+ *
+ * \param pdu A PDU message passed from the scheduler's message handling.
+ */
+ void print_pdu(pmt::pmt_t pdu);
/*!
* \brief Messages received in this port are stored in a vector.
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py b/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
index 59f927fa19..00aacdfb11 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
@@ -46,7 +46,8 @@ class test_pdu(gr_unittest.TestCase):
# Test that the right number of ports exist.
pi = dbg.message_ports_in()
po = dbg.message_ports_out()
- self.assertEqual(pmt.length(pi), 2)
+
+ self.assertEqual(pmt.length(pi), 3)
self.assertEqual(pmt.length(po), 0)
pi = snk3.message_ports_in()