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

#include <limesdrinputplugin.h>

+ Inheritance diagram for LimeSDRInputPlugin:
+ Collaboration diagram for LimeSDRInputPlugin:

Public Member Functions

 LimeSDRInputPlugin (QObject *parent=0)
 
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 = "LimeSDR"
 
static const QString m_deviceTypeID = LIMESDR_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 limesdrinputplugin.h.

Constructor & Destructor Documentation

◆ LimeSDRInputPlugin()

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

Definition at line 46 of file limesdrinputplugin.cpp.

46  :
47  QObject(parent)
48 {
49 }

Member Function Documentation

◆ createSampleSourcePluginInstance()

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

Reimplemented from PluginInterface.

Definition at line 161 of file limesdrinputplugin.cpp.

References m_deviceTypeID.

162 {
163  if (sourceId == m_deviceTypeID)
164  {
165  LimeSDRInput* input = new LimeSDRInput(deviceAPI);
166  return input;
167  }
168  else
169  {
170  return 0;
171  }
172 }
static const QString m_deviceTypeID

◆ createSampleSourcePluginInstanceGUI()

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

Reimplemented from PluginInterface.

Definition at line 125 of file limesdrinputplugin.cpp.

References m_deviceTypeID.

Referenced by enumSampleSources().

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

◆ enumSampleSources()

PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources ( )
virtual

Reimplemented from PluginInterface.

Definition at line 61 of file limesdrinputplugin.cpp.

References arg(), DeviceLimeSDRParams::close(), createSampleSourcePluginInstanceGUI(), findSerial(), i, m_deviceTypeID, m_hardwareID, DeviceLimeSDRParams::m_nbRxChannels, DeviceLimeSDRParams::open(), PluginInterface::SamplingDevice::PhysicalDevice, and PluginInterface::SamplingDevice::StreamSingleRx.

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

◆ findSerial()

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

Definition at line 143 of file limesdrinputplugin.cpp.

Referenced by enumSampleSources().

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

◆ getPluginDescriptor()

const PluginDescriptor & LimeSDRInputPlugin::getPluginDescriptor ( ) const
virtual

Implements PluginInterface.

Definition at line 51 of file limesdrinputplugin.cpp.

References m_pluginDescriptor.

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

◆ initPlugin()

void LimeSDRInputPlugin::initPlugin ( PluginAPI pluginAPI)
virtual

Implements PluginInterface.

Definition at line 56 of file limesdrinputplugin.cpp.

References m_deviceTypeID, and PluginAPI::registerSampleSource().

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

Member Data Documentation

◆ m_deviceTypeID

const QString LimeSDRInputPlugin::m_deviceTypeID = LIMESDR_DEVICE_TYPE_ID
static

◆ m_hardwareID

const QString LimeSDRInputPlugin::m_hardwareID = "LimeSDR"
static

Definition at line 46 of file limesdrinputplugin.h.

Referenced by enumSampleSources().

◆ m_pluginDescriptor

const PluginDescriptor LimeSDRInputPlugin::m_pluginDescriptor
staticprivate
Initial value:
= {
QString("LimeSDR Input"),
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 limesdrinputplugin.h.

Referenced by getPluginDescriptor().


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