rtl_tcp: implement frequency correction control

gr3.6
Dimitri Stolnikov 11 years ago
parent e38dc2f427
commit 9b9c5bfcf4
  1. 7
      lib/rtl_tcp/rtl_tcp_source_c.cc
  2. 2
      lib/rtl_tcp/rtl_tcp_source_c.h
  3. 6
      lib/rtl_tcp/rtl_tcp_source_f.cc
  4. 1
      lib/rtl_tcp/rtl_tcp_source_f.h

@ -51,6 +51,7 @@ rtl_tcp_source_c::rtl_tcp_source_c(const std::string &args) :
_freq = 0;
_rate = 0;
_gain = 0;
_corr = 0;
_auto_gain = false;
dict_t dict = params_to_dict(args);
@ -162,12 +163,16 @@ double rtl_tcp_source_c::get_center_freq( size_t chan )
double rtl_tcp_source_c::set_freq_corr( double ppm, size_t chan )
{
_src->set_freq_corr( int(ppm) );
_corr = ppm;
return get_freq_corr( chan );
}
double rtl_tcp_source_c::get_freq_corr( size_t chan )
{
return 0;
return _corr;
}
std::vector<std::string> rtl_tcp_source_c::get_gain_names( size_t chan )

@ -75,7 +75,7 @@ public:
std::string get_antenna( size_t chan = 0 );
private:
double _freq, _rate, _gain;
double _freq, _rate, _gain, _corr;
bool _auto_gain;
rtl_tcp_source_f_sptr _src;
};

@ -267,3 +267,9 @@ void rtl_tcp_source_f::set_gain(int gain)
struct command cmd = { 0x04, gain };
send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
}
void rtl_tcp_source_f::set_freq_corr(int ppm)
{
struct command cmd = { 0x05, ppm };
send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
}

@ -94,6 +94,7 @@ private:
void set_sample_rate(int sample_rate);
void set_gain_mode(int manual);
void set_gain(int gain);
void set_freq_corr(int ppm);
};

Loading…
Cancel
Save