Using set/get_gain uhd usrp function

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);

error: ‘set_gain’ was not declared in this scope
set_gain(g_z,0);

Have I forgot some definitions for these functions?

Thanks
Simone

Hi Simone,

set_gain are methods of the usrp_source class; you need to call it as
such (e.g. my_source_obj->set_gain(x) ), and not like a global function
(ie. set_gain(x)).

Greetings,
Marcus

On 08/28/2014 01:34 PM, Simone Ciccia S210664 wrote:

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