[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] making gnuradio blocks entirely in python

From: Josh Blum
Subject: Re: [Discuss-gnuradio] making gnuradio blocks entirely in python
Date: Tue, 27 Sep 2011 08:14:39 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13

>> I want to support proper message passing. I noticed that I can register
>> a message handler to receive messages. Can you point me to how messages
>> are produced?
> So you basically need to create a callback function and set it as the
> message handler. So you call:
>      template <typename T> void set_msg_handler(T msg_handler){
>       d_msg_handler = msg_handler_t(msg_handler);
>     }
> Where d_msg_handler is of type:
>     typedef boost::function<void(pmt::pmt_t)> msg_handler_t;
> You then use gruel::send (in msg_passing.h) to a block that has a message
> acceptor handler defined (or not; if there is no handler, nothing happens).
> You can see gnuradio-core/src/lib/runtime/qa_set_msg_handler.cc  for an
> example of this.

I did my own digging last night, and found that gr_block inherits
gr_basic_block inherits gr_msg_accepter which has post(). So the
gruel::send is just a function to call this post() method.

So, there is nothing here that really deals with message propagation.
Message sending exists at the block level but not at the flow graph
level. Or am I am misunderstanding.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]