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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user