Kartik, As far as I am aware, hierarchical blocks cannot process messages. I ran into the same issue, because I had a hierarchical block with several child blocks, and it needed to do some control operations to the child blocks dependent on a received message, without those blocks "understanding" or caring about the contents of the message.
My workaround was to create a new variety of block that did nothing but receive arbitrary messages, and then routed them back up to the hierarchical block by calling a function in the hierarchical block. It is kludgey, but it works. There are definitely use cases for having message handlers in hierarchical blocks, but I don't know the underlying code well enough to know if it would be straightforward to add message handling support to standard hierarchical blocks. Joe -----Original Message----- Sent: Wednesday, January 27, 2016 10:46 AM To: [email protected] Subject: [Discuss-gnuradio] Message Input port in hierarchical block Hi, I have a hierarchical block generated via GRC with no input or output message port. Now I add a message port by changing python code for some control functionality using: self.message_port_register_hier_in("test") Now generally in sync or other blocks we can bind this "test" port to a handler function like: self.set_msg_handler(pmt.intern("test"),self.handler) The problem is that there is no such function for hierarchical blocks in gr.hier_block2 class So how can I process message data coming in at this port ? Please excuse if I have missed something. Kartik -- View this message in context: http://gnuradio.4.n7.nabble.com/Message-Input-port-in-hierarchical-block-tp5 7896.html Sent from the GnuRadio mailing list archive at Nabble.com. _______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio _______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
