# USRP queue ambiguity

**URL:** <https://www.ruby-forum.com/t/usrp-queue-ambiguity/230424>\
**Category:** GNU Radio\
**Created:** [June 17, 2014, 5:54pm UTC](https://www.ruby-forum.com/t/usrp-queue-ambiguity/230424 "2014-06-17T17:54:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 17, 2014, 5:54pm UTC](https://www.ruby-forum.com/t/usrp-queue-ambiguity/230424/1 "2014-06-17T17:54:39Z")

</div>

Hello,

I am writing a code for frequency hopping. I am facing a problem when  
I change the transmitting frequency. The problem is not in the duration  
of the LO settling time as I expected. However, it is in the packets  
that are still in the queue (I dont know exactly where this queue  
starts/ends), where the last N=? packets are transmitted on the new  
frequency instead of the old one (quite sure about the issue, as I  
thoroughly tested it with another USRP device as a receiver).

My code is based on “ofdm/benchmark\_tx.py” example. The portion of  
the code that matters:  
.  
.  
for i in range(20):  
data = source\_file.read(pkt\_size - 2)  
tb.txpath.send\_pkt(struct.pack(’!H’,send\_seq &0xffff)+data)  
#wait till queue is empty  
tb.sink.set\_freq(ch[c])  
.  
.

What is the function to be used as polling to check the emptiness of  
the queue (#wait till queue is empty) before changing the frequency? I  
dont want to use arbitrary sleep time 🙂

Thx for help,  
mzaherm
