1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-14 20:31:53 -05:00

Server: added HackRF plugins

This commit is contained in:
f4exb 2017-12-29 00:44:17 +01:00
parent a5ce09f19c
commit 89c515df4c
8 changed files with 179 additions and 9 deletions

View File

@ -30,7 +30,6 @@
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "hackrf/devicehackrfshared.h" #include "hackrf/devicehackrfshared.h"
#include "hackrfoutputgui.h"
#include "hackrfoutputthread.h" #include "hackrfoutputthread.h"
MESSAGE_CLASS_DEFINITION(HackRFOutput::MsgConfigureHackRF, Message) MESSAGE_CLASS_DEFINITION(HackRFOutput::MsgConfigureHackRF, Message)

View File

@ -14,18 +14,19 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "hackrfoutputplugin.h"
#include <QtPlugin> #include <QtPlugin>
#include <QAction>
#include "libhackrf/hackrf.h" #include "libhackrf/hackrf.h"
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "plugin/pluginapi.h" #include "plugin/pluginapi.h"
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#ifdef SERVER_MODE
#include "hackrfoutput.h"
#else
#include "hackrfoutputgui.h" #include "hackrfoutputgui.h"
#endif
#include "hackrfoutputplugin.h"
const PluginDescriptor HackRFOutputPlugin::m_pluginDescriptor = { const PluginDescriptor HackRFOutputPlugin::m_pluginDescriptor = {
QString("HackRF Output"), QString("HackRF Output"),
@ -120,6 +121,15 @@ PluginInterface::SamplingDevices HackRFOutputPlugin::enumSampleSinks()
return result; return result;
} }
#ifdef SERVER_MODE
PluginInstanceGUI* HackRFOutputPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{
return 0;
}
#else
PluginInstanceGUI* HackRFOutputPlugin::createSampleSinkPluginInstanceGUI( PluginInstanceGUI* HackRFOutputPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId, const QString& sinkId,
QWidget **widget, QWidget **widget,
@ -136,6 +146,7 @@ PluginInstanceGUI* HackRFOutputPlugin::createSampleSinkPluginInstanceGUI(
return 0; return 0;
} }
} }
#endif
DeviceSampleSink* HackRFOutputPlugin::createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI) DeviceSampleSink* HackRFOutputPlugin::createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI)
{ {

View File

@ -32,7 +32,6 @@
#include "hackrf/devicehackrfvalues.h" #include "hackrf/devicehackrfvalues.h"
#include "hackrf/devicehackrfshared.h" #include "hackrf/devicehackrfshared.h"
#include "hackrfinputgui.h"
#include "hackrfinputthread.h" #include "hackrfinputthread.h"
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgConfigureHackRF, Message) MESSAGE_CLASS_DEFINITION(HackRFInput::MsgConfigureHackRF, Message)

View File

@ -14,10 +14,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "../hackrfinput/hackrfinputplugin.h"
#include <QtPlugin> #include <QtPlugin>
#include <QAction>
#include "libhackrf/hackrf.h" #include "libhackrf/hackrf.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
@ -25,7 +23,12 @@
#include "plugin/pluginapi.h" #include "plugin/pluginapi.h"
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include "../hackrfinput/hackrfinputgui.h" #ifdef SERVER_MODE
#include "hackrfinput.h"
#else
#include "hackrfinputgui.h"
#endif
#include "hackrfinputplugin.h"
const PluginDescriptor HackRFInputPlugin::m_pluginDescriptor = { const PluginDescriptor HackRFInputPlugin::m_pluginDescriptor = {
QString("HackRF Input"), QString("HackRF Input"),
@ -121,6 +124,15 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
return result; return result;
} }
#ifdef SERVER_MODE
PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{
return 0;
}
#else
PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI( PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId, const QString& sourceId,
QWidget **widget, QWidget **widget,
@ -137,6 +149,7 @@ PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
return 0; return 0;
} }
} }
#endif
DeviceSampleSource *HackRFInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI) DeviceSampleSource *HackRFInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
{ {

View File

@ -2,6 +2,11 @@ project(samplesink)
find_package(LibUSB) find_package(LibUSB)
find_package(LibHACKRF)
if(LIBUSB_FOUND AND LIBHACKRF_FOUND)
add_subdirectory(hackrfoutput)
endif(LIBUSB_FOUND AND LIBHACKRF_FOUND)
find_package(LimeSuite) find_package(LimeSuite)
if(LIBUSB_FOUND AND LIMESUITE_FOUND) if(LIBUSB_FOUND AND LIMESUITE_FOUND)
add_subdirectory(limesdroutput) add_subdirectory(limesdroutput)
@ -9,6 +14,7 @@ endif(LIBUSB_FOUND AND LIMESUITE_FOUND)
if (BUILD_DEBIAN) if (BUILD_DEBIAN)
add_subdirectory(limesdroutput) add_subdirectory(limesdroutput)
add_subdirectory(hackrfoutput)
endif (BUILD_DEBIAN) endif (BUILD_DEBIAN)
add_subdirectory(filesink) add_subdirectory(filesink)

View File

@ -0,0 +1,68 @@
project(hackrfoutput)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/samplesink/hackrfoutput")
set(hackrfoutput_SOURCES
${PLUGIN_PREFIX}/hackrfoutput.cpp
${PLUGIN_PREFIX}/hackrfoutputplugin.cpp
${PLUGIN_PREFIX}/hackrfoutputsettings.cpp
${PLUGIN_PREFIX}/hackrfoutputthread.cpp
)
set(hackrfoutput_HEADERS
${PLUGIN_PREFIX}/hackrfoutput.h
${PLUGIN_PREFIX}/hackrfoutputplugin.h
${PLUGIN_PREFIX}/hackrfoutputsettings.h
${PLUGIN_PREFIX}/hackrfoutputthread.h
)
if (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBHACKRFSRC}
${LIBHACKRFSRC}/libhackrf/src
)
else (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBHACKRF_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
add_definitions("${QT_DEFINITIONS} -DLIBHACKRF_DYN_RATES")
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(outputhackrfsrv SHARED
${hackrfoutput_SOURCES}
${hackrfoutput_HEADERS_MOC}
)
if (BUILD_DEBIAN)
target_link_libraries(outputhackrfsrv
${QT_LIBRARIES}
hackrf
sdrbase
swagger
hackrfdevice
)
else (BUILD_DEBIAN)
target_link_libraries(outputhackrfsrv
${QT_LIBRARIES}
${LIBHACKRF_LIBRARIES}
sdrbase
swagger
hackrfdevice
)
endif (BUILD_DEBIAN)
qt5_use_modules(outputhackrfsrv Core)
install(TARGETS outputhackrfsrv DESTINATION lib/pluginssrv/samplesink)

View File

@ -13,6 +13,11 @@ if(V4L-MSI)
# add_subdirectory(v4l-msi) # add_subdirectory(v4l-msi)
endif() endif()
find_package(LibHACKRF)
if(LIBUSB_FOUND AND LIBHACKRF_FOUND)
add_subdirectory(hackrfinput)
endif(LIBUSB_FOUND AND LIBHACKRF_FOUND)
find_package(LimeSuite) find_package(LimeSuite)
if(LIBUSB_FOUND AND LIMESUITE_FOUND) if(LIBUSB_FOUND AND LIMESUITE_FOUND)
add_subdirectory(limesdrinput) add_subdirectory(limesdrinput)
@ -24,6 +29,7 @@ if(LIBUSB_FOUND AND LIBRTLSDR_FOUND)
endif(LIBUSB_FOUND AND LIBRTLSDR_FOUND) endif(LIBUSB_FOUND AND LIBRTLSDR_FOUND)
if (BUILD_DEBIAN) if (BUILD_DEBIAN)
add_subdirectory(hackrfinput)
add_subdirectory(limesdrinput) add_subdirectory(limesdrinput)
add_subdirectory(rtlsdr) add_subdirectory(rtlsdr)
endif (BUILD_DEBIAN) endif (BUILD_DEBIAN)

View File

@ -0,0 +1,68 @@
project(hackrfinput)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/samplesource/hackrfinput")
set(hackrfinput_SOURCES
${PLUGIN_PREFIX}/hackrfinput.cpp
${PLUGIN_PREFIX}/hackrfinputplugin.cpp
${PLUGIN_PREFIX}/hackrfinputsettings.cpp
${PLUGIN_PREFIX}/hackrfinputthread.cpp
)
set(hackrfinput_HEADERS
${PLUGIN_PREFIX}/hackrfinput.h
${PLUGIN_PREFIX}/hackrfinputplugin.h
${PLUGIN_PREFIX}/hackrfinputsettings.h
${PLUGIN_PREFIX}/hackrfinputthread.h
)
if (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBHACKRFSRC}
${LIBHACKRFSRC}/libhackrf/src
)
else (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBHACKRF_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
add_definitions("${QT_DEFINITIONS} -DLIBHACKRF_DYN_RATES")
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(inputhackrfsrv SHARED
${hackrfinput_SOURCES}
${hackrfinput_HEADERS_MOC}
)
if (BUILD_DEBIAN)
target_link_libraries(inputhackrfsrv
${QT_LIBRARIES}
hackrf
sdrbase
swagger
hackrfdevice
)
else (BUILD_DEBIAN)
target_link_libraries(inputhackrfsrv
${QT_LIBRARIES}
${LIBHACKRF_LIBRARIES}
sdrbase
swagger
hackrfdevice
)
endif (BUILD_DEBIAN)
qt5_use_modules(inputhackrfsrv Core)
install(TARGETS inputhackrfsrv DESTINATION lib/pluginssrv/samplesource)