hackrf: update to libhackrf 6f0ae9bc99 API

This commit is contained in:
Dimitri Stolnikov 2013-05-08 21:37:30 +02:00
parent 905dd03ac6
commit 7c22e6975c
3 changed files with 10 additions and 31 deletions

View File

@ -269,13 +269,11 @@ int hackrf_sink_c::hackrf_tx_callback(unsigned char *buffer, uint32_t length)
memset(buffer, 0, length);
std::cerr << "U" << std::flush;
} else {
// std::cerr << ":" << std::flush;
// std::cerr << "-" << std::flush;
_buf_cond.notify_one();
}
}
#endif
return 0; // TODO: return -1 on error/stop
}
@ -301,9 +299,7 @@ bool hackrf_sink_c::start()
return false;
}
while ( ! hackrf_is_streaming( _dev ) );
return (bool) hackrf_is_streaming( _dev );
return true;
}
bool hackrf_sink_c::stop()
@ -317,16 +313,9 @@ bool hackrf_sink_c::stop()
return false;
}
while ( hackrf_is_streaming( _dev ) );
/* FIXME: hackrf_stop_tx should wait until the device is ready for a start */
/* required if we want to immediately start() again */
boost::this_thread::sleep( boost::posix_time::milliseconds(100) );
return ! (bool) hackrf_is_streaming( _dev );
return true;
}
#ifdef USE_AVX
void convert_avx(const float* inbuf, unsigned char* outbuf,const unsigned int count)
{
@ -435,7 +424,7 @@ int hackrf_sink_c::work( int noutput_items,
items_consumed = 0;
std::cerr << "O" << std::flush;
} else {
// std::cerr << "." << std::flush;
// std::cerr << "+" << std::flush;
_buf_used = 0;
}
}

View File

@ -130,8 +130,6 @@ private:
static int _usage;
static boost::mutex _usage_mutex;
std::vector<gr_complex> _lut;
hackrf_device *_dev;
// gruel::thread _thread;

View File

@ -258,9 +258,7 @@ bool hackrf_source_c::start()
return false;
}
while ( ! hackrf_is_streaming( _dev ) );
return (bool) hackrf_is_streaming( _dev );
return true;
}
bool hackrf_source_c::stop()
@ -274,13 +272,7 @@ bool hackrf_source_c::stop()
return false;
}
while ( hackrf_is_streaming( _dev ) );
/* FIXME: hackrf_stop_rx should wait until the device is ready for a start */
/* required if we want to immediately start() again */
boost::this_thread::sleep( boost::posix_time::milliseconds(100) );
return ! (bool) hackrf_is_streaming( _dev );
return true;
}
int hackrf_source_c::work( int noutput_items,
@ -292,7 +284,7 @@ int hackrf_source_c::work( int noutput_items,
bool running = false;
if ( _dev )
running = (bool) hackrf_is_streaming( _dev );
running = (hackrf_is_streaming( _dev ) == HACKRF_TRUE);
{
boost::mutex::scoped_lock lock( _buf_mutex );