forked from sdr/gr-osmosdr
airspy: remove deprecated init/exit calls
This commit is contained in:
parent
13114b7830
commit
163cad2e96
|
@ -52,9 +52,6 @@ using namespace boost::assign;
|
||||||
#define AIRSPY_FUNC_STR(func, arg) \
|
#define AIRSPY_FUNC_STR(func, arg) \
|
||||||
boost::str(boost::format(func "(%d)") % arg) + " has failed"
|
boost::str(boost::format(func "(%d)") % arg) + " has failed"
|
||||||
|
|
||||||
int airspy_source_c::_usage = 0;
|
|
||||||
boost::mutex airspy_source_c::_usage_mutex;
|
|
||||||
|
|
||||||
airspy_source_c_sptr make_airspy_source_c (const std::string & args)
|
airspy_source_c_sptr make_airspy_source_c (const std::string & args)
|
||||||
{
|
{
|
||||||
return gnuradio::get_initial_sptr(new airspy_source_c (args));
|
return gnuradio::get_initial_sptr(new airspy_source_c (args));
|
||||||
|
@ -95,15 +92,6 @@ airspy_source_c::airspy_source_c (const std::string &args)
|
||||||
|
|
||||||
dict_t dict = params_to_dict(args);
|
dict_t dict = params_to_dict(args);
|
||||||
|
|
||||||
{
|
|
||||||
boost::mutex::scoped_lock lock( _usage_mutex );
|
|
||||||
|
|
||||||
if ( _usage == 0 )
|
|
||||||
airspy_init(); /* call only once before the first open */
|
|
||||||
|
|
||||||
_usage++;
|
|
||||||
}
|
|
||||||
|
|
||||||
_dev = NULL;
|
_dev = NULL;
|
||||||
ret = airspy_open( &_dev );
|
ret = airspy_open( &_dev );
|
||||||
AIRSPY_THROW_ON_ERROR(ret, "Failed to open AirSpy device")
|
AIRSPY_THROW_ON_ERROR(ret, "Failed to open AirSpy device")
|
||||||
|
@ -159,15 +147,6 @@ airspy_source_c::~airspy_source_c ()
|
||||||
ret = airspy_close( _dev );
|
ret = airspy_close( _dev );
|
||||||
AIRSPY_THROW_ON_ERROR(ret, "Failed to close AirSpy")
|
AIRSPY_THROW_ON_ERROR(ret, "Failed to close AirSpy")
|
||||||
_dev = NULL;
|
_dev = NULL;
|
||||||
|
|
||||||
{
|
|
||||||
boost::mutex::scoped_lock lock( _usage_mutex );
|
|
||||||
|
|
||||||
_usage--;
|
|
||||||
|
|
||||||
if ( _usage == 0 )
|
|
||||||
airspy_exit(); /* call only once after last close */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_fifo)
|
if (_fifo)
|
||||||
|
@ -299,15 +278,6 @@ std::vector<std::string> airspy_source_c::get_devices()
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
{
|
|
||||||
boost::mutex::scoped_lock lock( _usage_mutex );
|
|
||||||
|
|
||||||
if ( _usage == 0 )
|
|
||||||
airspy_init(); /* call only once before the first open */
|
|
||||||
|
|
||||||
_usage++;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
airspy_device *dev = NULL;
|
airspy_device *dev = NULL;
|
||||||
ret = airspy_open(&dev);
|
ret = airspy_open(&dev);
|
||||||
|
@ -330,15 +300,6 @@ std::vector<std::string> airspy_source_c::get_devices()
|
||||||
ret = airspy_close(dev);
|
ret = airspy_close(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
boost::mutex::scoped_lock lock( _usage_mutex );
|
|
||||||
|
|
||||||
_usage--;
|
|
||||||
|
|
||||||
if ( _usage == 0 )
|
|
||||||
airspy_exit(); /* call only once after last close */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,9 +124,6 @@ private:
|
||||||
static int _airspy_rx_callback(airspy_transfer* transfer);
|
static int _airspy_rx_callback(airspy_transfer* transfer);
|
||||||
int airspy_rx_callback(void *samples, int sample_count);
|
int airspy_rx_callback(void *samples, int sample_count);
|
||||||
|
|
||||||
static int _usage;
|
|
||||||
static boost::mutex _usage_mutex;
|
|
||||||
|
|
||||||
airspy_device *_dev;
|
airspy_device *_dev;
|
||||||
|
|
||||||
boost::circular_buffer<gr_complex> *_fifo;
|
boost::circular_buffer<gr_complex> *_fifo;
|
||||||
|
|
Loading…
Reference in New Issue