19 #include "libhackrf/hackrf.h" 32 QString(
"HackRF Output"),
34 QString(
"(c) Edouard Griffiths, F4EXB"),
35 QString(
"https://github.com/f4exb/sdrangel"),
37 QString(
"https://github.com/f4exb/sdrangel")
68 hackrf_device_list_t *hackrf_devices = hackrf_device_list();
69 hackrf_device *hackrf_ptr;
70 read_partid_serialno_t read_partid_serialno;
73 for (i=0; i < hackrf_devices->devicecount; i++)
75 hackrf_error rc = (hackrf_error) hackrf_device_list_open(hackrf_devices, i, &hackrf_ptr);
77 if (rc == HACKRF_SUCCESS)
79 qDebug(
"HackRFOutputPlugin::enumSampleSinks: try to enumerate HackRF device #%d", i);
81 rc = (hackrf_error) hackrf_board_partid_serialno_read(hackrf_ptr, &read_partid_serialno);
83 if (rc != HACKRF_SUCCESS)
85 qDebug(
"HackRFOutputPlugin::enumSampleSinks: failed to read serial no: %s", hackrf_error_name(rc));
86 hackrf_close(hackrf_ptr);
90 uint32_t serial_msb = read_partid_serialno.serial_no[2];
91 uint32_t serial_lsb = read_partid_serialno.serial_no[3];
93 QString serial_str = QString::number(serial_msb, 16) + QString::number(serial_lsb, 16);
95 QString displayedName(QString(
"HackRF[%1] %2").
arg(i).
arg(serial_str));
107 qDebug(
"HackRFOutputPlugin::enumSampleSinks: enumerated HackRF device #%d", i);
109 hackrf_close(hackrf_ptr);
113 qDebug(
"HackRFOutputPlugin::enumSampleSinks: failed to enumerate HackRF device #%d: %s", i, hackrf_error_name(rc));
117 hackrf_device_list_free(hackrf_devices);
126 const QString& sinkId,
137 const QString& sinkId,
HackRFOutputPlugin(QObject *parent=NULL)
void registerSampleSink(const QString &sinkName, PluginInterface *plugin)
static const QString m_hardwareID
static const PluginDescriptor m_pluginDescriptor
virtual DeviceSampleSink * createSampleSinkPluginInstance(const QString &sinkId, DeviceAPI *deviceAPI)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
const PluginDescriptor & getPluginDescriptor() const
Exposes a single output stream that can be one of the streams of a physical device.
#define HACKRFOUTPUT_DEVICE_TYPE_ID
virtual PluginInstanceGUI * createSampleSinkPluginInstanceGUI(const QString &sinkId, QWidget **widget, DeviceUISet *deviceUISet)
static const QString m_deviceTypeID
void initPlugin(PluginAPI *pluginAPI)
QList< SamplingDevice > SamplingDevices
virtual SamplingDevices enumSampleSinks()