On Thu, Nov 06, 2008 at 05:06:28PM +0000, Jorg Lotze wrote:
> Hi,
> 
> I would like to know if it is possible with GNU Radio to have callbacks
> from a processing block into python to trigger a reconfiguration. A
> possible scenario is a radio which changes its receiver frequency when a
> the signal was lost (due to a change in the transmitter frequency). For
> example, if no frames are detected within a certain window, the deframer
> should be able to notify Python that this has happened, so that the
> appropriate reconfigurations can be performed.
> 
> What would be the way to do this in GNU Radio?
> 
> Thanks,
> Jorg

Callbacks are generally a bad idea in a multithreaded system.
You can accomplish your goal by creating a message queue that listened
to by python and having the GR block post a message to it when some
condition occurs.

Take a look at gnuradio-examples/python/usrp/digital.  The python code
receives messages when the C++ code has demodulated bits.  The basic
pattern is the same.

Eric


_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to