hackrf: make failures more verbose

This commit is contained in:
Dimitri Stolnikov 2013-04-26 20:43:06 +02:00
parent 871f0cc273
commit 98a805481e
2 changed files with 5 additions and 5 deletions

View File

@ -344,7 +344,7 @@ osmosdr::meta_range_t hackrf_source_c::get_sample_rates()
{
osmosdr::meta_range_t range;
range += osmosdr::range_t( 5e6 );
range += osmosdr::range_t( 5e6 ); /* out of spec but appears to work */
range += osmosdr::range_t( 10e6 );
range += osmosdr::range_t( 12.5e6 );
range += osmosdr::range_t( 16e6 );
@ -363,7 +363,7 @@ double hackrf_source_c::set_sample_rate(double rate)
_sample_rate = rate;
set_bandwidth( rate );
} else {
throw std::runtime_error( std::string( __FUNCTION__ ) );
throw std::runtime_error( std::string( __FUNCTION__ ) + " has failed" );
}
}
@ -396,7 +396,7 @@ double hackrf_source_c::set_center_freq( double freq, size_t chan )
if ( HACKRF_SUCCESS == ret ) {
_center_freq = freq;
} else {
throw std::runtime_error( std::string( __FUNCTION__ ) );
throw std::runtime_error( std::string( __FUNCTION__ ) + " has failed" );
}
}
@ -640,7 +640,7 @@ double hackrf_source_c::set_bandwidth( double bandwidth, size_t chan )
if ( HACKRF_SUCCESS == ret ) {
_bandwidth = bw;
} else {
throw std::runtime_error( std::string( __FUNCTION__ ) );
throw std::runtime_error( std::string( __FUNCTION__ ) + " has failed" );
}
}

View File

@ -75,7 +75,7 @@ private:
*/
hackrf_source_c (const std::string & args); // private constructor
public:
public:
~hackrf_source_c (); // public destructor
int work( int noutput_items,