SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
AirspyPlugin Class Reference

#include <airspyplugin.h>

+ Inheritance diagram for AirspyPlugin:
+ Collaboration diagram for AirspyPlugin:

Public Member Functions

 AirspyPlugin (QObject *parent=NULL)
 
const PluginDescriptorgetPluginDescriptor () const
 
void initPlugin (PluginAPI *pluginAPI)
 
virtual SamplingDevices enumSampleSources ()
 
virtual PluginInstanceGUIcreateSampleSourcePluginInstanceGUI (const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
 
virtual DeviceSampleSourcecreateSampleSourcePluginInstance (const QString &sourceId, DeviceAPI *deviceAPI)
 
- Public Member Functions inherited from PluginInterface
virtual ~PluginInterface ()
 
virtual PluginInstanceGUIcreateRxChannelGUI (DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
 
virtual BasebandSampleSinkcreateRxChannelBS (DeviceAPI *deviceAPI)
 
virtual ChannelAPIcreateRxChannelCS (DeviceAPI *deviceAPI)
 
virtual PluginInstanceGUIcreateTxChannelGUI (DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
 
virtual BasebandSampleSourcecreateTxChannelBS (DeviceAPI *deviceAPI)
 
virtual ChannelAPIcreateTxChannelCS (DeviceAPI *deviceAPI)
 
virtual void deleteSampleSourcePluginInstanceGUI (PluginInstanceGUI *ui)
 
virtual void deleteSampleSourcePluginInstanceInput (DeviceSampleSource *source)
 
virtual SamplingDevices enumSampleSinks ()
 
virtual PluginInstanceGUIcreateSampleSinkPluginInstanceGUI (const QString &sinkId, QWidget **widget, DeviceUISet *deviceUISet)
 
virtual DeviceSampleSinkcreateSampleSinkPluginInstance (const QString &sinkId, DeviceAPI *deviceAPI)
 
virtual void deleteSampleSinkPluginInstanceGUI (PluginInstanceGUI *ui)
 
virtual void deleteSampleSinkPluginInstanceOutput (DeviceSampleSink *sink)
 
virtual SamplingDevices enumSampleMIMO ()
 
virtual PluginInstanceGUIcreateSampleMIMOPluginInstanceGUI (const QString &mimoId, QWidget **widget, DeviceUISet *deviceUISet)
 
virtual DeviceSampleMIMOcreateSampleMIMOPluginInstance (const QString &mimoId, DeviceAPI *deviceAPI)
 
virtual void deleteSampleMIMOPluginInstanceGUI (PluginInstanceGUI *ui)
 
virtual void deleteSampleMIMOPluginInstanceMIMO (DeviceSampleMIMO *mimo)
 

Static Public Attributes

static const QString m_hardwareID = "Airspy"
 
static const QString m_deviceTypeID = AIRSPY_DEVICE_TYPE_ID
 
static const int m_maxDevices = 32
 

Static Private Attributes

static const PluginDescriptor m_pluginDescriptor
 

Additional Inherited Members

- Public Types inherited from PluginInterface
typedef QList< SamplingDeviceSamplingDevices
 

Detailed Description

Definition at line 28 of file airspyplugin.h.

Constructor & Destructor Documentation

◆ AirspyPlugin()

AirspyPlugin::AirspyPlugin ( QObject *  parent = NULL)
explicit

Definition at line 45 of file airspyplugin.cpp.

45  :
46  QObject(parent)
47 {
48 }

Member Function Documentation

◆ createSampleSourcePluginInstance()

DeviceSampleSource * AirspyPlugin::createSampleSourcePluginInstance ( const QString &  sourceId,
DeviceAPI deviceAPI 
)
virtual

Reimplemented from PluginInterface.

Definition at line 161 of file airspyplugin.cpp.

References m_deviceTypeID.

162 {
163  if (sourceId == m_deviceTypeID)
164  {
165  AirspyInput* input = new AirspyInput(deviceAPI);
166  return input;
167  }
168  else
169  {
170  return 0;
171  }
172 }
static const QString m_deviceTypeID
Definition: airspyplugin.h:47

◆ createSampleSourcePluginInstanceGUI()

PluginInstanceGUI * AirspyPlugin::createSampleSourcePluginInstanceGUI ( const QString &  sourceId,
QWidget **  widget,
DeviceUISet deviceUISet 
)
virtual

Reimplemented from PluginInterface.

Definition at line 143 of file airspyplugin.cpp.

References m_deviceTypeID.

Referenced by enumSampleSources().

147 {
148  if (sourceId == m_deviceTypeID)
149  {
150  AirspyGui* gui = new AirspyGui(deviceUISet);
151  *widget = gui;
152  return gui;
153  }
154  else
155  {
156  return 0;
157  }
158 }
static const QString m_deviceTypeID
Definition: airspyplugin.h:47
+ Here is the caller graph for this function:

◆ enumSampleSources()

PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources ( )
virtual

Reimplemented from PluginInterface.

Definition at line 60 of file airspyplugin.cpp.

References arg(), createSampleSourcePluginInstanceGUI(), i, m_deviceTypeID, m_hardwareID, m_maxDevices, PluginInterface::SamplingDevice::PhysicalDevice, and PluginInterface::SamplingDevice::StreamSingleRx.

61 {
62  SamplingDevices result;
63  airspy_read_partid_serialno_t read_partid_serialno;
64  struct airspy_device *devinfo;
65  uint32_t serial_msb = 0;
66  uint32_t serial_lsb = 0;
67  airspy_error rc;
68  int i;
69 
70  rc = (airspy_error) airspy_init();
71 
72  if (rc != AIRSPY_SUCCESS)
73  {
74  qCritical("AirspyPlugin::enumSampleSources: failed to initiate Airspy library: %s", airspy_error_name(rc));
75  }
76 
77  for (i=0; i < m_maxDevices; i++)
78  {
79  rc = (airspy_error) airspy_open(&devinfo);
80 
81  if (rc == AIRSPY_SUCCESS)
82  {
83  qDebug("AirspyPlugin::enumSampleSources: try to enumerate Airspy device #%d", i);
84 
85  rc = (airspy_error) airspy_board_partid_serialno_read(devinfo, &read_partid_serialno);
86 
87  if (rc != AIRSPY_SUCCESS)
88  {
89  qDebug("AirspyPlugin::enumSampleSources: failed to read serial no: %s", airspy_error_name(rc));
90  airspy_close(devinfo);
91  continue; // next
92  }
93 
94  if ((read_partid_serialno.serial_no[2] != serial_msb) && (read_partid_serialno.serial_no[3] != serial_lsb))
95  {
96  serial_msb = read_partid_serialno.serial_no[2];
97  serial_lsb = read_partid_serialno.serial_no[3];
98 
99  QString serial_str = QString::number(serial_msb, 16) + QString::number(serial_lsb, 16);
100  //uint64_t serial_num = (((uint64_t) serial_msb)<<32) + serial_lsb;
101  QString displayedName(QString("Airspy[%1] %2").arg(i).arg(serial_str));
102 
103  result.append(SamplingDevice(displayedName,
104  m_hardwareID,
106  serial_str,
107  i,
110  1,
111  0));
112 
113  qDebug("AirspyPlugin::enumSampleSources: enumerated Airspy device #%d", i);
114  }
115 
116  airspy_close(devinfo);
117  }
118  else
119  {
120  qDebug("AirspyPlugin::enumSampleSources: enumerated %d Airspy devices %s", i, airspy_error_name(rc));
121  break; // finished
122  }
123  }
124 
125  rc = (airspy_error) airspy_exit();
126  qDebug("AirspyPlugin::enumSampleSources: airspy_exit: %s", airspy_error_name(rc));
127 
128  return result;
129 }
static const int m_maxDevices
Definition: airspyplugin.h:48
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
static const QString m_deviceTypeID
Definition: airspyplugin.h:47
int32_t i
Definition: decimators.h:244
static const QString m_hardwareID
Definition: airspyplugin.h:46
Exposes a single input stream that can be one of the streams of a physical device.
QList< SamplingDevice > SamplingDevices
+ Here is the call graph for this function:

◆ getPluginDescriptor()

const PluginDescriptor & AirspyPlugin::getPluginDescriptor ( ) const
virtual

Implements PluginInterface.

Definition at line 50 of file airspyplugin.cpp.

References m_pluginDescriptor.

51 {
52  return m_pluginDescriptor;
53 }
static const PluginDescriptor m_pluginDescriptor
Definition: airspyplugin.h:51

◆ initPlugin()

void AirspyPlugin::initPlugin ( PluginAPI pluginAPI)
virtual

Implements PluginInterface.

Definition at line 55 of file airspyplugin.cpp.

References m_deviceTypeID, and PluginAPI::registerSampleSource().

56 {
57  pluginAPI->registerSampleSource(m_deviceTypeID, this);
58 }
void registerSampleSource(const QString &sourceName, PluginInterface *plugin)
Definition: pluginapi.cpp:9
static const QString m_deviceTypeID
Definition: airspyplugin.h:47
+ Here is the call graph for this function:

Member Data Documentation

◆ m_deviceTypeID

const QString AirspyPlugin::m_deviceTypeID = AIRSPY_DEVICE_TYPE_ID
static

◆ m_hardwareID

const QString AirspyPlugin::m_hardwareID = "Airspy"
static

Definition at line 46 of file airspyplugin.h.

Referenced by enumSampleSources().

◆ m_maxDevices

const int AirspyPlugin::m_maxDevices = 32
static

Definition at line 48 of file airspyplugin.h.

Referenced by enumSampleSources(), and AirspyInput::open_airspy_from_sequence().

◆ m_pluginDescriptor

const PluginDescriptor AirspyPlugin::m_pluginDescriptor
staticprivate
Initial value:
= {
QString("Airspy Input"),
QString("4.5.2"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
QString("https://github.com/f4exb/sdrangel")
}

Definition at line 51 of file airspyplugin.h.

Referenced by getPluginDescriptor().


The documentation for this class was generated from the following files: