[USRP-users] UHD C++ API Questions

Martin Braun martin.braun at ettus.com
Tue Dec 2 14:57:00 EST 2014


On 12/02/2014 07:49 PM, Marcus D. Leech via USRP-users wrote:
> I shall defer the destructor-architecture question to Michael West,
> because I note that ~multi_usrp() is defined as  NOP function.  So I'm
> not sure
>   how all this gets cleaned up, to be honest. 

multi_usrp really is a "fat" interface to a uhd::device. So for example
if you have an X300, it will call ~x300_impl() at destruction.

> With respect to your set_rx_freq question, tune_request_t is polymorphic
> (is that the right C++ jargon?  I'm not a C++ guy in any kind of
>   full-time capacity):
> 
> http://files.ettus.com/manual/structuhd_1_1tune__request__t.html
> 
> Which means that passing in a straight double is a simple tuning request
> without any fancy offset tuning.

That's right, this shortcut works.

As for setting, getting and throwing:

- getters usually (practically always) return the actual, set value.
Example: You tune to 280 GHz and then call get_rx_freq(), you will get a
valid frequency your daughterboards supports
- A lot of setters *do* throw if you set garbage (the frequency doesn't,
but the subdev settings, for example, do). The throw happens in the
underlying uhd::device class.

Erm, did I miss a question?

Cheers,
M




More information about the USRP-users mailing list