hackrf: disable start/stop as it has caused lock-ups

This commit is contained in:
Dimitri Stolnikov 2013-06-02 15:53:45 +02:00
parent cf06b3caef
commit 40ca42013b
2 changed files with 26 additions and 8 deletions

View File

@ -215,6 +215,11 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
cb_init( &_cbuf, _buf_num, BUF_LEN ); cb_init( &_cbuf, _buf_num, BUF_LEN );
// _thread = gr::thread::thread(_hackrf_wait, this); // _thread = gr::thread::thread(_hackrf_wait, this);
ret = hackrf_start_tx( _dev, _hackrf_tx_callback, (void *)this );
if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to start TX streaming (" << ret << ")" << std::endl;
}
} }
/* /*
@ -224,6 +229,10 @@ hackrf_sink_c::~hackrf_sink_c ()
{ {
if (_dev) { if (_dev) {
// _thread.join(); // _thread.join();
int ret = hackrf_stop_tx( _dev );
if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to stop TX streaming (" << ret << ")" << std::endl;
}
hackrf_close( _dev ); hackrf_close( _dev );
_dev = NULL; _dev = NULL;
@ -287,13 +296,13 @@ bool hackrf_sink_c::start()
return false; return false;
_buf_used = 0; _buf_used = 0;
#if 0
int ret = hackrf_start_tx( _dev, _hackrf_tx_callback, (void *)this ); int ret = hackrf_start_tx( _dev, _hackrf_tx_callback, (void *)this );
if (ret != HACKRF_SUCCESS) { if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to start TX streaming (" << ret << ")" << std::endl; std::cerr << "Failed to start TX streaming (" << ret << ")" << std::endl;
return false; return false;
} }
#endif
return true; return true;
} }
@ -301,13 +310,13 @@ bool hackrf_sink_c::stop()
{ {
if ( ! _dev ) if ( ! _dev )
return false; return false;
#if 0
int ret = hackrf_stop_tx( _dev ); int ret = hackrf_stop_tx( _dev );
if (ret != HACKRF_SUCCESS) { if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to stop TX streaming (" << ret << ")" << std::endl; std::cerr << "Failed to stop TX streaming (" << ret << ")" << std::endl;
return false; return false;
} }
#endif
return true; return true;
} }

View File

@ -173,6 +173,11 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
} }
// _thread = gr::thread::thread(_hackrf_wait, this); // _thread = gr::thread::thread(_hackrf_wait, this);
ret = hackrf_start_rx( _dev, _hackrf_rx_callback, (void *)this );
if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to start RX streaming (" << ret << ")" << std::endl;
}
} }
/* /*
@ -182,6 +187,10 @@ hackrf_source_c::~hackrf_source_c ()
{ {
if (_dev) { if (_dev) {
// _thread.join(); // _thread.join();
int ret = hackrf_stop_rx( _dev );
if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to stop RX streaming (" << ret << ")" << std::endl;
}
hackrf_close( _dev ); hackrf_close( _dev );
_dev = NULL; _dev = NULL;
@ -246,13 +255,13 @@ bool hackrf_source_c::start()
{ {
if ( ! _dev ) if ( ! _dev )
return false; return false;
#if 0
int ret = hackrf_start_rx( _dev, _hackrf_rx_callback, (void *)this ); int ret = hackrf_start_rx( _dev, _hackrf_rx_callback, (void *)this );
if (ret != HACKRF_SUCCESS) { if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to start RX streaming (" << ret << ")" << std::endl; std::cerr << "Failed to start RX streaming (" << ret << ")" << std::endl;
return false; return false;
} }
#endif
return true; return true;
} }
@ -260,13 +269,13 @@ bool hackrf_source_c::stop()
{ {
if ( ! _dev ) if ( ! _dev )
return false; return false;
#if 0
int ret = hackrf_stop_rx( _dev ); int ret = hackrf_stop_rx( _dev );
if (ret != HACKRF_SUCCESS) { if (ret != HACKRF_SUCCESS) {
std::cerr << "Failed to stop RX streaming (" << ret << ")" << std::endl; std::cerr << "Failed to stop RX streaming (" << ret << ")" << std::endl;
return false; return false;
} }
#endif
return true; return true;
} }