forked from sdr/gr-osmosdr
rtl_tcp: update rtl agc mode as well when switching tuner agc on/off
This commit is contained in:
parent
2ca2d8cd4d
commit
faa5123186
|
@ -318,6 +318,7 @@ osmosdr::gain_range_t rtl_tcp_source_c::get_gain_range( const std::string & name
|
||||||
bool rtl_tcp_source_c::set_gain_mode( bool automatic, size_t chan )
|
bool rtl_tcp_source_c::set_gain_mode( bool automatic, size_t chan )
|
||||||
{
|
{
|
||||||
_src->set_gain_mode(int(!automatic));
|
_src->set_gain_mode(int(!automatic));
|
||||||
|
_src->set_agc_mode(automatic);
|
||||||
|
|
||||||
_auto_gain = automatic;
|
_auto_gain = automatic;
|
||||||
|
|
||||||
|
|
|
@ -308,3 +308,9 @@ void rtl_tcp_source_f::set_if_gain(int stage, int gain)
|
||||||
struct command cmd = { 0x06, htonl(params) };
|
struct command cmd = { 0x06, htonl(params) };
|
||||||
send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
|
send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rtl_tcp_source_f::set_agc_mode(int on)
|
||||||
|
{
|
||||||
|
struct command cmd = { 0x08, htonl(on) };
|
||||||
|
send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
|
||||||
|
}
|
||||||
|
|
|
@ -112,6 +112,7 @@ public:
|
||||||
void set_gain(int gain);
|
void set_gain(int gain);
|
||||||
void set_freq_corr(int ppm);
|
void set_freq_corr(int ppm);
|
||||||
void set_if_gain(int stage, int gain);
|
void set_if_gain(int stage, int gain);
|
||||||
|
void set_agc_mode(int on);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue