source/sink: return freq_range_t in get_bandwidth_range()

it was meta_range_t (which is binary compatible) before.
This commit is contained in:
Dimitri Stolnikov 2013-04-30 21:00:57 +02:00
parent 7ed94c6242
commit 13477f279f
12 changed files with 26 additions and 30 deletions

View File

@ -284,7 +284,7 @@ public:
* \param chan the channel index 0 to N-1
* \return a range of bandwidths in Hz
*/
virtual osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 ) = 0;
virtual osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 ) = 0;
};
#endif /* INCLUDED_OSMOSDR_SINK_C_H */

View File

@ -284,7 +284,7 @@ public:
* \param chan the channel index 0 to N-1
* \return a range of bandwidths in Hz
*/
virtual osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 ) = 0;
virtual osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 ) = 0;
};
#endif /* INCLUDED_OSMOSDR_SOURCE_C_H */

View File

@ -671,7 +671,7 @@ std::string hackrf_sink_c::get_antenna( size_t chan )
double hackrf_sink_c::set_bandwidth( double bandwidth, size_t chan )
{
int ret;
// osmosdr::meta_range_t bandwidths = get_bandwidth_range( chan );
// osmosdr::freq_range_t bandwidths = get_bandwidth_range( chan );
if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */
bandwidth = _sample_rate;
@ -695,9 +695,9 @@ double hackrf_sink_c::get_bandwidth( size_t chan )
return _bandwidth;
}
osmosdr::meta_range_t hackrf_sink_c::get_bandwidth_range( size_t chan )
osmosdr::freq_range_t hackrf_sink_c::get_bandwidth_range( size_t chan )
{
osmosdr::meta_range_t bandwidths;
osmosdr::freq_range_t bandwidths;
// TODO: read out from libhackrf when an API is available

View File

@ -119,7 +119,7 @@ public:
double set_bandwidth( double bandwidth, size_t chan = 0 );
double get_bandwidth( size_t chan = 0 );
osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 );
osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );
private:
static int _hackrf_tx_callback(hackrf_transfer* transfer);

View File

@ -649,7 +649,7 @@ std::string hackrf_source_c::get_antenna( size_t chan )
double hackrf_source_c::set_bandwidth( double bandwidth, size_t chan )
{
int ret;
// osmosdr::meta_range_t bandwidths = get_bandwidth_range( chan );
// osmosdr::freq_range_t bandwidths = get_bandwidth_range( chan );
if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */
bandwidth = _sample_rate;
@ -673,9 +673,9 @@ double hackrf_source_c::get_bandwidth( size_t chan )
return _bandwidth;
}
osmosdr::meta_range_t hackrf_source_c::get_bandwidth_range( size_t chan )
osmosdr::freq_range_t hackrf_source_c::get_bandwidth_range( size_t chan )
{
osmosdr::meta_range_t bandwidths;
osmosdr::freq_range_t bandwidths;
// TODO: read out from libhackrf when an API is available

View File

@ -118,7 +118,7 @@ public:
double set_bandwidth( double bandwidth, size_t chan = 0 );
double get_bandwidth( size_t chan = 0 );
osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 );
osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );
private:
static int _hackrf_rx_callback(hackrf_transfer* transfer);

View File

@ -180,15 +180,13 @@ size_t osmosdr_sink_c_impl::get_num_channels()
osmosdr::meta_range_t osmosdr_sink_c_impl::get_sample_rates()
{
osmosdr::meta_range_t rates(0, 0, 0);
if (!_devs.empty())
rates = _devs[0]->get_sample_rates(); // assume same devices used in the group
if ( ! _devs.empty() )
return _devs[0]->get_sample_rates(); // assume same devices used in the group
#if 0
else
throw std::runtime_error(NO_DEVICES_MSG);
#endif
return rates;
return osmosdr::meta_range_t();
}
double osmosdr_sink_c_impl::set_sample_rate(double rate)
@ -490,7 +488,7 @@ double osmosdr_sink_c_impl::get_bandwidth( size_t chan )
return 0;
}
osmosdr::meta_range_t osmosdr_sink_c_impl::get_bandwidth_range( size_t chan )
osmosdr::freq_range_t osmosdr_sink_c_impl::get_bandwidth_range( size_t chan )
{
size_t channel = 0;
BOOST_FOREACH( osmosdr_snk_iface *dev, _devs )
@ -498,5 +496,5 @@ osmosdr::meta_range_t osmosdr_sink_c_impl::get_bandwidth_range( size_t chan )
if ( chan == channel++ )
return dev->get_bandwidth_range( dev_chan );
return osmosdr::meta_range_t();
return osmosdr::freq_range_t();
}

View File

@ -63,7 +63,7 @@ public:
double set_bandwidth( double bandwidth, size_t chan = 0 );
double get_bandwidth( size_t chan = 0 );
osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 );
osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );
private:
osmosdr_sink_c_impl (const std::string & args); // private constructor

View File

@ -254,8 +254,8 @@ public:
* \param chan the channel index 0 to N-1
* \return a range of bandwidths in Hz
*/
virtual osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 )
{ return osmosdr::meta_range_t(); }
virtual osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 )
{ return osmosdr::freq_range_t(); }
};
#endif // OSMOSDR_SNK_IFACE_H

View File

@ -312,15 +312,13 @@ size_t osmosdr_source_c_impl::get_num_channels()
osmosdr::meta_range_t osmosdr_source_c_impl::get_sample_rates()
{
osmosdr::meta_range_t rates(0, 0, 0);
if (!_devs.empty())
rates = _devs[0]->get_sample_rates(); // assume same devices used in the group
if ( ! _devs.empty() )
return _devs[0]->get_sample_rates(); // assume same devices used in the group
#if 0
else
throw std::runtime_error(NO_DEVICES_MSG);
#endif
return rates;
return osmosdr::meta_range_t();;
}
double osmosdr_source_c_impl::set_sample_rate(double rate)
@ -688,7 +686,7 @@ double osmosdr_source_c_impl::get_bandwidth( size_t chan )
return 0;
}
osmosdr::meta_range_t osmosdr_source_c_impl::get_bandwidth_range( size_t chan )
osmosdr::freq_range_t osmosdr_source_c_impl::get_bandwidth_range( size_t chan )
{
size_t channel = 0;
BOOST_FOREACH( osmosdr_src_iface *dev, _devs )
@ -696,5 +694,5 @@ osmosdr::meta_range_t osmosdr_source_c_impl::get_bandwidth_range( size_t chan )
if ( chan == channel++ )
return dev->get_bandwidth_range( dev_chan );
return osmosdr::meta_range_t();
return osmosdr::freq_range_t();
}

View File

@ -68,7 +68,7 @@ public:
double set_bandwidth( double bandwidth, size_t chan = 0 );
double get_bandwidth( size_t chan = 0 );
osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 );
osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );
private:
osmosdr_source_c_impl (const std::string & args); // private constructor

View File

@ -254,8 +254,8 @@ public:
* \param chan the channel index 0 to N-1
* \return a range of bandwidths in Hz
*/
virtual osmosdr::meta_range_t get_bandwidth_range( size_t chan = 0 )
{ return osmosdr::meta_range_t(); }
virtual osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 )
{ return osmosdr::freq_range_t(); }
};
#endif // OSMOSDR_SRC_IFACE_H