mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-03-24 00:49:52 +01:00
add whitelist for plutosdr-like devices
This commit is contained in:
parent
caeaa2d46c
commit
9ce62f8885
@ -23,6 +23,12 @@ SDRPP_MOD_INFO{
|
|||||||
|
|
||||||
ConfigManager config;
|
ConfigManager config;
|
||||||
|
|
||||||
|
const std::vector<const char*> deviceWhiteList = {
|
||||||
|
"PlutoSDR",
|
||||||
|
"ANTSDR",
|
||||||
|
"LibreSDR"
|
||||||
|
};
|
||||||
|
|
||||||
class PlutoSDRSourceModule : public ModuleManager::Instance {
|
class PlutoSDRSourceModule : public ModuleManager::Instance {
|
||||||
public:
|
public:
|
||||||
PlutoSDRSourceModule(std::string name) {
|
PlutoSDRSourceModule(std::string name) {
|
||||||
@ -130,7 +136,14 @@ private:
|
|||||||
std::string duri = iio_context_info_get_uri(info);
|
std::string duri = iio_context_info_get_uri(info);
|
||||||
|
|
||||||
// If the device is not a plutosdr, don't include it
|
// If the device is not a plutosdr, don't include it
|
||||||
if (desc.find("PlutoSDR") == std::string::npos) {
|
bool isPluto = false;
|
||||||
|
for (const auto type : deviceWhiteList) {
|
||||||
|
if (desc.find(type) != std::string::npos) {
|
||||||
|
isPluto = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isPluto) {
|
||||||
flog::warn("Ignored IIO device: [{}] {}", duri, desc);
|
flog::warn("Ignored IIO device: [{}] {}", duri, desc);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user