19 #include <libairspy/airspy.h> 34 QString(
"Airspy Input"),
36 QString(
"(c) Edouard Griffiths, F4EXB"),
37 QString(
"https://github.com/f4exb/sdrangel"),
39 QString(
"https://github.com/f4exb/sdrangel")
63 airspy_read_partid_serialno_t read_partid_serialno;
64 struct airspy_device *devinfo;
70 rc = (airspy_error) airspy_init();
72 if (rc != AIRSPY_SUCCESS)
74 qCritical(
"AirspyPlugin::enumSampleSources: failed to initiate Airspy library: %s", airspy_error_name(rc));
79 rc = (airspy_error) airspy_open(&devinfo);
81 if (rc == AIRSPY_SUCCESS)
83 qDebug(
"AirspyPlugin::enumSampleSources: try to enumerate Airspy device #%d", i);
85 rc = (airspy_error) airspy_board_partid_serialno_read(devinfo, &read_partid_serialno);
87 if (rc != AIRSPY_SUCCESS)
89 qDebug(
"AirspyPlugin::enumSampleSources: failed to read serial no: %s", airspy_error_name(rc));
90 airspy_close(devinfo);
94 if ((read_partid_serialno.serial_no[2] != serial_msb) && (read_partid_serialno.serial_no[3] != serial_lsb))
96 serial_msb = read_partid_serialno.serial_no[2];
97 serial_lsb = read_partid_serialno.serial_no[3];
99 QString serial_str = QString::number(serial_msb, 16) + QString::number(serial_lsb, 16);
101 QString displayedName(QString(
"Airspy[%1] %2").
arg(i).
arg(serial_str));
113 qDebug(
"AirspyPlugin::enumSampleSources: enumerated Airspy device #%d", i);
116 airspy_close(devinfo);
120 qDebug(
"AirspyPlugin::enumSampleSources: enumerated %d Airspy devices %s", i, airspy_error_name(rc));
125 rc = (airspy_error) airspy_exit();
126 qDebug(
"AirspyPlugin::enumSampleSources: airspy_exit: %s", airspy_error_name(rc));
133 const QString& sourceId,
144 const QString& sourceId,
void registerSampleSource(const QString &sourceName, PluginInterface *plugin)
const PluginDescriptor & getPluginDescriptor() const
static const int m_maxDevices
static const PluginDescriptor m_pluginDescriptor
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
static const QString m_deviceTypeID
AirspyPlugin(QObject *parent=NULL)
#define AIRSPY_DEVICE_TYPE_ID
virtual DeviceSampleSource * createSampleSourcePluginInstance(const QString &sourceId, DeviceAPI *deviceAPI)
static const QString m_hardwareID
Exposes a single input stream that can be one of the streams of a physical device.
void initPlugin(PluginAPI *pluginAPI)
virtual SamplingDevices enumSampleSources()
QList< SamplingDevice > SamplingDevices
virtual PluginInstanceGUI * createSampleSourcePluginInstanceGUI(const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)