19 #include <libbladeRF.h> 32 QString(
"BladeRF2 Output"),
34 QString(
"(c) Edouard Griffiths, F4EXB"),
35 QString(
"https://github.com/f4exb/sdrangel"),
37 QString(
"https://github.com/f4exb/sdrangel")
61 struct bladerf_devinfo *devinfo = 0;
63 int count = bladerf_get_device_list(&devinfo);
67 for(
int i = 0;
i < count;
i++)
71 int status = bladerf_open_with_devinfo(&dev, &devinfo[
i]);
73 if (status == BLADERF_ERR_NODEV)
75 qCritical(
"Bladerf2OutputPlugin::enumSampleSinks: No device at index %d", i);
80 qCritical(
"Bladerf2OutputPlugin::enumSampleSinks: Failed to open device at index %d", i);
84 const char *boardName = bladerf_get_board_name(dev);
86 if (strcmp(boardName,
"bladerf2") == 0)
88 unsigned int nbTxChannels = bladerf_get_channel_count(dev, BLADERF_TX);
90 for (
unsigned int j = 0; j < nbTxChannels; j++)
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));
97 QString(devinfo[i].serial),
109 bladerf_free_device_list(devinfo);
117 const QString& sinkId,
128 const QString& sinkId,
void registerSampleSink(const QString &sinkName, PluginInterface *plugin)
virtual SamplingDevices enumSampleSinks()
static const QString m_deviceTypeID
static const PluginDescriptor m_pluginDescriptor
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
#define BLADERF2OUTPUT_DEVICE_TYPE_ID
virtual DeviceSampleSink * createSampleSinkPluginInstance(const QString &sinkId, DeviceAPI *deviceAPI)
virtual PluginInstanceGUI * createSampleSinkPluginInstanceGUI(const QString &sinkId, QWidget **widget, DeviceUISet *deviceUISet)
const PluginDescriptor & getPluginDescriptor() const
Exposes a single output stream that can be one of the streams of a physical device.
static const QString m_hardwareID
BladeRF2OutputPlugin(QObject *parent=0)
QList< SamplingDevice > SamplingDevices
void initPlugin(PluginAPI *pluginAPI)