From 49fd49b4d65845c83286014733f743b8fe257010 Mon Sep 17 00:00:00 2001 From: ericek111 Date: Mon, 30 Aug 2021 01:07:40 +0200 Subject: [PATCH 1/3] soapy_source: refresh devices on start if none in devList --- soapy_source/src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/soapy_source/src/main.cpp b/soapy_source/src/main.cpp index e73a1f16..0145548b 100644 --- a/soapy_source/src/main.cpp +++ b/soapy_source/src/main.cpp @@ -296,6 +296,14 @@ private: static void start(void* ctx) { SoapyModule* _this = (SoapyModule*)ctx; if (_this->running) { return; } + if (_this->devId < 0) { + _this->refresh(); + _this->selectDevice(config.conf["device"]); + if (_this->devId < 0) { + return; + } + } + _this->dev = SoapySDR::Device::make(_this->devArgs); _this->dev->setSampleRate(SOAPY_SDR_RX, _this->channelId, _this->sampleRate); From fa75a3a1763c53ab2051b3a3b52d77a7812682f9 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 30 Aug 2021 03:06:40 +0200 Subject: [PATCH 2/3] Update main.cpp --- soapy_source/src/main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/soapy_source/src/main.cpp b/soapy_source/src/main.cpp index 0145548b..f2dced4b 100644 --- a/soapy_source/src/main.cpp +++ b/soapy_source/src/main.cpp @@ -297,11 +297,7 @@ private: SoapyModule* _this = (SoapyModule*)ctx; if (_this->running) { return; } if (_this->devId < 0) { - _this->refresh(); - _this->selectDevice(config.conf["device"]); - if (_this->devId < 0) { - return; - } + return; } _this->dev = SoapySDR::Device::make(_this->devArgs); From c31e2604258e4cefae6e8ca6e0bb41086f18bb35 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 30 Aug 2021 03:07:36 +0200 Subject: [PATCH 3/3] Added error message --- soapy_source/src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/soapy_source/src/main.cpp b/soapy_source/src/main.cpp index f2dced4b..8f6a270e 100644 --- a/soapy_source/src/main.cpp +++ b/soapy_source/src/main.cpp @@ -297,6 +297,7 @@ private: SoapyModule* _this = (SoapyModule*)ctx; if (_this->running) { return; } if (_this->devId < 0) { + spdlog::error("No device available"); return; }