soapy_source: refresh devices on start if none in devList

This commit is contained in:
ericek111 2021-08-30 01:07:40 +02:00
parent f572d12936
commit 49fd49b4d6
No known key found for this signature in database
GPG Key ID: F850D0320BA802C9

View File

@ -296,6 +296,14 @@ private:
static void start(void* ctx) { static void start(void* ctx) {
SoapyModule* _this = (SoapyModule*)ctx; SoapyModule* _this = (SoapyModule*)ctx;
if (_this->running) { return; } 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 = SoapySDR::Device::make(_this->devArgs);
_this->dev->setSampleRate(SOAPY_SDR_RX, _this->channelId, _this->sampleRate); _this->dev->setSampleRate(SOAPY_SDR_RX, _this->channelId, _this->sampleRate);