18 #include <QStringList> 43 SoapySDR::Device::unmake(device);
58 SoapySDR::Kwargs kwargs;
59 kwargs[
"driver"] = deviceEnum.
m_driverName.toStdString();
61 if (hardwareUserArguments.size() > 0)
63 QStringList kvArgs = hardwareUserArguments.split(
',');
65 for (
int i = 0;
i < kvArgs.size();
i++)
67 QStringList kv = kvArgs.at(
i).split(
'=');
70 kwargs[kv.at(0).toStdString()] = kv.at(1).toStdString();
74 else if (deviceEnum.
m_idKey.size() > 0)
76 kwargs[deviceEnum.
m_idKey.toStdString()] = deviceEnum.
m_idValue.toStdString();
79 SoapySDR::Kwargs::const_iterator it = kwargs.begin();
81 for (; it != kwargs.end(); ++it) {
82 qDebug(
"DeviceSoapySDR::openopenSoapySDRFromSequence: %s=%s", it->first.c_str(), it->second.c_str());
85 SoapySDR::Device *device = SoapySDR::Device::make(kwargs);
88 catch (
const std::exception &ex)
90 qWarning(
"DeviceSoapySDR::openopenSoapySDRFromSequence: %s cannot be opened: %s",
91 deviceEnum.
m_label.toStdString().c_str(), ex.what());
static DeviceSoapySDR & instance()
void closeSoapySdr(SoapySDR::Device *device)
const std::vector< SoapySDRDeviceEnum > & getDevicesEnumeration() const
QString m_idValue
value for the above key
uint32_t getNbDevices() const
QString m_label
the label key for display should always be present
SoapySDR::Device * openopenSoapySDRFromSequence(uint32_t sequence, const QString &hardwareUserArguments)
DeviceSoapySDRScan m_scanner
SoapySDR::Device * openSoapySDR(uint32_t sequence, const QString &hardwareUserArguments)
QString m_idKey
key to uniquely identify device