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

#include <hackrfoutputplugin.h>

+ Inheritance diagram for HackRFOutputPlugin:
+ Collaboration diagram for HackRFOutputPlugin:

Public Member Functions

 HackRFOutputPlugin (QObject *parent=NULL)
 
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 = "HackRF"
 
static const QString m_deviceTypeID = HACKRFOUTPUT_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 hackrfoutputplugin.h.

Constructor & Destructor Documentation

◆ HackRFOutputPlugin()

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

Definition at line 43 of file hackrfoutputplugin.cpp.

43  :
44  QObject(parent)
45 {
46 }

Member Function Documentation

◆ createSampleSinkPluginInstance()

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

Reimplemented from PluginInterface.

Definition at line 154 of file hackrfoutputplugin.cpp.

References m_deviceTypeID.

155 {
156  if(sinkId == m_deviceTypeID)
157  {
158  HackRFOutput* output = new HackRFOutput(deviceAPI);
159  return output;
160  }
161  else
162  {
163  return 0;
164  }
165 
166 }
static const QString m_deviceTypeID

◆ createSampleSinkPluginInstanceGUI()

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

Reimplemented from PluginInterface.

Definition at line 136 of file hackrfoutputplugin.cpp.

References m_deviceTypeID.

Referenced by enumSampleSinks().

140 {
141  if(sinkId == m_deviceTypeID)
142  {
143  HackRFOutputGui* gui = new HackRFOutputGui(deviceUISet);
144  *widget = gui;
145  return gui;
146  }
147  else
148  {
149  return 0;
150  }
151 }
static const QString m_deviceTypeID
+ Here is the caller graph for this function:

◆ enumSampleSinks()

PluginInterface::SamplingDevices HackRFOutputPlugin::enumSampleSinks ( )
virtual

Reimplemented from PluginInterface.

Definition at line 58 of file hackrfoutputplugin.cpp.

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

59 {
60 // hackrf_error rc = (hackrf_error) hackrf_init();
61 //
62 // if (rc != HACKRF_SUCCESS)
63 // {
64 // qCritical("HackRFOutputPlugin::enumSampleSinks: failed to initiate HackRF library: %s", hackrf_error_name(rc));
65 // }
66 
67  SamplingDevices result;
68  hackrf_device_list_t *hackrf_devices = hackrf_device_list();
69  hackrf_device *hackrf_ptr;
70  read_partid_serialno_t read_partid_serialno;
71  int i;
72 
73  for (i=0; i < hackrf_devices->devicecount; i++)
74  {
75  hackrf_error rc = (hackrf_error) hackrf_device_list_open(hackrf_devices, i, &hackrf_ptr);
76 
77  if (rc == HACKRF_SUCCESS)
78  {
79  qDebug("HackRFOutputPlugin::enumSampleSinks: try to enumerate HackRF device #%d", i);
80 
81  rc = (hackrf_error) hackrf_board_partid_serialno_read(hackrf_ptr, &read_partid_serialno);
82 
83  if (rc != HACKRF_SUCCESS)
84  {
85  qDebug("HackRFOutputPlugin::enumSampleSinks: failed to read serial no: %s", hackrf_error_name(rc));
86  hackrf_close(hackrf_ptr);
87  continue; // next
88  }
89 
90  uint32_t serial_msb = read_partid_serialno.serial_no[2];
91  uint32_t serial_lsb = read_partid_serialno.serial_no[3];
92 
93  QString serial_str = QString::number(serial_msb, 16) + QString::number(serial_lsb, 16);
94  //uint64_t serial_num = (((uint64_t) serial_msb)<<32) + serial_lsb;
95  QString displayedName(QString("HackRF[%1] %2").arg(i).arg(serial_str));
96 
97  result.append(SamplingDevice(displayedName,
100  serial_str,
101  i,
104  1,
105  0));
106 
107  qDebug("HackRFOutputPlugin::enumSampleSinks: enumerated HackRF device #%d", i);
108 
109  hackrf_close(hackrf_ptr);
110  }
111  else
112  {
113  qDebug("HackRFOutputPlugin::enumSampleSinks: failed to enumerate HackRF device #%d: %s", i, hackrf_error_name(rc));
114  }
115  }
116 
117  hackrf_device_list_free(hackrf_devices);
118 // rc = (hackrf_error) hackrf_exit();
119 // qDebug("HackRFOutputPlugin::enumSampleSinks: hackrf_exit: %s", hackrf_error_name(rc));
120 
121  return result;
122 }
static const QString m_hardwareID
unsigned int uint32_t
Definition: rtptypes_win.h:46
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_deviceTypeID
QList< SamplingDevice > SamplingDevices
+ Here is the call graph for this function:

◆ getPluginDescriptor()

const PluginDescriptor & HackRFOutputPlugin::getPluginDescriptor ( ) const
virtual

Implements PluginInterface.

Definition at line 48 of file hackrfoutputplugin.cpp.

References m_pluginDescriptor.

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

◆ initPlugin()

void HackRFOutputPlugin::initPlugin ( PluginAPI pluginAPI)
virtual

Implements PluginInterface.

Definition at line 53 of file hackrfoutputplugin.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 HackRFOutputPlugin::m_deviceTypeID = HACKRFOUTPUT_DEVICE_TYPE_ID
static

◆ m_hardwareID

const QString HackRFOutputPlugin::m_hardwareID = "HackRF"
static

Definition at line 46 of file hackrfoutputplugin.h.

Referenced by enumSampleSinks().

◆ m_pluginDescriptor

const PluginDescriptor HackRFOutputPlugin::m_pluginDescriptor
staticprivate
Initial value:
= {
QString("HackRF 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 hackrfoutputplugin.h.

Referenced by getPluginDescriptor().


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