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 Member Functions | Static Private Attributes | List of all members
LimeSDROutputPlugin Class Reference

#include <limesdroutputplugin.h>

+ Inheritance diagram for LimeSDROutputPlugin:
+ Collaboration diagram for LimeSDROutputPlugin:

Public Member Functions

 LimeSDROutputPlugin (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 = "LimeSDR"
 
static const QString m_deviceTypeID = LIMESDROUTPUT_DEVICE_TYPE_ID
 

Static Private Member Functions

static bool findSerial (const char *lmsInfoStr, std::string &serial)
 

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

Constructor & Destructor Documentation

◆ LimeSDROutputPlugin()

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

Definition at line 47 of file limesdroutputplugin.cpp.

47  :
48  QObject(parent)
49 {
50 }

Member Function Documentation

◆ createSampleSinkPluginInstance()

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

Reimplemented from PluginInterface.

Definition at line 162 of file limesdroutputplugin.cpp.

References m_deviceTypeID.

163 {
164  if(sinkId == m_deviceTypeID)
165  {
166  LimeSDROutput* output = new LimeSDROutput(deviceAPI);
167  return output;
168  }
169  else
170  {
171  return 0;
172  }
173 }
static const QString m_deviceTypeID

◆ createSampleSinkPluginInstanceGUI()

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

Reimplemented from PluginInterface.

Definition at line 126 of file limesdroutputplugin.cpp.

References m_deviceTypeID.

Referenced by enumSampleSinks().

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

◆ enumSampleSinks()

PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks ( )
virtual

Reimplemented from PluginInterface.

Definition at line 62 of file limesdroutputplugin.cpp.

References arg(), DeviceLimeSDRParams::close(), createSampleSinkPluginInstanceGUI(), findSerial(), i, m_deviceTypeID, m_hardwareID, DeviceLimeSDRParams::m_nbTxChannels, DeviceLimeSDRParams::open(), PluginInterface::SamplingDevice::PhysicalDevice, and PluginInterface::SamplingDevice::StreamSingleTx.

63 {
64  lms_info_str_t* deviceList;
65  int nbDevices;
66  SamplingDevices result;
67 
68  if ((nbDevices = LMS_GetDeviceList(0)) <= 0)
69  {
70  qDebug("LimeSDROutputPlugin::enumSampleSources: Could not find any LimeSDR device");
71  return result; // empty result
72  }
73 
74  deviceList = new lms_info_str_t[nbDevices];
75 
76  if (LMS_GetDeviceList(deviceList) < 0)
77  {
78  qDebug("LimeSDROutputPlugin::enumSampleSources: Could not obtain LimeSDR devices information");
79  delete[] deviceList;
80  return result; // empty result
81  }
82  else
83  {
84  for (int i = 0; i < nbDevices; i++)
85  {
86  std::string serial("N/D");
87  findSerial((const char *) deviceList[i], serial);
88 
89  DeviceLimeSDRParams limeSDRParams;
90  limeSDRParams.open(deviceList[i]);
91  limeSDRParams.close();
92 
93  for (unsigned int j = 0; j < limeSDRParams.m_nbTxChannels; j++)
94  {
95  qDebug("LimeSDROutputPlugin::enumSampleSources: device #%d channel %u: %s", i, j, (char *) deviceList[i]);
96  QString displayedName(QString("LimeSDR[%1:%2] %3").arg(i).arg(j).arg(serial.c_str()));
97  result.append(SamplingDevice(displayedName,
100  QString(deviceList[i]),
101  i,
104  limeSDRParams.m_nbTxChannels,
105  j));
106  }
107  }
108  }
109 
110  delete[] deviceList;
111  return result;
112 }
static bool findSerial(const char *lmsInfoStr, std::string &serial)
uint32_t m_nbTxChannels
number of Tx channels (normally 2, we&#39;ll see if we really use it...)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
static const QString m_hardwareID
int32_t i
Definition: decimators.h:244
static const QString m_deviceTypeID
Exposes a single output stream that can be one of the streams of a physical device.
bool open(lms_info_str_t deviceStr)
QList< SamplingDevice > SamplingDevices
+ Here is the call graph for this function:

◆ findSerial()

bool LimeSDROutputPlugin::findSerial ( const char *  lmsInfoStr,
std::string &  serial 
)
staticprivate

Definition at line 144 of file limesdroutputplugin.cpp.

Referenced by enumSampleSinks().

145 {
146  std::regex serial_reg("serial=([0-9,A-F]+)");
147  std::string input(lmsInfoStr);
148  std::smatch result;
149  std::regex_search(input, result, serial_reg);
150 
151  if (result[1].str().length()>0)
152  {
153  serial = result[1].str();
154  return true;
155  }
156  else
157  {
158  return false;
159  }
160 }
+ Here is the caller graph for this function:

◆ getPluginDescriptor()

const PluginDescriptor & LimeSDROutputPlugin::getPluginDescriptor ( ) const
virtual

Implements PluginInterface.

Definition at line 52 of file limesdroutputplugin.cpp.

References m_pluginDescriptor.

53 {
54  return m_pluginDescriptor;
55 }
static const PluginDescriptor m_pluginDescriptor

◆ initPlugin()

void LimeSDROutputPlugin::initPlugin ( PluginAPI pluginAPI)
virtual

Implements PluginInterface.

Definition at line 57 of file limesdroutputplugin.cpp.

References m_deviceTypeID, and PluginAPI::registerSampleSink().

58 {
59  pluginAPI->registerSampleSink(m_deviceTypeID, this);
60 }
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 LimeSDROutputPlugin::m_deviceTypeID = LIMESDROUTPUT_DEVICE_TYPE_ID
static

◆ m_hardwareID

const QString LimeSDROutputPlugin::m_hardwareID = "LimeSDR"
static

Definition at line 46 of file limesdroutputplugin.h.

Referenced by enumSampleSinks().

◆ m_pluginDescriptor

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

Definition at line 50 of file limesdroutputplugin.h.

Referenced by getPluginDescriptor().


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