30 qDebug(
"DeviceSoapySDRScan::scan: Lib Version: v%s", SoapySDR::getLibVersion().c_str());
31 qDebug(
"DeviceSoapySDRScan::scan: API Version: v%s", SoapySDR::getAPIVersion().c_str());
32 qDebug(
"DeviceSoapySDRScan::scan: ABI Version: v%s", SoapySDR::getABIVersion().c_str());
33 qDebug(
"DeviceSoapySDRScan::scan: Install root: %s", SoapySDR::getRootPath().c_str());
35 const std::vector<std::string>& modules = SoapySDR::listModules();
37 for (
const auto &it : modules)
39 const auto &errMsg = SoapySDR::loadModule(it);
41 if (not errMsg.empty()) {
42 qWarning(
"DeviceSoapySDRScan::scan: cannot load module %s: %s", it.c_str(), errMsg.c_str());
44 qDebug(
"DeviceSoapySDRScan::scan: loaded module: %s", it.c_str());
48 SoapySDR::FindFunctions findFunctions = SoapySDR::Registry::listFindFunctions();
49 SoapySDR::Kwargs kwargs;
52 for (
const auto &it : findFunctions)
54 qDebug(
"DeviceSoapySDRScan::scan: driver: %s", it.first.c_str());
55 kwargs[
"driver"] = it.first;
57 SoapySDR::KwargsList kwargsList = SoapySDR::Device::enumerate(kwargs);
58 SoapySDR::KwargsList::const_iterator kit = kwargsList.begin();
60 for (
int deviceSeq = 0; kit != kwargsList.end(); ++kit, deviceSeq++)
63 m_deviceEnums.back().m_driverName = QString(it.first.c_str());
68 SoapySDR::Kwargs::const_iterator kargIt;
70 if ((kargIt = kit->find(
"label")) != kit->end()) {
71 m_deviceEnums.back().m_label = QString(kargIt->second.c_str());
76 if ((kargIt = kit->find(
"serial")) != kit->end())
78 m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
79 m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
81 else if ((kargIt = kit->find(
"device_id")) != kit->end())
83 m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
84 m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
86 else if ((kargIt = kit->find(
"addr")) != kit->end())
88 m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
89 m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
92 qDebug(
"DeviceSoapySDRScan::scan: %s #%u %s id: %s=%s",
104 SoapySDR::Device *device;
105 SoapySDR::Kwargs kwargs;
106 kwargs[
"driver"] =
m_deviceEnums.back().m_driverName.toStdString();
112 device = SoapySDR::Device::make(kwargs);
113 m_deviceEnums.back().m_nbRx = device->getNumChannels(SOAPY_SDR_RX);
114 m_deviceEnums.back().m_nbTx = device->getNumChannels(SOAPY_SDR_TX);
115 qDebug(
"DeviceSoapySDRScan::scan: %s #%u driver=%s hardware=%s #Rx=%u #Tx=%u",
118 device->getDriverKey().c_str(),
119 device->getHardwareKey().c_str(),
123 SoapySDR::Device::unmake(device);
125 catch (
const std::exception &ex)
127 qWarning(
"DeviceSoapySDRScan::scan: %s #%u cannot be opened: %s",
std::vector< SoapySDRDeviceEnum > m_deviceEnums
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)