[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Question about USRP2 Tx procedure
From: |
Josh Blum |
Subject: |
Re: [Discuss-gnuradio] Question about USRP2 Tx procedure |
Date: |
Fri, 13 Apr 2012 08:51:06 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0 |
On 04/13/2012 08:36 AM, Nowlan, Sean wrote:
> A few questions about this: can you wait on the uhd async message
> queue from a python script that has an instance of top_block? Would
> you have to override wait() with a custom version that waits on the
> queue (haven't checked if wait is a virtual function)?
>
Yes, you can wait on the message queue. In pseudo code:
top_block.start()
while True:
sleep(.01) # just a bit
msg = the_msg_queue.delete_head()
if not msg: continue
if parse(msg) == ACK: break
top_block.stop()
top_block.wait()
The msg is kind of a blob of bytes with this struct, so you have to
write parse():
http://files.ettus.com/uhd_docs/doxygen/html/structuhd_1_1async__metadata__t.html
-----------------------------------------------------------------------
I have a version of the async message source that uses the PMT message
passing feature, so its a little more graceful:
https://github.com/guruofquality/grextras/blob/master/include/gnuradio/extras/uhd_amsg_source.h
Your message would be a PMT dictionary that you can pop-apart in python:
https://github.com/guruofquality/grextras/blob/master/lib/uhd_amsg_source.cc#L68
> Does UHD also ACK time tags and start-of-burst tags?
>
Just the end of burst.
I can image that it might be useful to know when the USRP began
triggering the transmission.
-josh