source/sink: return freq_range_t in get_bandwidth_range()

it was meta_range_t (which is binary compatible) before.
gr3.6
Dimitri Stolnikov 10 years ago
parent 7ed94c6242
commit 13477f279f
  1. 2
      include/osmosdr/osmosdr_sink_c.h
  2. 2
      include/osmosdr/osmosdr_source_c.h
  3. 6
      lib/hackrf/hackrf_sink_c.cc
  4. 2
      lib/hackrf/hackrf_sink_c.h
  5. 6
      lib/hackrf/hackrf_source_c.cc
  6. 2
      lib/hackrf/hackrf_source_c.h
  7. 12
      lib/osmosdr_sink_c_impl.cc
  8. 2
      lib/osmosdr_sink_c_impl.h
  9. 4
      lib/osmosdr_snk_iface.h
  10. 12
      lib/osmosdr_source_c_impl.cc
  11. 2
      lib/osmosdr_source_c_impl.h
  12. 4
      lib/osmosdr_src_iface.h

@ -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 */

@ -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 */

@ -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

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

@ -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

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

@ -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();
}

@ -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

@ -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

@ -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();
}

@ -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

@ -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

Loading…
Cancel
Save