-------- Original Message -------- Subject: Re: [Discuss-gnuradio] USING SET/GET_GAIN UHD USRP FUNCTION Date: Fri, 29 Aug 2014 11:33:03 +0200 From: Simone Ciccia S210664 <simone.cic...@studenti.polito.it> To: Martin Braun <martin.br...@ettus.com>
Hi, thank you for the answer. I have created my own gnuradio block and linked the header that contains set/get_gain function in the _impl.cc by means of (#include <gnuradio/uhd/usrp_source.h>). In the general work of _impl.cc I call directly these functions as set/get_gain(), but the compiler returns errors! Probably I'm forgetting to create the object that link this type of class in my code _impl.cc For example: usrp_source.h looks like this namespace gr { namespace uhd { class uhd_usrp_source; class GR_UHD_API usrp_source : virtual public sync_block { public: ................................. and in my code _imple.cc I have defined the object now: usrp_source object; object->set_gain(); Anyway, it does not work... Do you know what I missing ? Probably this definition is wrong! My best thanks for the help... Simone On Thu, 28 Aug 2014 18:54:06 +0200, Martin Braun <martin.br...@ettus.com> wrote: > On 08/28/2014 01:34 PM, Simone Ciccia S210664 wrote: >> hi, >> >> I have some problem to use USRP UHD set/get_gain functions. >> >> In my code, _impl.cc I have included: >> >> #include <gnuradio/uhd/usrp_source.h> >> >> the header file in which >> >> virtual double get_gain() and virtual void set_gain() >> >> are defined! >> >> When I try to compile errors appear: >> >> error: ‘get_gain’ was not declared in this scope >> DB_gain =(float*) get_gain(0); > > Are you calling this on your own block? Or on the USRP source? > > M > > >> >> error: ‘set_gain’ was not declared in this scope >> set_gain(g_z,0); >> >> Have I forgot some definitions for these functions? >> >> Thanks >> Simone >> >> _______________________________________________ >> Discuss-gnuradio mailing list >> Discuss-gnuradio@gnu.org >> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio >> > > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio