discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] lock and unlock with transmith_path and receive_


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] lock and unlock with transmith_path and receive_path‏
Date: Mon, 8 Feb 2010 15:33:03 -0800
User-agent: Mutt/1.5.20 (2009-08-17)

On Sun, Jan 24, 2010 at 02:21:12PM +0100, Carlo Donato Lecce wrote:
> 
> Hello all,
> 
> 
> I seem that using transmit_path and receive_path the reconfigure 
> of flow graph is bad.
> The following code hung after the call of unlock. 
> 
> I think that there are a bugs in the transmit_path because 
> using a gr.null_source insted of transmit_path the program not hangs.
> 
> Thanks, 
> 
> 
> Carlo. 

Carlo,

It looks like you're missing the calls to connect that would have your
top block know about the nested blocks.

See below.

Eric


> from gnuradio import gr, gru, modulation_utils
> from gnuradio import eng_notation
> from gnuradio.eng_option import eng_option
> from optparse import OptionParser
> 
> import random, time, struct, sys, math
> 
> # from current dir
> from transmit_path import transmit_path
> from receive_path import receive_path
> 
>  
> class h_block(gr.hier_block2):
>      def __init__(self):
>          gr.hier_block2.__init__(self, "hello", gr.io_signature(0, 0, 0), 
> gr.io_signature(0, 0, 0))
>  
> class top_block(gr.top_block):
>      def __init__(self, mod_class, demod_class, rx_callback, options):
>          gr.top_block.__init__(self)
> 
>          self.txpath = transmit_path(mod_class, options)
>          self.rxpath = receive_path(demod_class, rx_callback, options)

Try adding:

           self.connect(self.txpath)
           self.connect(self.rxpath)

here.  See also tunnel.py


>          self.source = gr.null_source(gr.sizeof_gr_complex)
>          self.sink = gr.null_sink(gr.sizeof_gr_complex)
> 
> 
>          self.connect(self.txpath, self.sink)
>         # self.connect(self.source2, self.sink2)
> 
>      def reconfigure(self):
>          self.lock()
>          self.disconnect(self.txpath, self.sink)
>          self.sink2 = gr.null_sink(gr.sizeof_gr_complex)
>          self.connect(self.txpath, self.sink2)
>          self.unlock()





reply via email to

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