Skip to content

Commit afe146e

Browse files
committed
Add support of HydraSDR RFOne Source
1 parent dd9b8db commit afe146e

7 files changed

Lines changed: 676 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ option(OPT_BUILD_FOBOSSDR_SOURCE "Build FobosSDR Source Module (Dependencies: li
1919
option(OPT_BUILD_HACKRF_SOURCE "Build HackRF Source Module (Dependencies: libhackrf)" ON)
2020
option(OPT_BUILD_HAROGIC_SOURCE "Build Harogic Source Module (Dependencies: htra_api)" OFF)
2121
option(OPT_BUILD_HERMES_SOURCE "Build Hermes Source Module (no dependencies required)" ON)
22+
option(OPT_BUILD_HYDRASDR_RFONE_SOURCE "Build HydraSDR RFOne Source Module (Dependencies: libhydrasdr)" ON)
2223
option(OPT_BUILD_KCSDR_SOURCE "Build KCSDR Source Module (Dependencies: libkcsdr)" OFF)
2324
option(OPT_BUILD_LIMESDR_SOURCE "Build LimeSDR Source Module (Dependencies: liblimesuite)" OFF)
2425
option(OPT_BUILD_NETWORK_SOURCE "Build Network Source Module (no dependencies required)" ON)
@@ -162,6 +163,10 @@ if (OPT_BUILD_HERMES_SOURCE)
162163
add_subdirectory("source_modules/hermes_source")
163164
endif (OPT_BUILD_HERMES_SOURCE)
164165

166+
if (OPT_BUILD_HYDRASDR_RFONE_SOURCE)
167+
add_subdirectory("source_modules/hydrasdr_rfone_source")
168+
endif (OPT_BUILD_HYDRASDR_RFONE_SOURCE)
169+
165170
if (OPT_BUILD_KCSDR_SOURCE)
166171
add_subdirectory("source_modules/kcsdr_source")
167172
endif (OPT_BUILD_KCSDR_SOURCE)

core/backends/android/android_backend.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace backend {
1111
extern const std::vector<DevVIDPID> AIRSPY_VIDPIDS;
1212
extern const std::vector<DevVIDPID> AIRSPYHF_VIDPIDS;
1313
extern const std::vector<DevVIDPID> HACKRF_VIDPIDS;
14+
extern const std::vector<DevVIDPID> HYDRASDR_RFONE_VIDPIDS;
1415
extern const std::vector<DevVIDPID> RTL_SDR_VIDPIDS;
1516

1617
int getDeviceFD(int& vid, int& pid, const std::vector<DevVIDPID>& allowedVidPids);

core/backends/android/backend.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ namespace backend {
408408
{ 0x1d50, 0xcc15 }
409409
};
410410

411+
const std::vector<DevVIDPID> HYDRASDR_RFONE_VIDPIDS = {
412+
{ 0x1d50, 0x60a1 }
413+
};
414+
411415
const std::vector<DevVIDPID> RTL_SDR_VIDPIDS = {
412416
{ 0x0bda, 0x2832 },
413417
{ 0x0bda, 0x2838 },

core/src/core.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ int sdrpp_main(int argc, char* argv[]) {
181181
defConfig["moduleInstances"]["Harogic Source"]["enabled"] = true;
182182
defConfig["moduleInstances"]["Hermes Source"]["module"] = "hermes_source";
183183
defConfig["moduleInstances"]["Hermes Source"]["enabled"] = true;
184+
defConfig["moduleInstances"]["HydraSDR RFOne Source"]["module"] = "hydrasdr_rfone_source";
185+
defConfig["moduleInstances"]["HydraSDR RFOne Source"]["enabled"] = true;
184186
defConfig["moduleInstances"]["LimeSDR Source"]["module"] = "limesdr_source";
185187
defConfig["moduleInstances"]["LimeSDR Source"]["enabled"] = true;
186188
defConfig["moduleInstances"]["Network Source"]["module"] = "network_source";

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ Modules in beta are still included in releases for the most part but not enabled
328328
| hackrf_source | Working | libhackrf | OPT_BUILD_HACKRF_SOURCE ||||
329329
| harogic_source | Beta | htra_api | OPT_BUILD_HAROGIC_SOURCE ||||
330330
| hermes_source | Beta | - | OPT_BUILD_HERMES_SOURCE ||||
331+
| hydrasdr_rfone_source| Working | libhydrasdr | OPT_BUILD_HYDRASDR_RFONE_SOURCE||||
331332
| kcsdr_source | Unfinished | libkcsdr | OPT_BUILD_KCSDR_SOURCE ||||
332333
| limesdr_source | Working | liblimesuite | OPT_BUILD_LIMESDR_SOURCE ||||
333334
| network_source | Beta | - | OPT_BUILD_NETWORK_SOURCE ||||
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
project(hydrasdr_rfone_source)
3+
4+
file(GLOB SRC "src/*.cpp")
5+
6+
include(${SDRPP_MODULE_CMAKE})
7+
8+
if (MSVC)
9+
# Lib path
10+
target_link_directories(hydrasdr_rfone_source PRIVATE "C:/Program Files/PothosSDR/bin/")
11+
12+
target_include_directories(hydrasdr_rfone_source PUBLIC "C:/Program Files/PothosSDR/include/libhydrasdr/")
13+
14+
target_link_libraries(hydrasdr_rfone_source PRIVATE hydrasdr)
15+
elseif (ANDROID)
16+
target_include_directories(hydrasdr_rfone_source PUBLIC
17+
/sdr-kit/${ANDROID_ABI}/include/libhydrasdr
18+
)
19+
20+
target_link_libraries(hydrasdr_rfone_source PUBLIC
21+
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
22+
/sdr-kit/${ANDROID_ABI}/lib/libhydrasdr.so
23+
)
24+
else (MSVC)
25+
find_package(PkgConfig)
26+
27+
pkg_check_modules(LIBHYDRASDR_RFONE REQUIRED libhydrasdr)
28+
29+
target_include_directories(hydrasdr_rfone_source PRIVATE ${LIBHYDRASDR_RFONE_INCLUDE_DIRS})
30+
target_link_directories(hydrasdr_rfone_source PRIVATE ${LIBHYDRASDR_RFONE_LIBRARY_DIRS})
31+
target_link_libraries(hydrasdr_rfone_source PRIVATE ${LIBHYDRASDR_RFONE_LIBRARIES})
32+
33+
# Include it because for some reason pkgconfig doesn't look here?
34+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
35+
target_include_directories(hydrasdr_rfone_source PRIVATE "/usr/local/include")
36+
endif()
37+
38+
endif ()

0 commit comments

Comments
 (0)