[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] How to instantiate uhd usrp sink in C++
From: |
Josh Blum |
Subject: |
Re: [Discuss-gnuradio] How to instantiate uhd usrp sink in C++ |
Date: |
Fri, 13 May 2011 15:39:10 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 |
On 05/13/2011 03:33 PM, address@hidden wrote:
> Hello again,
>
> I am having trouble setting the io_type to the uhd_make_usrp_sink function.
> This is likely due to my unfamiliarity with C++.
>
> The error printed on the screen:
> "terminate called after throwing an instance of 'std::invalid_argument'
> what(): itemsize mismatch: sig_source_c(1):0 using 8, gr uhd usrp
> sink(2):0 using 2
> Aborted"
>
> I am connecting the uhd_usrp_sink to a sig_source_c. Here is the troublesome
> code that I use to setup the uhd_usrp_sink:
> uhd::device_addr_t addr; //I assume this defaults to ""
> uhd::io_type_t type(2); //I want this to be COMPLEX_FLOAT32, but don't know
Well thats the problem, there is no enum w/ value 2. Use one of the
build-in enums:
http://www.ettus.com/uhd_docs/doxygen/html/classuhd_1_1io__type__t.html
Also, you can pass uhd::io_type_t::COMPLEX_FLOAT32 directly as the
second argument.
-josh