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
BladeRF2OutputPlugin Class Reference

#include <bladerf2outputplugin.h>

+ Inheritance diagram for BladeRF2OutputPlugin:
+ Collaboration diagram for BladeRF2OutputPlugin:

Public Member Functions

 BladeRF2OutputPlugin (QObject *parent=0)
 
const PluginDescriptorgetPluginDescriptor () const
 
void initPlugin (PluginAPI *pluginAPI)
 
virtual SamplingDevices enumSampleSinks ()
 
virtual PluginInstanceGUIcreateSampleSinkPluginInstanceGUI (const QString &sinkId, QWidget **widget, DeviceUISet *deviceUISet)
 
virtual DeviceSampleSinkcreateSampleSinkPluginInstance (const QString &sinkId, 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 SamplingDevices enumSampleSources ()
 
virtual PluginInstanceGUIcreateSampleSourcePluginInstanceGUI (const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
 
virtual DeviceSampleSourcecreateSampleSourcePluginInstance (const QString &sourceId, DeviceAPI *deviceAPI)
 
virtual void deleteSampleSourcePluginInstanceGUI (PluginInstanceGUI *ui)
 
virtual void deleteSampleSourcePluginInstanceInput (DeviceSampleSource *source)
 
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 = "BladeRF2"
 
static const QString m_deviceTypeID = BLADERF2OUTPUT_DEVICE_TYPE_ID
 

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 bladerf2outputplugin.h.

Constructor & Destructor Documentation

◆ BladeRF2OutputPlugin()

BladeRF2OutputPlugin::BladeRF2OutputPlugin ( QObject *  parent = 0)
explicit

Definition at line 43 of file bladerf2outputplugin.cpp.

43  :
44  QObject(parent)
45 {
46 }

Member Function Documentation

◆ createSampleSinkPluginInstance()

DeviceSampleSink * BladeRF2OutputPlugin::createSampleSinkPluginInstance ( const QString &  sinkId,
DeviceAPI deviceAPI 
)
virtual

Reimplemented from PluginInterface.

Definition at line 145 of file bladerf2outputplugin.cpp.

References m_deviceTypeID.

146 {
147  if(sinkId == m_deviceTypeID)
148  {
149  BladeRF2Output* output = new BladeRF2Output(deviceAPI);
150  return output;
151  }
152  else
153  {
154  return 0;
155  }
156 }
static const QString m_deviceTypeID

◆ createSampleSinkPluginInstanceGUI()

PluginInstanceGUI * BladeRF2OutputPlugin::createSampleSinkPluginInstanceGUI ( const QString &  sinkId,
QWidget **  widget,
DeviceUISet deviceUISet 
)
virtual

Reimplemented from PluginInterface.

Definition at line 127 of file bladerf2outputplugin.cpp.

References m_deviceTypeID.

Referenced by enumSampleSinks().

131 {
132  if(sinkId == m_deviceTypeID)
133  {
134  BladeRF2OutputGui* gui = new BladeRF2OutputGui(deviceUISet);
135  *widget = gui;
136  return gui;
137  }
138  else
139  {
140  return 0;
141  }
142 }
static const QString m_deviceTypeID
+ Here is the caller graph for this function:

◆ enumSampleSinks()

PluginInterface::SamplingDevices BladeRF2OutputPlugin::enumSampleSinks ( )
virtual

Reimplemented from PluginInterface.

Definition at line 58 of file bladerf2outputplugin.cpp.

References arg(), createSampleSinkPluginInstanceGUI(), i, m_deviceTypeID, m_hardwareID, PluginInterface::SamplingDevice::PhysicalDevice, and PluginInterface::SamplingDevice::StreamSingleTx.

59 {
60  SamplingDevices result;
61  struct bladerf_devinfo *devinfo = 0;
62 
63  int count = bladerf_get_device_list(&devinfo);
64 
65  if (devinfo)
66  {
67  for(int i = 0; i < count; i++)
68  {
69  struct bladerf *dev;
70 
71  int status = bladerf_open_with_devinfo(&dev, &devinfo[i]);
72 
73  if (status == BLADERF_ERR_NODEV)
74  {
75  qCritical("Bladerf2OutputPlugin::enumSampleSinks: No device at index %d", i);
76  continue;
77  }
78  else if (status != 0)
79  {
80  qCritical("Bladerf2OutputPlugin::enumSampleSinks: Failed to open device at index %d", i);
81  continue;
82  }
83 
84  const char *boardName = bladerf_get_board_name(dev);
85 
86  if (strcmp(boardName, "bladerf2") == 0)
87  {
88  unsigned int nbTxChannels = bladerf_get_channel_count(dev, BLADERF_TX);
89 
90  for (unsigned int j = 0; j < nbTxChannels; j++)
91  {
92  qDebug("Blderf2InputPlugin::enumSampleSinks: device #%d (%s) channel %u", i, devinfo[i].serial, j);
93  QString displayedName(QString("BladeRF2[%1:%2] %3").arg(devinfo[i].instance).arg(j).arg(devinfo[i].serial));
94  result.append(SamplingDevice(displayedName,
97  QString(devinfo[i].serial),
98  i,
101  nbTxChannels,
102  j));
103  }
104  }
105 
106  bladerf_close(dev);
107  }
108 
109  bladerf_free_device_list(devinfo); // Valgrind memcheck
110  }
111 
112  return result;
113 }
static const QString m_deviceTypeID
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int32_t i
Definition: decimators.h:244
Exposes a single output stream that can be one of the streams of a physical device.
static const QString m_hardwareID
QList< SamplingDevice > SamplingDevices
+ Here is the call graph for this function:

◆ getPluginDescriptor()

const PluginDescriptor & BladeRF2OutputPlugin::getPluginDescriptor ( ) const
virtual

Implements PluginInterface.

Definition at line 48 of file bladerf2outputplugin.cpp.

References m_pluginDescriptor.

49 {
50  return m_pluginDescriptor;
51 }
static const PluginDescriptor m_pluginDescriptor

◆ initPlugin()

void BladeRF2OutputPlugin::initPlugin ( PluginAPI pluginAPI)
virtual

Implements PluginInterface.

Definition at line 53 of file bladerf2outputplugin.cpp.

References m_deviceTypeID, and PluginAPI::registerSampleSink().

54 {
55  pluginAPI->registerSampleSink(m_deviceTypeID, this);
56 }
void registerSampleSink(const QString &sinkName, PluginInterface *plugin)
Definition: pluginapi.cpp:24
static const QString m_deviceTypeID
+ Here is the call graph for this function:

Member Data Documentation

◆ m_deviceTypeID

const QString BladeRF2OutputPlugin::m_deviceTypeID = BLADERF2OUTPUT_DEVICE_TYPE_ID
static

◆ m_hardwareID

const QString BladeRF2OutputPlugin::m_hardwareID = "BladeRF2"
static

Definition at line 48 of file bladerf2outputplugin.h.

Referenced by enumSampleSinks().

◆ m_pluginDescriptor

const PluginDescriptor BladeRF2OutputPlugin::m_pluginDescriptor
staticprivate
Initial value:
= {
QString("BladeRF2 Output"),
QString("4.5.4"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
QString("https://github.com/f4exb/sdrangel")
}

Definition at line 52 of file bladerf2outputplugin.h.

Referenced by getPluginDescriptor().


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