Now here it may get a little confusing, because (1) there is no blks2.py file if you want to look up the code for demod_pkts, and (2) the relevant code is in a different part of the gnuradio source tree. The code for class demod_pkts is actually in <GR_ROOT_DIR>/gnuradio-core/src/python/gnuradio/blks2impl/pkt.py.
In pkt.py, you'll see that demod_pkts spawns a thread that listens for messages dispatched over a queue, and invokes the rx_callback function passed to it each time it receives a message. The queue is asynchronously fed by a flow-graph (including filter, demodulator, correlator etc.) in the demod_pkts class that receives samples from a source and converts to packets. The code for making and un-making packets is in <GR_ROOT_DIR>/gnuradio-core/src/python/gnuradio/packet_utils.py.
Disclaimer: I'm on an outdated version of the source tree, so things may not be exactly as I described them.
Hope this helps.
Kunal
On Sat, May 21, 2011 at 3:20 AM, yulong yang
<address@hidden> wrote:
Hi all,
I have been reading the benchmark_rx.py codes.I want to add the channel sensing and selecting in callback function.
I understand rx_callback in benchmark_rx is a function that make the block wait for packet generating from the data that received from the receive_path while running. But how dose it work exactly? Is the tb.wait() waiting for this callback? Why I cannot find anywhere that have called this function in the script, dose it run automatically?
Thank you in advance.
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio