From 6cc818260128df57c51a41e4e6aa459de5faf4fe Mon Sep 17 00:00:00 2001
From: Tim O'Shea
Date: Fri, 30 Nov 2012 22:31:43 -0800
Subject: core: gr_blocks can now have only message ports with no
 general_work()

* msg only blocks now get thread context

* added blocking msg queue delete call

* added gr_message_strobe block

* added grc definitions for message_debug, message_strobe, pdu_to_tagged_stream, tagged_stream_to_pdu.

* allow message fan-in connections in GRC
---
 gnuradio-core/src/lib/io/gr_message_debug.cc        | 4 +++-
 gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.cc | 7 ++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

(limited to 'gnuradio-core/src/lib/io')

diff --git a/gnuradio-core/src/lib/io/gr_message_debug.cc b/gnuradio-core/src/lib/io/gr_message_debug.cc
index 84c11c46e..99f4a1f7b 100644
--- a/gnuradio-core/src/lib/io/gr_message_debug.cc
+++ b/gnuradio-core/src/lib/io/gr_message_debug.cc
@@ -44,8 +44,9 @@ gr_make_message_debug ()
 }
 
 void gr_message_debug::print(pmt::pmt_t msg){
-    std::cout << "******* DEBUG PRINT ********\n";
+    std::cout << "******* MESSAGE DEBUG PRINT ********\n";
     pmt::pmt_print(msg);
+    std::cout << "************************************\n";
 }
 
 
@@ -67,5 +68,6 @@ 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_pdu_to_tagged_stream.cc b/gnuradio-core/src/lib/io/gr_pdu_to_tagged_stream.cc
index 26c1babd6..06a1c9596 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
@@ -77,7 +77,8 @@ gr_pdu_to_tagged_stream::work(int noutput_items,
   if(noutput_items > 0){
 
     // grab a message if one exists
-    pmt::pmt_t msg( delete_head_nowait( pdu_port_id ) );
+    //pmt::pmt_t msg( delete_head_nowait( pdu_port_id ) );
+    pmt::pmt_t msg( delete_head_blocking( pdu_port_id ) );
     if(msg.get() == NULL ){
         return nout;
         }
@@ -87,8 +88,8 @@ gr_pdu_to_tagged_stream::work(int noutput_items,
         throw std::runtime_error("received a malformed pdu message!");
         }
    
-    printf("got a msg\n");
-    pmt::pmt_print(msg);
+//    printf("got a msg\n");
+//    pmt::pmt_print(msg);
  
     // grab the components of the pdu message
     pmt::pmt_t meta(pmt::pmt_car(msg)); // make sure this is NIL || Dict ?
-- 
cgit