mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-24 01:48:28 +01:00
Add error details on libhackrf open/close
This commit is contained in:
parent
4a5a29a59a
commit
6583104a96
@ -228,9 +228,9 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
int err = hackrf_open_by_serial(_this->selectedSerial.c_str(), &_this->openDev);
|
||||
if (err != 0) {
|
||||
spdlog::error("Could not open HackRF {0}", _this->selectedSerial);
|
||||
auto err = static_cast<hackrf_error>(hackrf_open_by_serial(_this->selectedSerial.c_str(), &_this->openDev));
|
||||
if (err != hackrf_error::HACKRF_SUCCESS) {
|
||||
spdlog::error("Could not open HackRF {0}: {1}", _this->selectedSerial, hackrf_error_name(err));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -257,7 +257,10 @@ private:
|
||||
_this->running = false;
|
||||
_this->stream.stopWriter();
|
||||
// TODO: Stream stop
|
||||
hackrf_close(_this->openDev);
|
||||
auto err = static_cast<hackrf_error>(hackrf_close(_this->openDev));
|
||||
if (err != hackrf_error::HACKRF_SUCCESS) {
|
||||
spdlog::error("Could not close HackRF {0}: {1}", _this->selectedSerial, hackrf_error_name(err));
|
||||
}
|
||||
_this->stream.clearWriteStop();
|
||||
spdlog::info("HackRFSourceModule '{0}': Stop!", _this->name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user