You need to follow the code into the other modules that are imported by
benchmark_rx.py. The rx_callback function is passed as an argument to
constructor of my_top_block, which in turn passes it to the constructor
usrp_receive_path (in usrp_receive_path.py). In usrp_receive_path, the
function is then passed to the constructor of the class receive_path
(in receive_path.py), which then passes it to the constructor of class
demod_pkts in the blks2 namespace.
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
code is in a different part of the gnuradio source tree. The code for
demod_pkts is actually in
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
fed by a flow-graph (including filter, demodulator, correlator etc.) in
demod_pkts class that receives samples from a source and converts to
packets. The code for making and un-making packets is
Disclaimer: I’m on an outdated version of the source tree, so things may
be exactly as I described them.
Hope this helps.