discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] callbacks from gr block into python for reconfigu


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] callbacks from gr block into python for reconfiguration
Date: Thu, 6 Nov 2008 09:40:45 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

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




reply via email to

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