kopia lustrzana https://github.com/f4exb/sdrangel
Added Rx/Tx indicator, channel index and claiming device set index to the SamplingDevice struct used for device enumeration
rodzic
9293d4bc14
commit
66b06dcd08
|
@ -66,7 +66,9 @@ PluginInterface::SamplingDevices BladerfOutputPlugin::enumSampleSinks()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString(devinfo[i].serial),
|
QString(devinfo[i].serial),
|
||||||
i));
|
i,
|
||||||
|
false,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (devinfo)
|
if (devinfo)
|
||||||
|
|
|
@ -63,7 +63,9 @@ PluginInterface::SamplingDevices FileSinkPlugin::enumSampleSinks()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString::null,
|
QString::null,
|
||||||
i));
|
i,
|
||||||
|
false,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -97,7 +97,9 @@ PluginInterface::SamplingDevices HackRFOutputPlugin::enumSampleSinks()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
serial_str,
|
serial_str,
|
||||||
i));
|
i,
|
||||||
|
false,
|
||||||
|
0));
|
||||||
|
|
||||||
qDebug("HackRFOutputPlugin::enumSampleSinks: enumerated HackRF device #%d", i);
|
qDebug("HackRFOutputPlugin::enumSampleSinks: enumerated HackRF device #%d", i);
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "plugin/pluginapi.h"
|
#include "plugin/pluginapi.h"
|
||||||
#include "util/simpleserializer.h"
|
#include "util/simpleserializer.h"
|
||||||
#include "device/devicesinkapi.h"
|
#include "device/devicesinkapi.h"
|
||||||
|
#include "limesdr/devicelimesdrparam.h"
|
||||||
|
|
||||||
#include "limesdroutputgui.h"
|
#include "limesdroutputgui.h"
|
||||||
#include "limesdroutputplugin.h"
|
#include "limesdroutputplugin.h"
|
||||||
|
@ -82,13 +83,22 @@ PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks()
|
||||||
std::string serial("N/D");
|
std::string serial("N/D");
|
||||||
findSerial((const char *) deviceList[i], serial);
|
findSerial((const char *) deviceList[i], serial);
|
||||||
|
|
||||||
qDebug("LimeSDROutputPlugin::enumSampleSources: device #%d: %s", i, (char *) deviceList[i]);
|
DeviceLimeSDRParams limeSDRParams;
|
||||||
QString displayedName(QString("LimeSDR[%1] %2").arg(i).arg(serial.c_str()));
|
limeSDRParams.open(deviceList[i]);
|
||||||
result.append(SamplingDevice(displayedName,
|
limeSDRParams.close();
|
||||||
m_hardwareID,
|
|
||||||
m_deviceTypeID,
|
for (unsigned int j = 0; j < limeSDRParams.m_nbTxChannels; j++)
|
||||||
QString(deviceList[i]),
|
{
|
||||||
i));
|
qDebug("LimeSDROutputPlugin::enumSampleSources: device #%d channel %u: %s", i, j, (char *) deviceList[i]);
|
||||||
|
QString displayedName(QString("LimeSDR[%1:%2] %3").arg(i).arg(j).arg(serial.c_str()));
|
||||||
|
result.append(SamplingDevice(displayedName,
|
||||||
|
m_hardwareID,
|
||||||
|
m_deviceTypeID,
|
||||||
|
QString(deviceList[i]),
|
||||||
|
i,
|
||||||
|
false,
|
||||||
|
j));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,9 @@ PluginInterface::SamplingDevices PlutoSDROutputPlugin::enumSampleSinks()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
serial_str,
|
serial_str,
|
||||||
i));
|
i,
|
||||||
|
false,
|
||||||
|
0));
|
||||||
|
|
||||||
qDebug("PlutoSDROutputPlugin::enumSampleSources: enumerated PlutoSDR device #%d", i);
|
qDebug("PlutoSDROutputPlugin::enumSampleSources: enumerated PlutoSDR device #%d", i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,9 @@ PluginInterface::SamplingDevices SDRdaemonSinkPlugin::enumSampleSinks()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString::null,
|
QString::null,
|
||||||
i));
|
i,
|
||||||
|
false,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -99,7 +99,9 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
serial_str,
|
serial_str,
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
|
|
||||||
qDebug("AirspyPlugin::enumSampleSources: enumerated Airspy device #%d", i);
|
qDebug("AirspyPlugin::enumSampleSources: enumerated Airspy device #%d", i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,9 @@ PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString(devinfo[i].serial),
|
QString(devinfo[i].serial),
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (devinfo)
|
if (devinfo)
|
||||||
|
|
|
@ -65,7 +65,9 @@ PluginInterface::SamplingDevices FCDProPlugin::enumSampleSources()
|
||||||
fcd_traits<Pro>::hardwareID,
|
fcd_traits<Pro>::hardwareID,
|
||||||
fcd_traits<Pro>::interfaceIID,
|
fcd_traits<Pro>::interfaceIID,
|
||||||
serialNumber,
|
serialNumber,
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
|
|
||||||
device_info = device_info->next;
|
device_info = device_info->next;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -67,7 +67,9 @@ PluginInterface::SamplingDevices FCDProPlusPlugin::enumSampleSources()
|
||||||
fcd_traits<ProPlus>::hardwareID,
|
fcd_traits<ProPlus>::hardwareID,
|
||||||
fcd_traits<ProPlus>::interfaceIID,
|
fcd_traits<ProPlus>::interfaceIID,
|
||||||
serialNumber,
|
serialNumber,
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
|
|
||||||
device_info = device_info->next;
|
device_info = device_info->next;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -63,7 +63,9 @@ PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString::null,
|
QString::null,
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -98,7 +98,9 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
serial_str,
|
serial_str,
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
|
|
||||||
qDebug("HackRFPlugin::enumSampleSources: enumerated HackRF device #%d", i);
|
qDebug("HackRFPlugin::enumSampleSources: enumerated HackRF device #%d", i);
|
||||||
|
|
||||||
|
|
|
@ -83,13 +83,22 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources()
|
||||||
std::string serial("N/D");
|
std::string serial("N/D");
|
||||||
findSerial((const char *) deviceList[i], serial);
|
findSerial((const char *) deviceList[i], serial);
|
||||||
|
|
||||||
qDebug("LimeSDRInputPlugin::enumSampleSources: device #%d: %s", i, (char *) deviceList[i]);
|
DeviceLimeSDRParams limeSDRParams;
|
||||||
QString displayedName(QString("LimeSDR[%1] %2").arg(i).arg(serial.c_str()));
|
limeSDRParams.open(deviceList[i]);
|
||||||
result.append(SamplingDevice(displayedName,
|
limeSDRParams.close();
|
||||||
m_hardwareID,
|
|
||||||
m_deviceTypeID,
|
for (unsigned int j = 0; j < limeSDRParams.m_nbRxChannels; j++)
|
||||||
QString(deviceList[i]),
|
{
|
||||||
i));
|
qDebug("LimeSDRInputPlugin::enumSampleSources: device #%d channel %u: %s", i, j, (char *) deviceList[i]);
|
||||||
|
QString displayedName(QString("LimeSDR[%1:%2] %3").arg(i).arg(j).arg(serial.c_str()));
|
||||||
|
result.append(SamplingDevice(displayedName,
|
||||||
|
m_hardwareID,
|
||||||
|
m_deviceTypeID,
|
||||||
|
QString(deviceList[i]),
|
||||||
|
i,
|
||||||
|
true,
|
||||||
|
j));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,9 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
serial_str,
|
serial_str,
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
|
|
||||||
qDebug("PlutoSDRInputPlugin::enumSampleSources: enumerated PlutoSDR device #%d", i);
|
qDebug("PlutoSDRInputPlugin::enumSampleSources: enumerated PlutoSDR device #%d", i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,9 @@ PluginInterface::SamplingDevices RTLSDRPlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString(serial),
|
QString(serial),
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,9 @@ PluginInterface::SamplingDevices SDRdaemonSourcePlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString::null,
|
QString::null,
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -77,7 +77,9 @@ PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
|
||||||
m_hardwareID,
|
m_hardwareID,
|
||||||
m_deviceTypeID,
|
m_deviceTypeID,
|
||||||
QString(serial),
|
QString(serial),
|
||||||
i));
|
i,
|
||||||
|
true,
|
||||||
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -27,22 +27,30 @@ class PluginInterface {
|
||||||
public:
|
public:
|
||||||
struct SamplingDevice
|
struct SamplingDevice
|
||||||
{
|
{
|
||||||
QString displayedName;
|
QString displayedName; //!< The human readable name
|
||||||
QString hardwareId;
|
QString hardwareId; //!< The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
|
||||||
QString id;
|
QString id; //!< The internal plugin ID corresponding to the device (i.e. for HackRF input, for HackRF output ...)
|
||||||
QString serial;
|
QString serial; //!< The device serial number
|
||||||
int sequence;
|
int sequence; //!< The device sequence. >0 when more than one device of the same type is connected
|
||||||
|
bool rxElseTx; //!< This is the Rx part else the Tx part of the device
|
||||||
|
int deviceItemIndex; //!< For composite devices this is the Rx or Tx stream index. -1 if not initialized
|
||||||
|
int claimed; //!< This is the device set index if claimed else -1
|
||||||
|
|
||||||
SamplingDevice(const QString& _displayedName,
|
SamplingDevice(const QString& _displayedName,
|
||||||
const QString& _hardwareId,
|
const QString& _hardwareId,
|
||||||
const QString& _id,
|
const QString& _id,
|
||||||
const QString& _serial,
|
const QString& _serial,
|
||||||
int _sequence) :
|
int _sequence,
|
||||||
|
bool _rxElseTx,
|
||||||
|
int _deviceItemIndex) :
|
||||||
displayedName(_displayedName),
|
displayedName(_displayedName),
|
||||||
hardwareId(_hardwareId),
|
hardwareId(_hardwareId),
|
||||||
id(_id),
|
id(_id),
|
||||||
serial(_serial),
|
serial(_serial),
|
||||||
sequence(_sequence)
|
sequence(_sequence),
|
||||||
|
rxElseTx(_rxElseTx),
|
||||||
|
deviceItemIndex(_deviceItemIndex),
|
||||||
|
claimed(-1)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
typedef QList<SamplingDevice> SamplingDevices;
|
typedef QList<SamplingDevice> SamplingDevices;
|
||||||
|
|
Ładowanie…
Reference in New Issue