SoapySDR support: if no label is registered for the device then create one with the driver name and sequence

This commit is contained in:
f4exb 2018-11-16 11:19:04 +01:00
parent 8e5a332b50
commit 710718682f
1 changed files with 8 additions and 6 deletions

View File

@ -66,15 +66,17 @@ void DeviceSoapySDRScan::scan()
SoapySDR::Kwargs::const_iterator kargIt;
if ((kargIt = kit->find("label")) != kit->end())
{
if ((kargIt = kit->find("label")) != kit->end()) {
m_deviceEnums.back().m_label = QString(kargIt->second.c_str());
qDebug("DeviceSoapySDRScan::scan: %s #%u %s",
m_deviceEnums.back().m_driverName.toStdString().c_str(),
deviceSeq,
kargIt->second.c_str());
} else { // if no label is registered for this device then create a label with the driver name and sequence
m_deviceEnums.back().m_label = QString("%1-%2").arg(m_deviceEnums.back().m_driverName).arg(deviceSeq);
}
qDebug("DeviceSoapySDRScan::scan: %s #%u %s",
m_deviceEnums.back().m_driverName.toStdString().c_str(),
deviceSeq,
m_deviceEnums.back().m_label.toStdString().c_str());
if ((kargIt = kit->find("serial")) != kit->end())
{
m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());