forked from sdr/gr-osmosdr
pluto bw, fixes
This commit is contained in:
parent
226e690d10
commit
327c13f583
|
@ -87,7 +87,8 @@ pluto_source_c::pluto_source_c (const std::string &args)
|
||||||
_buf(NULL),
|
_buf(NULL),
|
||||||
_running(false),
|
_running(false),
|
||||||
_auto_gain(true),
|
_auto_gain(true),
|
||||||
_skipped(0)
|
_skipped(0),
|
||||||
|
freq_cache(0)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int index;
|
int index;
|
||||||
|
@ -263,7 +264,7 @@ int pluto_source_c::work( int noutput_items,
|
||||||
const int nout = std::min(noutput_items, _samp_avail);
|
const int nout = std::min(noutput_items, _samp_avail);
|
||||||
const short *buf = _buf[_buf_head] + _buf_offset * 2;
|
const short *buf = _buf[_buf_head] + _buf_offset * 2;
|
||||||
|
|
||||||
volk_16i_s32f_convert_32f((float*)out, buf, scaling, 2 * noutput_items);
|
volk_16i_s32f_convert_32f((float*)out, buf, scaling, 2 * nout);
|
||||||
out += nout;
|
out += nout;
|
||||||
|
|
||||||
noutput_items -= nout;
|
noutput_items -= nout;
|
||||||
|
@ -290,12 +291,9 @@ std::vector<std::string> pluto_source_c::get_devices()
|
||||||
{
|
{
|
||||||
std::vector<std::string> devices;
|
std::vector<std::string> devices;
|
||||||
std::string label;
|
std::string label;
|
||||||
char manufact[256];
|
|
||||||
char product[256];
|
|
||||||
char serial[256];
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < plutosdr_get_device_count(); i++) {
|
for (unsigned int i = 0; i < plutosdr_get_device_count(); i++) {
|
||||||
std::string args = "pluto=" + boost::lexical_cast< std::string >( i );
|
std::string args = "pluto=" + boost::lexical_cast< std::string >( i ) + ",label='osmo-pluto-kernel'";
|
||||||
devices.push_back( args );
|
devices.push_back( args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +328,7 @@ double pluto_source_c::set_sample_rate(double rate)
|
||||||
{
|
{
|
||||||
if (_dev) {
|
if (_dev) {
|
||||||
plutosdr_set_sample_rate( _dev, (uint32_t)rate );
|
plutosdr_set_sample_rate( _dev, (uint32_t)rate );
|
||||||
}
|
}
|
||||||
|
|
||||||
return get_sample_rate();
|
return get_sample_rate();
|
||||||
}
|
}
|
||||||
|
@ -353,15 +351,17 @@ osmosdr::freq_range_t pluto_source_c::get_freq_range( size_t chan )
|
||||||
|
|
||||||
double pluto_source_c::set_center_freq( double freq, size_t chan )
|
double pluto_source_c::set_center_freq( double freq, size_t chan )
|
||||||
{
|
{
|
||||||
if (_dev)
|
if (_dev){
|
||||||
plutosdr_set_rxlo( _dev, (uint64_t)freq );
|
plutosdr_set_rxlo( _dev, (uint64_t)freq );
|
||||||
|
freq_cache = freq;
|
||||||
|
}
|
||||||
|
|
||||||
return get_center_freq( chan );
|
return get_center_freq( chan );
|
||||||
}
|
}
|
||||||
|
|
||||||
double pluto_source_c::get_center_freq( size_t chan )
|
double pluto_source_c::get_center_freq( size_t chan )
|
||||||
{
|
{
|
||||||
return 0;
|
return freq_cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ std::vector<std::string> pluto_source_c::get_gain_names( size_t chan )
|
||||||
|
|
||||||
osmosdr::gain_range_t pluto_source_c::get_gain_range( size_t chan )
|
osmosdr::gain_range_t pluto_source_c::get_gain_range( size_t chan )
|
||||||
{
|
{
|
||||||
return osmosdr::gain_range_t(-10, 60, 1);
|
return osmosdr::gain_range_t(-10, 77, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
osmosdr::gain_range_t pluto_source_c::get_gain_range( const std::string & name, size_t chan )
|
osmosdr::gain_range_t pluto_source_c::get_gain_range( const std::string & name, size_t chan )
|
||||||
|
@ -452,3 +452,14 @@ double pluto_source_c::get_freq_corr(size_t chan)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double pluto_source_c::set_bandwidth(double bandwidth, size_t chan) {
|
||||||
|
if (_dev) {
|
||||||
|
plutosdr_set_rfbw(_dev, (uint32_t)bandwidth);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
osmosdr::freq_range_t pluto_source_c::get_bandwidth_range(size_t chan) {
|
||||||
|
return osmosdr::freq_range_t(1000000, 20000000, 1000000);
|
||||||
|
}
|
||||||
|
|
|
@ -110,6 +110,10 @@ public:
|
||||||
std::string set_antenna( const std::string & antenna, size_t chan = 0 );
|
std::string set_antenna( const std::string & antenna, size_t chan = 0 );
|
||||||
std::string get_antenna( size_t chan = 0 );
|
std::string get_antenna( size_t chan = 0 );
|
||||||
|
|
||||||
|
double set_bandwidth(double bandwidth, size_t chan = 0);
|
||||||
|
osmosdr::freq_range_t get_bandwidth_range(size_t chan);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool start();
|
bool start();
|
||||||
bool stop();
|
bool stop();
|
||||||
|
@ -139,6 +143,7 @@ private:
|
||||||
|
|
||||||
bool _auto_gain;
|
bool _auto_gain;
|
||||||
unsigned int _skipped;
|
unsigned int _skipped;
|
||||||
|
double freq_cache;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* INCLUDED_plutosdr_SOURCE_C_H */
|
#endif /* INCLUDED_plutosdr_SOURCE_C_H */
|
||||||
|
|
|
@ -313,7 +313,7 @@ source_impl::source_impl( const std::string &args )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_RTL
|
#ifdef ENABLE_OSMOPLUTO
|
||||||
if (dict.count("pluto")) {
|
if (dict.count("pluto")) {
|
||||||
pluto_source_c_sptr src = make_pluto_source_c(arg);
|
pluto_source_c_sptr src = make_pluto_source_c(arg);
|
||||||
block = src; iface = src.get();
|
block = src; iface = src.get();
|
||||||
|
|
Loading…
Reference in New Issue