diff --git a/hackrf_source/src/main.cpp b/hackrf_source/src/main.cpp index 3bcba7e..75d90e9 100644 --- a/hackrf_source/src/main.cpp +++ b/hackrf_source/src/main.cpp @@ -229,8 +229,8 @@ private: } int err = hackrf_open_by_serial(_this->selectedSerial.c_str(), &_this->openDev); - if (err != 0) { - spdlog::error("Could not open HackRF {0}", _this->selectedSerial); + if (err != 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); + int err = hackrf_close(_this->openDev); + if (err != 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); } @@ -407,4 +410,4 @@ MOD_EXPORT void _DELETE_INSTANCE_(ModuleManager::Instance* instance) { MOD_EXPORT void _END_() { config.disableAutoSave(); config.save(); -} \ No newline at end of file +}