From 70971eb9ad544ccff665b5e5ce41b98ca78777d2 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 11 Apr 2017 22:26:42 +0200 Subject: [PATCH] LimeSDR support (3) --- Readme.md | 6 ++++++ cmake/Modules/FindLimeSuite.cmake | 8 ++------ devices/CMakeLists.txt | 5 +++-- devices/limesdr/CMakeLists.txt | 3 +++ devices/limesdr/devicelimesdrparam.cpp | 24 ++++++++++++------------ 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/Readme.md b/Readme.md index cb2e47167..d992bc1e4 100644 --- a/Readme.md +++ b/Readme.md @@ -78,6 +78,8 @@ HackRF is better used with a sampling rate of 4.8 MS/s and above. The 2.4 and 3.

LimeSDR

+Linux only. + ⚠ This is a wotk in progress You will need a minimal installation of LimeSuite: @@ -91,6 +93,10 @@ You will need a minimal installation of LimeSuite: - `make -j8` - `make install` +Then add the following defines on `cmake` command line: + +`-DLIMESUITE_INCLUDE_DIR=/opt/install/LimeSuite/include -DLIMESUITE_LIBRARY=/opt/install/LimeSuite/lib/libLimeSuite.so` +

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. diff --git a/cmake/Modules/FindLimeSuite.cmake b/cmake/Modules/FindLimeSuite.cmake index ac358aad4..0261656ce 100644 --- a/cmake/Modules/FindLimeSuite.cmake +++ b/cmake/Modules/FindLimeSuite.cmake @@ -7,13 +7,9 @@ IF (LIMESUITE_INCLUDE_DIR AND LIMESUITE_LIBRARY) ENDIF (LIMESUITE_INCLUDE_DIR AND LIMESUITE_LIBRARY) IF (LIMESUITE_FOUND) - IF (NOT LimeSuite_FIND_QUIETLY) - MESSAGE (STATUS "Found Lime Suite: ${LIMESUITE_INCLUDE_DIR}, ${LIMESUITE_LIBRARY}") - ENDIF (NOT LimeSuite_FIND_QUIETLY) + MESSAGE (STATUS "Found Lime Suite: ${LIMESUITE_INCLUDE_DIR}, ${LIMESUITE_LIBRARY}") ELSE (LIMESUITE_FOUND) - IF (LimeSuite_FIND_REQUIRED) - MESSAGE (FATAL_ERROR "Could not find Lime Suite") - ENDIF (LimeSuite_FIND_REQUIRED) + MESSAGE (STATUS "Could not find Lime Suite") ENDIF (LIMESUITE_FOUND) mark_as_advanced(LIMESUITE_INCLUDE_DIR LIMESUITE_LIBRARY) diff --git a/devices/CMakeLists.txt b/devices/CMakeLists.txt index 5bc7ddfe9..d8d8ea1f5 100644 --- a/devices/CMakeLists.txt +++ b/devices/CMakeLists.txt @@ -13,11 +13,12 @@ if(LIBUSB_FOUND AND LIBHACKRF_FOUND) endif(LIBUSB_FOUND AND LIBHACKRF_FOUND) find_package(LimeSuite) -if(LIMESUITE_FOUND AND LIBHACKRF_FOUND) +if(LIBUSB_FOUND AND LIMESUITE_FOUND) add_subdirectory(limesdr) -endif(LIMESUITE_FOUND AND LIBHACKRF_FOUND) +endif(LIBUSB_FOUND AND LIMESUITE_FOUND) if (BUILD_DEBIAN) add_subdirectory(bladerf) add_subdirectory(hackrf) + add_subdirectory(limesdr) endif (BUILD_DEBIAN) diff --git a/devices/limesdr/CMakeLists.txt b/devices/limesdr/CMakeLists.txt index 31df10466..d502d93e6 100644 --- a/devices/limesdr/CMakeLists.txt +++ b/devices/limesdr/CMakeLists.txt @@ -23,6 +23,9 @@ include_directories( ) endif (BUILD_DEBIAN) +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DQT_SHARED) + add_library(limesdrdevice SHARED ${limesdrdevice_SOURCES} ) diff --git a/devices/limesdr/devicelimesdrparam.cpp b/devices/limesdr/devicelimesdrparam.cpp index ac66ab036..36ec4bfe0 100644 --- a/devices/limesdr/devicelimesdrparam.cpp +++ b/devices/limesdr/devicelimesdrparam.cpp @@ -21,13 +21,13 @@ bool DeviceLimeSDRParams::open(lms_info_str_t deviceStr) { if (LMS_Open(&m_dev, deviceStr, 0)) { - QDebug() << "DeviceLimeSDRParams::open: cannot open device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot open device " << deviceStr; return false; } if (LMS_Init(m_dev) != 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot init device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot init device " << deviceStr; return false; } @@ -35,59 +35,59 @@ bool DeviceLimeSDRParams::open(lms_info_str_t deviceStr) if ((n = LMS_GetNumChannels(m_dev, LMS_CH_RX)) < 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the number of Rx channels for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the number of Rx channels for device " << deviceStr; return false; } else { m_nbRxChannels = n; - QDebug() << "DeviceLimeSDRParams::open: " << n << " Rx channels for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: " << n << " Rx channels for device " << deviceStr; } if ((n = LMS_GetNumChannels(m_dev, LMS_CH_TX)) < 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the number of Tx channels for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the number of Tx channels for device " << deviceStr; return false; } else { m_nbTxChannels = n; - QDebug() << "DeviceLimeSDRParams::open: " << n << " Tx channels for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: " << n << " Tx channels for device " << deviceStr; } if (LMS_GetLPFBWRange(m_dev, LMS_CH_RX, &m_lpfRangeRx) != 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the Rx LPF range for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the Rx LPF range for device " << deviceStr; return false; } if (LMS_GetLPFBWRange(m_dev, LMS_CH_TX, &m_lpfRangeTx) != 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the Tx LPF range for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the Tx LPF range for device " << deviceStr; return false; } if (LMS_GetLOFrequencyRange(m_dev, LMS_CH_RX, &m_lpfRangeRx) != 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the Rx LO range for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the Rx LO range for device " << deviceStr; return false; } if (LMS_GetLOFrequencyRange(m_dev, LMS_CH_TX, &m_lpfRangeTx) != 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the Tx LO range for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the Tx LO range for device " << deviceStr; return false; } if (LMS_GetSampleRateRange(m_dev, LMS_CH_RX, &m_srRangeRx) != 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the Rx sample rate range for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the Rx sample rate range for device " << deviceStr; return false; } if (LMS_GetSampleRateRange(m_dev, LMS_CH_TX, &m_srRangeTx) != 0) { - QDebug() << "DeviceLimeSDRParams::open: cannot get the Tx sample rate range for device " << deviceStr; + qDebug() << "DeviceLimeSDRParams::open: cannot get the Tx sample rate range for device " << deviceStr; return false; }