Marcus, thank you for that advice. I was concerned that making the calls 
through the gr-uhd would give the same problems I was experiencing with the 
tagged stream but upon closer inspection it makes calls directly to the 
uhd::usrp::multi_usrp.


Upon second glance using the gr-uhd would be the better approach! The functions 
I need are available.


I did resolve my original problem:


Here was my error:

- d_usrp = boost::dynamic_pointer_cast<gr::uhd::usrp_sink::sptr>(blk);
+ d_usrp = boost::dynamic_pointer_cast<gr::uhd::usrp_sink>(blk);

Jeff


________________________________
From: Marcus D Leech <[email protected]>
Sent: Tuesday, October 27, 2020 12:48 PM
To: Hodges, Jeff
Cc: [email protected]
Subject: Re: [USRP-users] C++ how to get usrp::multi_usrp::sptr from 
USRP_Sink_Block

Are you sure the calls you need aren’t already available in the gr-UHD wrapper?

Some parts of gr-UHD aren’t visible in GRC based flows but are still in the 
gr-UHD API, and if you were just using the straight Python programming model 
you could use them directly.


Sent from my iPhone

On Oct 27, 2020, at 12:25 PM, Hodges, Jeff via USRP-users 
<[email protected]> wrote:



How do I get the device sptr (::uhd::usrp::multi_usrp::sptr) from the 
usrp_sink_block sptr?


For example, the following works:


                basic_block_sptr blk = 
global_block_registry.block_lookup(pmt::intern(usrp_alias));
                d_usrp = 
boost::dynamic_pointer_cast<gr::uhd::usrp_sink::sptr>(blk);

But errors here:

                ::uhd::usrp::multi_usrp::sptr d_usrp_dev = d_usrp->get_device();


What happens if I just create another usrp object for the same device in 
addition to the one already created by the uhd_sink_block? I'm guessing that 
will not work.


My end goal is to be able to create a block that makes direct C++ api calls to 
the usrp to tune it between bursts, since the uhd (for unknown reasons) does 
not support timed command tuning on a tagged stream in burst mode (as i 
mentioned in yesterday's email).

Jeff

_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to