How to finish the rx_callback? in benchmark_ofdm_rx.py

Hello all

At first, I appreciate you read my text.

My problem is that

how to finish the rx_callback in benchmark_ofdm_rx.py

I think that the structure of benchmark_ofdm_rx.py is like this.

make rx_callback and return this to my_top_block

and return my_top_block to tb

and tb.start()

I want to receive the data in 2.5e9 Hz one time.

and second time receive the data in 2.6e9 Hz.

So I would like to make this scenario.

Receiving the data in specific frequency

and receiving the data in another frequency.

I tried these method, but failed.

failed method 1:
tb = my_top_block(rx_callback, options)
tb.start()
tb.wait() #------> process goes into here and cannot escape
tb.stop()

failed method 2:
tb = my_top_block(rx_callback, options)
tb.start()
tb.stop() # -----> process broken here
tb.wait()

method 3:
def rx_callback(ok, payload):
n=0
while n<1000:
n += 1
(pktno,) = struct.unpack(’!H’, payload[0:2])

------> after n goes over 1000, process broken

So, is there good method to this problem?

In combining sensing & transmit, I succeed like this

if name == ‘main’:
tb_wsensing = my_top_block()

while 1:
tb_wsensing.start() # start executing flow graph in
another
thread…
main_loop(tb_wsensing)
tb_wsensing.stop()
tb_wsensing.wait()
whichfreq=open(“minfreq.dat”)
a=whichfreq.readline()
freq_offset=float(a)
print a
transmit()

Thank you very very very much for your reading.

I’m not very clear with your method3. But what we use is very similar
with this method. When we want to jump out from the callback’s block
status, we send a useless pkt to it to make it quit out.

Lin

2010/4/20 Sung Jeen J. [email protected]:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs