1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Server: added Airspy input plugin

This commit is contained in:
f4exb 2018-05-29 16:48:41 +02:00
parent 358f683e37
commit d87fb7e348
4 changed files with 85 additions and 2 deletions

View File

@ -24,7 +24,6 @@
#include "SWGDeviceReport.h"
#include "SWGAirspyReport.h"
#include "airspygui.h"
#include "airspyinput.h"
#include "airspyplugin.h"

View File

@ -15,10 +15,13 @@
///////////////////////////////////////////////////////////////////////////////////
#include <QtPlugin>
#include <QAction>
#include <libairspy/airspy.h>
#ifdef SERVER_MODE
#include "airspyinput.h"
#else
#include "airspygui.h"
#endif
#include "airspyplugin.h"
#include <device/devicesourceapi.h>
@ -125,6 +128,15 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
return result;
}
#ifdef SERVER_MODE
PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{
return 0;
}
#else
PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
@ -141,6 +153,7 @@ PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
return 0;
}
}
#endif
DeviceSampleSource *AirspyPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
{

View File

@ -13,6 +13,11 @@ if(V4L-MSI)
# add_subdirectory(v4l-msi)
endif()
find_package(LibAIRSPY)
if(LIBUSB_FOUND AND LIBAIRSPY_FOUND)
add_subdirectory(airspy)
endif(LIBUSB_FOUND AND LIBAIRSPY_FOUND)
find_package(LibAIRSPYHF)
if(LIBUSB_FOUND AND LIBAIRSPYHF_FOUND)
add_subdirectory(airspyhf)
@ -39,6 +44,7 @@ if(LIBUSB_FOUND AND LIBRTLSDR_FOUND)
endif(LIBUSB_FOUND AND LIBRTLSDR_FOUND)
if (BUILD_DEBIAN)
add_subdirectory(airspy)
add_subdirectory(airspyhf)
add_subdirectory(hackrfinput)
add_subdirectory(limesdrinput)

View File

@ -0,0 +1,65 @@
project(airspy)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/samplesource/airspy")
set(airspy_SOURCES
${PLUGIN_PREFIX}/airspyinput.cpp
${PLUGIN_PREFIX}/airspyplugin.cpp
${PLUGIN_PREFIX}/airspysettings.cpp
${PLUGIN_PREFIX}/airspythread.cpp
)
set(airspy_HEADERS
${PLUGIN_PREFIX}/airspyinput.h
${PLUGIN_PREFIX}/airspyplugin.h
${PLUGIN_PREFIX}/airspysettings.h
${PLUGIN_PREFIX}/airspythread.h
)
if (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${LIBAIRSPYSRC}
${LIBAIRSPYSRC}/libairspy/src
)
else (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${LIBAIRSPY_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
add_definitions("${QT_DEFINITIONS} -DLIBAIRSPY_DYN_RATES")
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(inputairspysrv SHARED
${airspy_SOURCES}
${airspy_HEADERS_MOC}
)
if (BUILD_DEBIAN)
target_link_libraries(inputairspysrv
${QT_LIBRARIES}
airspy
sdrbase
swagger
)
else (BUILD_DEBIAN)
target_link_libraries(inputairspysrv
${QT_LIBRARIES}
${LIBAIRSPY_LIBRARIES}
sdrbase
swagger
)
endif (BUILD_DEBIAN)
qt5_use_modules(inputairspysrv Core)
install(TARGETS inputairspysrv DESTINATION lib/pluginssrv/samplesource)