mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +01:00
potential fix for #1361
This commit is contained in:
parent
db1682a2ac
commit
d12021fc2f
@ -81,8 +81,15 @@ public:
|
||||
|
||||
private:
|
||||
void refresh() {
|
||||
devList = SoapySDR::Device::enumerate();
|
||||
txtDevList = "";
|
||||
try {
|
||||
devList = SoapySDR::Device::enumerate();
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not list devices: {}", e.what());
|
||||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (auto& dev : devList) {
|
||||
txtDevList += dev["label"] != "" ? dev["label"] : dev["driver"];
|
||||
@ -153,7 +160,14 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
SoapySDR::Device* dev = SoapySDR::Device::make(devArgs);
|
||||
SoapySDR::Device* dev = NULL;
|
||||
try {
|
||||
dev = SoapySDR::Device::make(devArgs);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not open device: {}", e.what());
|
||||
return;
|
||||
}
|
||||
|
||||
antennaList = dev->listAntennas(SOAPY_SDR_RX, channelId);
|
||||
txtAntennaList = "";
|
||||
@ -307,7 +321,13 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
_this->dev = SoapySDR::Device::make(_this->devArgs);
|
||||
try {
|
||||
_this->dev = SoapySDR::Device::make(_this->devArgs);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Failed to open device: {}", e.what());
|
||||
return;
|
||||
}
|
||||
|
||||
_this->dev->setSampleRate(SOAPY_SDR_RX, _this->channelId, _this->sampleRate);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user