From 3e3fd44ac0a3c7ed7033e5b55d975b0cdd4d868c Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 12 Apr 2017 00:55:00 +0200 Subject: [PATCH] LimeSDR support (4) --- Readme.md | 12 ++- debian/control | 2 +- .../limesdrinput/limesdrinputplugin.cpp | 96 +++++++++++++++++++ .../limesdrinput/limesdrinputplugin.h | 49 ++++++++++ 4 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 plugins/samplesource/limesdrinput/limesdrinputplugin.cpp create mode 100644 plugins/samplesource/limesdrinput/limesdrinputplugin.h diff --git a/Readme.md b/Readme.md index d992bc1e4..abc53bdc0 100644 --- a/Readme.md +++ b/Readme.md @@ -97,6 +97,12 @@ Then add the following defines on `cmake` command line: `-DLIMESUITE_INCLUDE_DIR=/opt/install/LimeSuite/include -DLIMESUITE_LIBRARY=/opt/install/LimeSuite/lib/libLimeSuite.so` +For binary installation you will need to install the following packages as a prerequisite: + + - `liblimesuite17.02-1_17.02.1-1_amd64.deb` + - `liblimesuite-dev_17.02.1-1_amd64.deb` + - `limesuite-udev_17.02.1-1_amd64.deb` (if you want the udev rules) +

RTL-SDR

RTL-SDR based dongles are supported through the librtlsdr library that should be installed in your system for proper build of the software and operation support. Add `librtlsdr-dev` to the list of dependencies to install. @@ -198,15 +204,17 @@ This is the archive of the complete binary distribution that expands to the `sdr

Debian distributions

-It is provided in the form of a .deb package for x86_64 architectures with SSE 4.1 support or ARMv7l architectures with Neon support. Please note that the ARM version is quite experimental and may or may not work depending on the hardware (it is very slow and unusable on a RPi3 for example). +It is provided in the form of .deb packages for x86_64 architectures with SSE 4.1 support or ARMv7l architectures with Neon support. Please note that the ARM version is quite experimental and may or may not work depending on the hardware (it is very slow and unusable on a RPi3 for example). -Install it as usual for a .deb package: +Install it as usual for .deb packages: - Make sure the `universe` repository is in your `/etc/apt/sources.list` Then in a terminal do: - `sudo apt-get update` + - `sudo dpkg -i liblimesuite17.02-1_17.02.1-1_amd64.deb` + - `sudo dpkg -i liblimesuite-dev_17.02.1-1_amd64.deb` - `sudo dpkg -i sdrangel_vx.y.z-1_amd64.deb` where x.y.z is the version number - `sudo apt-get -f install` this will install missing dependencies diff --git a/debian/control b/debian/control index 1fcc0b6ca..ee724a36c 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Homepage: https://github.com/f4exb/sdrangel Package: sdrangel Architecture: any -Depends: libc6, libasound2, libfftw3-single3, libgcc1, libgl1-mesa-glx, liblz4-1, libnanomsg0, libqt5core5a, libqt5gui5, libqt5multimedia5, libqt5network5, libqt5opengl5, libqt5widgets5, libstdc++6, libusb-1.0-0, libopencv-dev, ${shlibs:Depends}, ${misc:Depends} +Depends: libc6, libasound2, libfftw3-single3, libgcc1, libgl1-mesa-glx, liblz4-1, libnanomsg0, libqt5core5a, libqt5gui5, libqt5multimedia5, libqt5network5, libqt5opengl5, libqt5widgets5, libstdc++6, libusb-1.0-0, libopencv-dev, liblimesuite17.02-1, liblimesuite-dev, ${shlibs:Depends}, ${misc:Depends} Description: SDR/Analyzer/Generator front-end for various hardware SDR/Analyzer/Generator front-end for Airspy, BladeRF (Rx), HackRF (Rx), RTL-SDR and FunCube. Also File source and sink for I/Q samples, network I/Q sources with SDRDaemon. diff --git a/plugins/samplesource/limesdrinput/limesdrinputplugin.cpp b/plugins/samplesource/limesdrinput/limesdrinputplugin.cpp new file mode 100644 index 000000000..4934411b3 --- /dev/null +++ b/plugins/samplesource/limesdrinput/limesdrinputplugin.cpp @@ -0,0 +1,96 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2015 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "limesdrinputplugin.h" + +#include +#include + +#include "lime/LimeSuite.h" +#include "plugin/pluginapi.h" +#include "util/simpleserializer.h" +#include "device/devicesourceapi.h" + +#include "limesdrinputgui.h" + +const PluginDescriptor LimeSDRInputPlugin::m_pluginDescriptor = { + QString("LimeSDR Input"), + QString("3.4.0"), + QString("(c) Edouard Griffiths, F4EXB"), + QString("https://github.com/f4exb/sdrangel"), + true, + QString("https://github.com/f4exb/sdrangel") +}; + +const QString LimeSDRInputPlugin::m_hardwareID = "LimeSDR"; +const QString LimeSDRInputPlugin::m_deviceTypeID = LIMESDR_DEVICE_TYPE_ID; + +LimeSDRInputPlugin::LimeSDRInputPlugin(QObject* parent) : + QObject(parent) +{ +} + +const PluginDescriptor& LimeSDRInputPlugin::getPluginDescriptor() const +{ + return m_pluginDescriptor; +} + +void LimeSDRInputPlugin::initPlugin(PluginAPI* pluginAPI) +{ + pluginAPI->registerSampleSource(m_deviceTypeID, this); +} + +PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources() +{ + SamplingDevices result; + struct bladerf_devinfo *devinfo = 0; + + int count = bladerf_get_device_list(&devinfo); + + for(int i = 0; i < count; i++) + { + QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial)); + + result.append(SamplingDevice(displayedName, + m_hardwareID, + m_deviceTypeID, + QString(devinfo[i].serial), + i)); + } + + if (devinfo) + { + bladerf_free_device_list(devinfo); // Valgrind memcheck + } + + return result; +} + +PluginGUI* LimeSDRInputPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI) +{ + if(sourceId == m_deviceTypeID) + { + LimeSDRInputGui* gui = new LimeSDRInputGui(deviceAPI); + *widget = gui; + return gui; + } + else + { + return 0; + } +} + + diff --git a/plugins/samplesource/limesdrinput/limesdrinputplugin.h b/plugins/samplesource/limesdrinput/limesdrinputplugin.h new file mode 100644 index 000000000..2889d7423 --- /dev/null +++ b/plugins/samplesource/limesdrinput/limesdrinputplugin.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2017 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTPLUGIN_H_ +#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTPLUGIN_H_ + +#include +#include "plugin/plugininterface.h" + +class PluginAPI; + +#define LIMESDR_DEVICE_TYPE_ID "sdrangel.samplesource.limesdr" + +class LimeSDRInputPlugin : public QObject, public PluginInterface { + Q_OBJECT + Q_INTERFACES(PluginInterface) + Q_PLUGIN_METADATA(IID LIMESDR_DEVICE_TYPE_ID) + +public: + explicit LimeSDRInputPlugin(QObject* parent = 0); + + const PluginDescriptor& getPluginDescriptor() const; + void initPlugin(PluginAPI* pluginAPI); + + virtual SamplingDevices enumSampleSources(); + virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); + + static const QString m_hardwareID; + static const QString m_deviceTypeID; + +private: + static const PluginDescriptor m_pluginDescriptor; +}; + + +#endif /* PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTPLUGIN_H_ */