2014-11-29 13:09:35 -05:00
|
|
|
#include <QtPlugin>
|
|
|
|
#include <QAction>
|
|
|
|
#include "plugin/pluginapi.h"
|
|
|
|
#include "util/simpleserializer.h"
|
|
|
|
#include "fcdplugin.h"
|
|
|
|
#include "fcdgui.h"
|
|
|
|
|
|
|
|
const PluginDescriptor FCDPlugin::m_pluginDescriptor = {
|
|
|
|
QString("FunCube Input"),
|
2014-12-02 09:23:21 -05:00
|
|
|
QString("V20"),
|
2014-11-29 13:09:35 -05:00
|
|
|
QString("(c) John Greb"),
|
|
|
|
QString("http://funcubedongle.com"),
|
|
|
|
true,
|
2014-12-03 13:41:38 -05:00
|
|
|
QString("github.com/hexameron/rtl-sdrangelove")
|
2014-11-29 13:09:35 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
FCDPlugin::FCDPlugin(QObject* parent) :
|
|
|
|
QObject(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const PluginDescriptor& FCDPlugin::getPluginDescriptor() const
|
|
|
|
{
|
|
|
|
return m_pluginDescriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FCDPlugin::initPlugin(PluginAPI* pluginAPI)
|
|
|
|
{
|
|
|
|
m_pluginAPI = pluginAPI;
|
|
|
|
|
|
|
|
m_pluginAPI->registerSampleSource("org.osmocom.sdr.samplesource.fcd", this);
|
|
|
|
}
|
|
|
|
|
|
|
|
PluginInterface::SampleSourceDevices FCDPlugin::enumSampleSources()
|
|
|
|
{
|
|
|
|
SampleSourceDevices result;
|
|
|
|
|
|
|
|
QString displayedName(QString("Funcube Dongle #1"));
|
|
|
|
SimpleSerializer s(1);
|
|
|
|
s.writeS32(1, 0);
|
|
|
|
result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.fcd", s.final()));
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2015-08-17 20:47:14 -04:00
|
|
|
PluginGUI* FCDPlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address)
|
2014-11-29 13:09:35 -05:00
|
|
|
{
|
|
|
|
if(sourceName == "org.osmocom.sdr.samplesource.fcd") {
|
|
|
|
FCDGui* gui = new FCDGui(m_pluginAPI);
|
|
|
|
m_pluginAPI->setInputGUI(gui);
|
|
|
|
return gui;
|
|
|
|
} else {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|