mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 23:55:13 -05:00
SoapySDR support: set enumeration serial to driver and sequence so buddies are paired appropriately
This commit is contained in:
parent
8f2ec099f3
commit
d8b82ddecd
@ -60,33 +60,35 @@ void DeviceSoapySDRScan::scan()
|
||||
{
|
||||
m_deviceEnums.push_back(SoapySDRDeviceEnum());
|
||||
m_deviceEnums.back().m_driverName = QString(it.first.c_str());
|
||||
m_deviceEnums.back().m_sequence = deviceSeq;
|
||||
|
||||
// collect identification information
|
||||
for (SoapySDR::Kwargs::const_iterator kargIt = kit->begin(); kargIt != kit->end(); ++kargIt)
|
||||
|
||||
SoapySDR::Kwargs::const_iterator kargIt;
|
||||
|
||||
if ((kargIt = kit->find("label")) != kit->end())
|
||||
{
|
||||
if (kargIt->first == "label")
|
||||
{
|
||||
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 ((m_deviceEnums.back().m_idKey.size() == 0) && (kargIt->first == "serial"))
|
||||
{
|
||||
m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
|
||||
m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
|
||||
}
|
||||
else if ((m_deviceEnums.back().m_idKey.size() == 0) && (kargIt->first == "device_id"))
|
||||
{
|
||||
m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
|
||||
m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
|
||||
}
|
||||
else if ((m_deviceEnums.back().m_idKey.size() == 0) && (kargIt->first == "addr"))
|
||||
{
|
||||
m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
|
||||
m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
||||
if ((kargIt = kit->find("serial")) != kit->end())
|
||||
{
|
||||
m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
|
||||
m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
|
||||
}
|
||||
else if ((kargIt = kit->find("device_id")) != kit->end())
|
||||
{
|
||||
m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
|
||||
m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
|
||||
}
|
||||
else if ((kargIt = kit->find("addr")) != kit->end())
|
||||
{
|
||||
m_deviceEnums.back().m_idKey = QString(kargIt->first.c_str());
|
||||
m_deviceEnums.back().m_idValue = QString(kargIt->second.c_str());
|
||||
}
|
||||
|
||||
// access the device to get the number of Rx and Tx channels and at the same time probe
|
||||
|
@ -29,13 +29,14 @@ public:
|
||||
struct SoapySDRDeviceEnum
|
||||
{
|
||||
QString m_driverName;
|
||||
QString m_label; //!< the label key for display should always be present
|
||||
QString m_idKey; //!< key to uniquely identify device
|
||||
QString m_idValue; //!< value for the above key
|
||||
uint32_t m_sequence; //!< device sequence for this driver
|
||||
QString m_label; //!< the label key for display should always be present
|
||||
QString m_idKey; //!< key to uniquely identify device
|
||||
QString m_idValue; //!< value for the above key
|
||||
uint32_t m_nbRx;
|
||||
uint32_t m_nbTx;
|
||||
|
||||
SoapySDRDeviceEnum() : m_nbRx(0), m_nbTx(0)
|
||||
SoapySDRDeviceEnum() : m_sequence(0), m_nbRx(0), m_nbTx(0)
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -61,7 +61,7 @@ PluginInterface::SamplingDevices SoapySDROutputPlugin::enumSampleSinks()
|
||||
SamplingDevices result;
|
||||
DeviceSoapySDR& deviceSoapySDR = DeviceSoapySDR::instance();
|
||||
const std::vector<DeviceSoapySDRScan::SoapySDRDeviceEnum>& devicesEnumeration = deviceSoapySDR.getDevicesEnumeration();
|
||||
qDebug("SoapySDRInputPlugin::enumSampleSources: found %lu devices", devicesEnumeration.size());
|
||||
qDebug("SoapySDROutputPlugin::enumSampleSinks: %lu SoapySDR devices. Enumerate these with Tx channel(s):", devicesEnumeration.size());
|
||||
std::vector<DeviceSoapySDRScan::SoapySDRDeviceEnum>::const_iterator it = devicesEnumeration.begin();
|
||||
|
||||
for (int idev = 0; it != devicesEnumeration.end(); ++it, idev++)
|
||||
@ -70,12 +70,14 @@ PluginInterface::SamplingDevices SoapySDROutputPlugin::enumSampleSinks()
|
||||
|
||||
for (unsigned int ichan = 0; ichan < nbTxChannels; ichan++)
|
||||
{
|
||||
qDebug("SoapySDROutputPlugin::enumSampleSinks: device #%d (%s) channel %u", idev, it->m_label, ichan);
|
||||
QString displayedName(QString("SoapySDR[%1:%2] %3").arg(idev).arg(ichan).arg(it->m_label));
|
||||
QString serial(QString("%1-%2").arg(it->m_driverName).arg(it->m_sequence));
|
||||
qDebug("SoapySDROutputPlugin::enumSampleSinks: device #%d (%s) serial %s channel %u",
|
||||
idev, it->m_label.toStdString().c_str(), serial.toStdString().c_str(), ichan);
|
||||
result.append(SamplingDevice(displayedName,
|
||||
m_hardwareID,
|
||||
m_deviceTypeID,
|
||||
it->m_idValue,
|
||||
serial,
|
||||
idev,
|
||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||
false,
|
||||
|
@ -60,7 +60,7 @@ PluginInterface::SamplingDevices SoapySDRInputPlugin::enumSampleSources()
|
||||
SamplingDevices result;
|
||||
DeviceSoapySDR& deviceSoapySDR = DeviceSoapySDR::instance();
|
||||
const std::vector<DeviceSoapySDRScan::SoapySDRDeviceEnum>& devicesEnumeration = deviceSoapySDR.getDevicesEnumeration();
|
||||
qDebug("SoapySDRInputPlugin::enumSampleSources: found %lu devices", devicesEnumeration.size());
|
||||
qDebug("SoapySDRInputPlugin::enumSampleSources: %lu SoapySDR devices. Enumerate these with Rx channel(s):", devicesEnumeration.size());
|
||||
std::vector<DeviceSoapySDRScan::SoapySDRDeviceEnum>::const_iterator it = devicesEnumeration.begin();
|
||||
|
||||
for (int idev = 0; it != devicesEnumeration.end(); ++it, idev++)
|
||||
@ -69,12 +69,14 @@ PluginInterface::SamplingDevices SoapySDRInputPlugin::enumSampleSources()
|
||||
|
||||
for (unsigned int ichan = 0; ichan < nbRxChannels; ichan++)
|
||||
{
|
||||
qDebug("SoapySDRInputPlugin::enumSampleSources: device #%d (%s) channel %u", idev, it->m_label, ichan);
|
||||
QString displayedName(QString("SoapySDR[%1:%2] %3").arg(idev).arg(ichan).arg(it->m_label));
|
||||
QString serial(QString("%1-%2").arg(it->m_driverName).arg(it->m_sequence));
|
||||
qDebug("SoapySDRInputPlugin::enumSampleSources: device #%d (%s) serial %s channel %u",
|
||||
idev, it->m_label.toStdString().c_str(), serial.toStdString().c_str(), ichan);
|
||||
result.append(SamplingDevice(displayedName,
|
||||
m_hardwareID,
|
||||
m_deviceTypeID,
|
||||
it->m_idValue,
|
||||
serial,
|
||||
idev,
|
||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user