mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
LibbladeRF2: BladeRF1 specific enumeration
This commit is contained in:
parent
bf726e16b1
commit
94837dbd51
@ -66,17 +66,40 @@ PluginInterface::SamplingDevices BladerfOutputPlugin::enumSampleSinks()
|
|||||||
{
|
{
|
||||||
for(int i = 0; i < count; i++)
|
for(int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
|
struct bladerf *dev;
|
||||||
|
|
||||||
result.append(SamplingDevice(displayedName,
|
int status = bladerf_open_with_devinfo(&dev, &devinfo[i]);
|
||||||
m_hardwareID,
|
|
||||||
m_deviceTypeID,
|
if (status == BLADERF_ERR_NODEV)
|
||||||
QString(devinfo[i].serial),
|
{
|
||||||
i,
|
qCritical("BladerfOutputPlugin::enumSampleSinks: No device at index %d", i);
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
continue;
|
||||||
false,
|
}
|
||||||
1,
|
else if (status != 0)
|
||||||
0));
|
{
|
||||||
|
qCritical("BladerfOutputPlugin::enumSampleSinks: Failed to open device at index %d", i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *boardName = bladerf_get_board_name(dev);
|
||||||
|
|
||||||
|
if (strcmp(boardName, "bladerf1") == 0)
|
||||||
|
{
|
||||||
|
QString displayedName(QString("BladeRF1[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
|
||||||
|
|
||||||
|
result.append(SamplingDevice(displayedName,
|
||||||
|
m_hardwareID,
|
||||||
|
m_deviceTypeID,
|
||||||
|
QString(devinfo[i].serial),
|
||||||
|
i,
|
||||||
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
|
false,
|
||||||
|
1,
|
||||||
|
0));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bladerf_close(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
bladerf_free_device_list(devinfo); // Valgrind memcheck
|
bladerf_free_device_list(devinfo); // Valgrind memcheck
|
||||||
|
@ -66,17 +66,39 @@ PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
|
|||||||
{
|
{
|
||||||
for(int i = 0; i < count; i++)
|
for(int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
|
struct bladerf *dev;
|
||||||
|
|
||||||
result.append(SamplingDevice(displayedName,
|
int status = bladerf_open_with_devinfo(&dev, &devinfo[i]);
|
||||||
m_hardwareID,
|
|
||||||
m_deviceTypeID,
|
if (status == BLADERF_ERR_NODEV)
|
||||||
QString(devinfo[i].serial),
|
{
|
||||||
i,
|
qCritical("BlderfInputPlugin::enumSampleSources: No device at index %d", i);
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
continue;
|
||||||
true,
|
}
|
||||||
1,
|
else if (status != 0)
|
||||||
0));
|
{
|
||||||
|
qCritical("BlderfInputPlugin::enumSampleSources: Failed to open device at index %d", i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *boardName = bladerf_get_board_name(dev);
|
||||||
|
|
||||||
|
if (strcmp(boardName, "bladerf1") == 0)
|
||||||
|
{
|
||||||
|
QString displayedName(QString("BladeRF1[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
|
||||||
|
|
||||||
|
result.append(SamplingDevice(displayedName,
|
||||||
|
m_hardwareID,
|
||||||
|
m_deviceTypeID,
|
||||||
|
QString(devinfo[i].serial),
|
||||||
|
i,
|
||||||
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
|
true,
|
||||||
|
1,
|
||||||
|
0));
|
||||||
|
}
|
||||||
|
|
||||||
|
bladerf_close(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
bladerf_free_device_list(devinfo); // Valgrind memcheck
|
bladerf_free_device_list(devinfo); // Valgrind memcheck
|
||||||
|
Loading…
Reference in New Issue
Block a user