mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 15:34:57 -04:00
PlutoSDR MIMO: recognize user defined MIMO devices
This commit is contained in:
@@ -44,9 +44,11 @@ PlutoSDRMIMO::PlutoSDRMIMO(DeviceAPI *deviceAPI) :
|
||||
m_settings(),
|
||||
m_sourceThread(nullptr),
|
||||
m_sinkThread(nullptr),
|
||||
m_deviceDescription("BladeRF2MIMO"),
|
||||
m_deviceDescription("PlutoSDRMIMO"),
|
||||
m_runningRx(false),
|
||||
m_runningTx(false),
|
||||
m_plutoRxBuffer(nullptr),
|
||||
m_plutoTxBuffer(nullptr),
|
||||
m_plutoParams(nullptr),
|
||||
m_open(false),
|
||||
m_nbRx(0),
|
||||
@@ -83,6 +85,7 @@ void PlutoSDRMIMO::destroy()
|
||||
|
||||
bool PlutoSDRMIMO::openDevice()
|
||||
{
|
||||
qDebug("PlutoSDRMIMO::openDevice: open device here");
|
||||
m_plutoParams = new DevicePlutoSDRParams();
|
||||
|
||||
if (m_deviceAPI->getHardwareUserArguments().size() != 0)
|
||||
@@ -116,7 +119,11 @@ bool PlutoSDRMIMO::openDevice()
|
||||
char serial[256];
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
|
||||
if (!m_plutoParams->open(serial))
|
||||
if (m_plutoParams->open(serial))
|
||||
{
|
||||
qDebug("PlutoSDRMIMO::openDevice: device serial %s opened", serial);
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical("PlutoSDRMIMO::openDevice: open serial %s failed", serial);
|
||||
return false;
|
||||
@@ -182,6 +189,7 @@ bool PlutoSDRMIMO::startRx()
|
||||
m_plutoParams->getBox()->openSecondRx();
|
||||
}
|
||||
|
||||
m_plutoRxBuffer = m_plutoParams->getBox()->createRxBuffer(PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples, false);
|
||||
m_sourceThread->startWork();
|
||||
mutexLocker.unlock();
|
||||
m_runningRx = true;
|
||||
@@ -219,6 +227,7 @@ bool PlutoSDRMIMO::startTx()
|
||||
m_plutoParams->getBox()->openSecondTx();
|
||||
}
|
||||
|
||||
m_plutoTxBuffer = m_plutoParams->getBox()->createRxBuffer(PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples, false);
|
||||
m_sinkThread->startWork();
|
||||
mutexLocker.unlock();
|
||||
m_runningTx = true;
|
||||
@@ -248,6 +257,9 @@ void PlutoSDRMIMO::stopRx()
|
||||
if (m_nbRx > 0) {
|
||||
m_plutoParams->getBox()->closeRx();
|
||||
}
|
||||
|
||||
m_plutoParams->getBox()->deleteRxBuffer();
|
||||
m_plutoRxBuffer = nullptr;
|
||||
}
|
||||
|
||||
void PlutoSDRMIMO::stopTx()
|
||||
@@ -272,6 +284,9 @@ void PlutoSDRMIMO::stopTx()
|
||||
if (m_nbTx > 0) {
|
||||
m_plutoParams->getBox()->closeTx();
|
||||
}
|
||||
|
||||
m_plutoParams->getBox()->deleteTxBuffer();
|
||||
m_plutoRxBuffer = nullptr;
|
||||
}
|
||||
|
||||
QByteArray PlutoSDRMIMO::serialize() const
|
||||
|
||||
@@ -177,6 +177,8 @@ private:
|
||||
QString m_deviceDescription;
|
||||
bool m_runningRx;
|
||||
bool m_runningTx;
|
||||
struct iio_buffer *m_plutoRxBuffer;
|
||||
struct iio_buffer *m_plutoTxBuffer;
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ const PluginDescriptor PlutoSDRMIMOPlugin::m_pluginDescriptor = {
|
||||
};
|
||||
|
||||
static constexpr const char* const m_hardwareID = "PlutoSDR";
|
||||
static constexpr const char* const m_deviceTypeID = PLUTOSDRMIMO_DEVICE_TYPE_ID;
|
||||
const char* const PlutoSDRMIMOPlugin::m_deviceTypeID = PLUTOSDRMIMO_DEVICE_TYPE_ID;
|
||||
|
||||
PlutoSDRMIMOPlugin::PlutoSDRMIMOPlugin(QObject* parent) :
|
||||
QObject(parent)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
class PluginAPI;
|
||||
|
||||
#define PLUTOSDRMIMO_DEVICE_TYPE_ID "sdrangel.samplemimo.bladerf2mimo"
|
||||
#define PLUTOSDRMIMO_DEVICE_TYPE_ID "sdrangel.samplemimo.plutosdrmimo"
|
||||
|
||||
class PlutoSDRMIMOPlugin : public QObject, public PluginInterface {
|
||||
Q_OBJECT
|
||||
@@ -45,6 +45,9 @@ public:
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleMIMO* createSampleMIMOPluginInstance(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
virtual DeviceWebAPIAdapter* createDeviceWebAPIAdapter() const;
|
||||
virtual QString getDeviceTypeId() const { return m_deviceTypeID; }
|
||||
|
||||
static const char* const m_deviceTypeID;
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
||||
Reference in New Issue
Block a user