1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

On Android, list USB devices by VID/PID and open using file descriptor.

This commit is contained in:
Jon Beniston
2022-12-22 11:04:12 +00:00
parent 897ecc4d88
commit 7aea12e6fe
9 changed files with 187 additions and 1 deletions
@@ -28,6 +28,9 @@
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
#ifdef ANDROID
#include "util/android.h"
#endif
const int AirspyPlugin::m_maxDevices = 32;
@@ -65,6 +68,29 @@ void AirspyPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevices& or
return;
}
#ifdef ANDROID
QStringList serialStrings = Android::listUSBDeviceSerials(0x1d50, 0x60a1);
int deviceNo = 0;
for (const auto serialString : serialStrings)
{
QString displayableName(QString("Airspy[%1] %2").arg(deviceNo).arg(serialString));
originDevices.append(OriginDevice(
displayableName,
m_hardwareID,
serialString,
deviceNo,
1,
0
));
deviceNo++;
}
listedHwIds.append(m_hardwareID);
#else
airspy_read_partid_serialno_t read_partid_serialno;
struct airspy_device *devinfo;
uint32_t serial_msb = 0;
@@ -130,6 +156,8 @@ void AirspyPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevices& or
qDebug("AirspyPlugin::enumOriginDevices: airspy_exit: %s", airspy_error_name(rc));
listedHwIds.append(m_hardwareID);
#endif
}
PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources(const OriginDevices& originDevices)