mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-03 14:34:57 -04:00
Added possibility to specify devices that cannot be discovered automatically. This implements #445
This commit is contained in:
@@ -295,11 +295,31 @@ bool PlutoSDRInput::openDevice()
|
||||
else
|
||||
{
|
||||
qDebug("PlutoSDRInput::openDevice: open device here");
|
||||
|
||||
m_deviceShared.m_deviceParams = new DevicePlutoSDRParams();
|
||||
char serial[256];
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
m_deviceShared.m_deviceParams->open(serial);
|
||||
|
||||
if (m_deviceAPI->getHardwareUserArguments().size() != 0)
|
||||
{
|
||||
QStringList kv = m_deviceAPI->getHardwareUserArguments().split('='); // expecting "uri=xxx"
|
||||
|
||||
if (kv.size() > 1)
|
||||
{
|
||||
if (kv.at(0) == "uri") {
|
||||
m_deviceShared.m_deviceParams->openURI(kv.at(1).toStdString());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char serial[256];
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
m_deviceShared.m_deviceParams->open(serial);
|
||||
}
|
||||
}
|
||||
|
||||
m_deviceAPI->setBuddySharedPtr(&m_deviceShared); // propagate common parameters to API
|
||||
|
||||
Reference in New Issue
Block a user