How exactly dose rx_callback work in benchmark script?

Hi all,

I have been reading the 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
wait for packet generating from the data that received from the
while running. But how dose it work exactly? Is the tb.wait() waiting
this callback? Why I cannot find anywhere that have called this function
the script, dose it run automatically?

Thank you in advance.

You need to follow the code into the other modules that are imported by 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 In usrp_receive_path, the
function is then passed to the constructor of the class receive_path
(in, 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
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, 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
in <GR_ROOT_DIR>/gnuradio-core/src/python/gnuradio/

Disclaimer: I’m on an outdated version of the source tree, so things may
be exactly as I described them.

Hope this helps.


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