mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-26 12:27:51 +02:00
Merge pull request #649 from AlexandreRouma/backend_abstraction
Backend abstraction and android support
This commit is contained in:
@ -24,6 +24,16 @@ if (MSVC)
|
||||
target_include_directories(airspy_source PUBLIC "C:/Program Files/PothosSDR/include/libairspy/")
|
||||
|
||||
target_link_libraries(airspy_source PRIVATE airspy)
|
||||
elseif (ANDROID)
|
||||
target_include_directories(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/libusb/libusb
|
||||
/mnt/android_sdr/airspyone_host/libairspy/src
|
||||
)
|
||||
|
||||
target_link_libraries(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
||||
/mnt/android_sdr/output/libairspy/${ANDROID_ABI}/libairspy.so
|
||||
)
|
||||
else (MSVC)
|
||||
find_package(PkgConfig)
|
||||
|
||||
|
@ -6,10 +6,13 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/smgui.h>
|
||||
#include <airspy.h>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android_backend.h>
|
||||
#endif
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
|
||||
SDRPP_MOD_INFO{
|
||||
@ -75,6 +78,7 @@ public:
|
||||
}
|
||||
|
||||
void refresh() {
|
||||
#ifndef __ANDROID__
|
||||
devList.clear();
|
||||
devListTxt = "";
|
||||
|
||||
@ -88,6 +92,18 @@ public:
|
||||
devListTxt += buf;
|
||||
devListTxt += '\0';
|
||||
}
|
||||
#else
|
||||
// Check for device presence
|
||||
int vid, pid;
|
||||
devFd = backend::getDeviceFD(vid, pid, backend::AIRSPY_VIDPIDS);
|
||||
if (devFd < 0) { return; }
|
||||
|
||||
// Get device info
|
||||
std::string fakeName = "Airspy USB";
|
||||
devList.push_back(0xDEADBEEF);
|
||||
devListTxt += fakeName;
|
||||
devListTxt += '\0';
|
||||
#endif
|
||||
}
|
||||
|
||||
void selectFirst() {
|
||||
@ -112,7 +128,11 @@ public:
|
||||
void selectBySerial(uint64_t serial) {
|
||||
airspy_device* dev;
|
||||
try {
|
||||
#ifndef __ANDROID__
|
||||
int err = airspy_open_sn(&dev, serial);
|
||||
#else
|
||||
int err = airspy_open_sn(&dev, devFd);
|
||||
#endif
|
||||
if (err != 0) {
|
||||
char buf[1024];
|
||||
sprintf(buf, "%016" PRIX64, serial);
|
||||
@ -245,7 +265,11 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef __ANDROID__
|
||||
int err = airspy_open_sn(&_this->openDev, _this->selectedSerial);
|
||||
#else
|
||||
int err = airspy_open_sn(&_this->openDev, _this->devFd);
|
||||
#endif
|
||||
if (err != 0) {
|
||||
char buf[1024];
|
||||
sprintf(buf, "%016" PRIX64, _this->selectedSerial);
|
||||
@ -571,6 +595,10 @@ private:
|
||||
bool lnaAgc = false;
|
||||
bool mixerAgc = false;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
int devFd = 0;
|
||||
#endif
|
||||
|
||||
std::vector<uint64_t> devList;
|
||||
std::string devListTxt;
|
||||
std::vector<uint32_t> sampleRateList;
|
||||
@ -581,7 +609,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = "";
|
||||
config.setPath(options::opts.root + "/airspy_config.json");
|
||||
config.setPath(core::args["root"].s() + "/airspy_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -24,6 +24,16 @@ if (MSVC)
|
||||
target_include_directories(airspyhf_source PUBLIC "C:/Program Files/PothosSDR/include/libairspyhf/")
|
||||
|
||||
target_link_libraries(airspyhf_source PRIVATE airspyhf)
|
||||
elseif (ANDROID)
|
||||
target_include_directories(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/libusb/libusb
|
||||
/mnt/android_sdr/airspyhf/libairspyhf/src
|
||||
)
|
||||
|
||||
target_link_libraries(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
||||
/mnt/android_sdr/output/libairspyhf/${ANDROID_ABI}/libairspyhf.so
|
||||
)
|
||||
else (MSVC)
|
||||
find_package(PkgConfig)
|
||||
|
||||
|
@ -5,11 +5,14 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/smgui.h>
|
||||
#include <airspyhf.h>
|
||||
#include <gui/widgets/stepped_slider.h>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android_backend.h>
|
||||
#endif
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
|
||||
SDRPP_MOD_INFO{
|
||||
@ -79,6 +82,7 @@ public:
|
||||
devList.clear();
|
||||
devListTxt = "";
|
||||
|
||||
#ifndef __ANDROID__
|
||||
uint64_t serials[256];
|
||||
int n = airspyhf_list_devices(serials, 256);
|
||||
|
||||
@ -89,6 +93,18 @@ public:
|
||||
devListTxt += buf;
|
||||
devListTxt += '\0';
|
||||
}
|
||||
#else
|
||||
// Check for device presence
|
||||
int vid, pid;
|
||||
devFd = backend::getDeviceFD(vid, pid, backend::AIRSPYHF_VIDPIDS);
|
||||
if (devFd < 0) { return; }
|
||||
|
||||
// Get device info
|
||||
std::string fakeName = "Airspy HF+ USB";
|
||||
devList.push_back(0xDEADBEEF);
|
||||
devListTxt += fakeName;
|
||||
devListTxt += '\0';
|
||||
#endif
|
||||
}
|
||||
|
||||
void selectFirst() {
|
||||
@ -113,10 +129,14 @@ public:
|
||||
void selectBySerial(uint64_t serial) {
|
||||
airspyhf_device_t* dev;
|
||||
try {
|
||||
int err = airspyhf_open_sn(&dev, selectedSerial);
|
||||
#ifndef __ANDROID__
|
||||
int err = airspyhf_open_sn(&dev, serial);
|
||||
#else
|
||||
int err = airspyhf_open_sn(&dev, devFd);
|
||||
#endif
|
||||
if (err != 0) {
|
||||
char buf[1024];
|
||||
sprintf(buf, "%016" PRIX64, selectedSerial);
|
||||
sprintf(buf, "%016" PRIX64, serial);
|
||||
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
||||
selectedSerial = 0;
|
||||
return;
|
||||
@ -124,7 +144,7 @@ public:
|
||||
}
|
||||
catch (std::exception e) {
|
||||
char buf[1024];
|
||||
sprintf(buf, "%016" PRIX64, selectedSerial);
|
||||
sprintf(buf, "%016" PRIX64, serial);
|
||||
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
||||
}
|
||||
|
||||
@ -221,7 +241,11 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
int err = airspyhf_open_sn(&_this->openDev, _this->selectedSerial);
|
||||
#ifndef __ANDROID__
|
||||
int err = airspyhf_open_sn(&_this->openDev, _this->selectedSerial);
|
||||
#else
|
||||
int err = airspyhf_open_sn(&_this->openDev, _this->devFd);
|
||||
#endif
|
||||
if (err != 0) {
|
||||
char buf[1024];
|
||||
sprintf(buf, "%016" PRIX64, _this->selectedSerial);
|
||||
@ -368,6 +392,10 @@ private:
|
||||
float atten = 0.0f;
|
||||
std::string selectedSerStr = "";
|
||||
|
||||
#ifdef __ANDROID__
|
||||
int devFd = 0;
|
||||
#endif
|
||||
|
||||
std::vector<uint64_t> devList;
|
||||
std::string devListTxt;
|
||||
std::vector<uint32_t> sampleRateList;
|
||||
@ -378,7 +406,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = "";
|
||||
config.setPath(options::opts.root + "/airspyhf_config.json");
|
||||
config.setPath(core::args["root"].s() + "/airspyhf_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/widgets/stepped_slider.h>
|
||||
#include <libbladeRF.h>
|
||||
#include <dsp/processing.h>
|
||||
@ -610,7 +609,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = "";
|
||||
config.setPath(options::opts.root + "/bladerf_config.json");
|
||||
config.setPath(core::args["root"].s() + "/bladerf_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <signal_path/signal_path.h>
|
||||
#include <wavreader.h>
|
||||
#include <core.h>
|
||||
#include <options.h>
|
||||
#include <gui/widgets/file_select.h>
|
||||
#include <filesystem>
|
||||
#include <regex>
|
||||
@ -28,7 +27,7 @@ public:
|
||||
FileSourceModule(std::string name) : fileSelect("", { "Wav IQ Files (*.wav)", "*.wav", "All Files", "*" }) {
|
||||
this->name = name;
|
||||
|
||||
if (options::opts.serverMode) { return; }
|
||||
if (core::args["server"].b()) { return; }
|
||||
|
||||
config.acquire();
|
||||
fileSelect.setPath(config.conf["path"], true);
|
||||
@ -200,7 +199,7 @@ private:
|
||||
MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["path"] = "";
|
||||
config.setPath(options::opts.root + "/file_source_config.json");
|
||||
config.setPath(core::args["root"].s() + "/file_source_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -22,6 +22,16 @@ if (MSVC)
|
||||
target_link_directories(hackrf_source PRIVATE "C:/Program Files/PothosSDR/bin/")
|
||||
|
||||
target_link_libraries(hackrf_source PRIVATE hackrf)
|
||||
elseif (ANDROID)
|
||||
target_include_directories(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/libusb/libusb
|
||||
/mnt/android_sdr/hackrf/host/libhackrf/src
|
||||
)
|
||||
|
||||
target_link_libraries(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
||||
/mnt/android_sdr/output/libhackrf/${ANDROID_ABI}/libhackrf.so
|
||||
)
|
||||
else (MSVC)
|
||||
find_package(PkgConfig)
|
||||
|
||||
|
@ -5,11 +5,17 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <libhackrf/hackrf.h>
|
||||
#include <gui/widgets/stepped_slider.h>
|
||||
#include <options.h>
|
||||
#include <gui/smgui.h>
|
||||
|
||||
#ifndef __ANDROID__
|
||||
#include <libhackrf/hackrf.h>
|
||||
#else
|
||||
#include <android_backend.h>
|
||||
#include <spdlog/sinks/android_sink.h>
|
||||
#include <hackrf.h>
|
||||
#endif
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
|
||||
SDRPP_MOD_INFO{
|
||||
@ -127,6 +133,7 @@ public:
|
||||
devList.clear();
|
||||
devListTxt = "";
|
||||
|
||||
#ifndef __ANDROID__
|
||||
uint64_t serials[256];
|
||||
hackrf_device_list_t* _devList = hackrf_device_list();
|
||||
|
||||
@ -137,6 +144,15 @@ public:
|
||||
}
|
||||
|
||||
hackrf_device_list_free(_devList);
|
||||
#else
|
||||
int vid, pid;
|
||||
devFd = backend::getDeviceFD(vid, pid, backend::HACKRF_VIDPIDS);
|
||||
if (devFd < 0) { return; }
|
||||
std::string fakeName = "HackRF USB";
|
||||
devList.push_back("fake_serial");
|
||||
devListTxt += fakeName;
|
||||
devListTxt += '\0';
|
||||
#endif
|
||||
}
|
||||
|
||||
void selectFirst() {
|
||||
@ -229,7 +245,11 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef __ANDROID__
|
||||
hackrf_error err = (hackrf_error)hackrf_open_by_serial(_this->selectedSerial.c_str(), &_this->openDev);
|
||||
#else
|
||||
hackrf_error err = (hackrf_error)hackrf_open_by_fd(&_this->openDev, _this->devFd);
|
||||
#endif
|
||||
if (err != HACKRF_SUCCESS) {
|
||||
spdlog::error("Could not open HackRF {0}: {1}", _this->selectedSerial, hackrf_error_name(err));
|
||||
return;
|
||||
@ -383,6 +403,10 @@ private:
|
||||
float lna = 0;
|
||||
float vga = 0;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
int devFd = -1;
|
||||
#endif
|
||||
|
||||
std::vector<std::string> devList;
|
||||
std::string devListTxt;
|
||||
};
|
||||
@ -391,7 +415,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = "";
|
||||
config.setPath(options::opts.root + "/hackrf_config.json");
|
||||
config.setPath(core::args["root"].s() + "/hackrf_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/smgui.h>
|
||||
#include <lime/LimeSuite.h>
|
||||
|
||||
@ -522,7 +521,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = "";
|
||||
config.setPath(options::opts.root + "/limesdr_config.json");
|
||||
config.setPath(core::args["root"].s() + "/limesdr_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -24,6 +24,17 @@ if (MSVC)
|
||||
|
||||
target_link_libraries(plutosdr_source PRIVATE libiio)
|
||||
target_link_libraries(plutosdr_source PRIVATE libad9361)
|
||||
elseif (ANDROID)
|
||||
target_include_directories(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/libiio
|
||||
/mnt/android_sdr/libad9361-iio
|
||||
)
|
||||
|
||||
target_link_libraries(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/output/libxml2/${ANDROID_ABI}/libxml2.so
|
||||
/mnt/android_sdr/output/libiio/${ANDROID_ABI}/libiio.so
|
||||
/mnt/android_sdr/output/libad9361/${ANDROID_ABI}/libad9361.so
|
||||
)
|
||||
else (MSVC)
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
target_include_directories(plutosdr_source PRIVATE "/Library/Frameworks/iio.framework/Headers")
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <gui/smgui.h>
|
||||
#include <iio.h>
|
||||
#include <ad9361.h>
|
||||
#include <options.h>
|
||||
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
@ -298,7 +297,7 @@ MOD_EXPORT void _INIT_() {
|
||||
defConf["sampleRate"] = 4000000.0f;
|
||||
defConf["gainMode"] = 0;
|
||||
defConf["gain"] = 0.0f;
|
||||
config.setPath(options::opts.root + "/plutosdr_source_config.json");
|
||||
config.setPath(core::args["root"].s() + "/plutosdr_source_config.json");
|
||||
config.load(defConf);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/widgets/stepped_slider.h>
|
||||
#include <utils/optionlist.h>
|
||||
#include <gui/smgui.h>
|
||||
@ -326,7 +325,7 @@ MOD_EXPORT void _INIT_() {
|
||||
def["hostname"] = "192.168.0.111";
|
||||
def["port"] = 50000;
|
||||
def["devices"] = json::object();
|
||||
config.setPath(options::opts.root + "/rfspace_source_config.json");
|
||||
config.setPath(core::args["root"].s() + "/rfspace_source_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
|
||||
|
@ -22,6 +22,16 @@ if (MSVC)
|
||||
target_link_directories(rtl_sdr_source PRIVATE "C:/Program Files/PothosSDR/bin/")
|
||||
|
||||
target_link_libraries(rtl_sdr_source PRIVATE rtlsdr)
|
||||
elseif (ANDROID)
|
||||
target_include_directories(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/libusb/libusb
|
||||
/mnt/android_sdr/librtlsdr/include
|
||||
)
|
||||
|
||||
target_link_libraries(sdrpp_core PUBLIC
|
||||
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
|
||||
/mnt/android_sdr/output/librtlsdr/${ANDROID_ABI}/librtlsdr.so
|
||||
)
|
||||
else (MSVC)
|
||||
find_package(PkgConfig)
|
||||
|
||||
|
@ -5,10 +5,12 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/smgui.h>
|
||||
#include <rtl-sdr.h>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android_backend.h>
|
||||
#endif
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
|
||||
@ -57,6 +59,8 @@ public:
|
||||
RTLSDRSourceModule(std::string name) {
|
||||
this->name = name;
|
||||
|
||||
serverMode = (bool)core::args["server"];
|
||||
|
||||
sampleRate = sampleRates[0];
|
||||
|
||||
handler.ctx = this;
|
||||
@ -114,6 +118,7 @@ public:
|
||||
devNames.clear();
|
||||
devListTxt = "";
|
||||
|
||||
#ifndef __ANDROID__
|
||||
devCount = rtlsdr_get_device_count();
|
||||
char buf[1024];
|
||||
for (int i = 0; i < devCount; i++) {
|
||||
@ -123,6 +128,20 @@ public:
|
||||
devListTxt += buf;
|
||||
devListTxt += '\0';
|
||||
}
|
||||
#else
|
||||
// Check for device connection
|
||||
devCount = 0;
|
||||
int vid, pid;
|
||||
devFd = backend::getDeviceFD(vid, pid, backend::RTL_SDR_VIDPIDS);
|
||||
if (devFd < 0) { return; }
|
||||
|
||||
// Generate fake device info
|
||||
devCount = 1;
|
||||
std::string fakeName = "RTL-SDR Dongle USB";
|
||||
devNames.push_back(fakeName);
|
||||
devListTxt += fakeName;
|
||||
devListTxt += '\0';
|
||||
#endif
|
||||
}
|
||||
|
||||
void selectFirst() {
|
||||
@ -144,9 +163,15 @@ public:
|
||||
void selectById(int id) {
|
||||
selectedDevName = devNames[id];
|
||||
|
||||
if (rtlsdr_open(&openDev, id) < 0) {
|
||||
#ifndef __ANDROID__
|
||||
int oret = rtlsdr_open(&openDev, id);
|
||||
#else
|
||||
int oret = rtlsdr_open(&openDev, devFd);
|
||||
#endif
|
||||
|
||||
if (oret < 0) {
|
||||
selectedDevName = "";
|
||||
spdlog::error("Could not open RTL-SDR");
|
||||
spdlog::error("Could not open RTL-SDR: {0}", oret);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -252,7 +277,13 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
if (rtlsdr_open(&_this->openDev, _this->devId) < 0) {
|
||||
#ifndef __ANDROID__
|
||||
int oret = rtlsdr_open(&_this->openDev, _this->devId);
|
||||
#else
|
||||
int oret = rtlsdr_open(&_this->openDev, _this->devFd);
|
||||
#endif
|
||||
|
||||
if (oret < 0) {
|
||||
spdlog::error("Could not open RTL-SDR");
|
||||
return;
|
||||
}
|
||||
@ -395,7 +426,7 @@ private:
|
||||
SmGui::ForceSync();
|
||||
|
||||
// TODO: FIND ANOTHER WAY
|
||||
if (options::opts.serverMode) {
|
||||
if (_this->serverMode) {
|
||||
if (SmGui::SliderInt(CONCAT("##_rtlsdr_gain_", _this->name), &_this->gainId, 0, _this->gainList.size() - 1, SmGui::FMT_STR_NONE)) {
|
||||
_this->updateGainTxt();
|
||||
if (_this->running) {
|
||||
@ -509,6 +540,11 @@ private:
|
||||
int srId = 0;
|
||||
int devCount = 0;
|
||||
std::thread workerThread;
|
||||
bool serverMode = false;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
int devFd = -1;
|
||||
#endif
|
||||
|
||||
int ppm = 0;
|
||||
|
||||
@ -537,7 +573,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = 0;
|
||||
config.setPath(options::opts.root + "/rtl_sdr_config.json");
|
||||
config.setPath(core::args["root"].s() + "/rtl_sdr_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <gui/gui.h>
|
||||
#include <signal_path/signal_path.h>
|
||||
#include <core.h>
|
||||
#include <options.h>
|
||||
#include <gui/smgui.h>
|
||||
#include <gui/style.h>
|
||||
|
||||
@ -337,7 +336,7 @@ private:
|
||||
};
|
||||
|
||||
MOD_EXPORT void _INIT_() {
|
||||
config.setPath(options::opts.root + "/rtl_tcp_config.json");
|
||||
config.setPath(core::args["root"].s() + "/rtl_tcp_config.json");
|
||||
json defConf;
|
||||
defConf["host"] = "localhost";
|
||||
defConf["port"] = 1234;
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/widgets/stepped_slider.h>
|
||||
#include <libsddc.h>
|
||||
|
||||
@ -29,7 +28,7 @@ public:
|
||||
AirspyHFSourceModule(std::string name) {
|
||||
this->name = name;
|
||||
|
||||
if (options::opts.serverMode) { return; }
|
||||
if (core::args["server"].b()) { return; }
|
||||
|
||||
sampleRate = 768000.0;
|
||||
|
||||
@ -179,7 +178,7 @@ private:
|
||||
|
||||
static void menuHandler(void* ctx) {
|
||||
AirspyHFSourceModule* _this = (AirspyHFSourceModule*)ctx;
|
||||
float menuWidth = ImGui::GetContentRegionAvailWidth();
|
||||
float menuWidth = ImGui::GetContentRegionAvail().x;
|
||||
|
||||
if (_this->running) { style::beginDisabled(); }
|
||||
|
||||
@ -229,7 +228,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = "";
|
||||
config.setPath(options::opts.root + "/sddc_config.json");
|
||||
config.setPath(core::args["root"].s() + "/sddc_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <sdrplay_api.h>
|
||||
#include <gui/smgui.h>
|
||||
|
||||
@ -929,13 +928,13 @@ private:
|
||||
}
|
||||
|
||||
SmGui::ForceSync();
|
||||
if (SmGui::Button("Apply", ImVec2(100, 0))) {
|
||||
if (SmGui::Button(" Apply ")) {
|
||||
open = false;
|
||||
valid = true;
|
||||
}
|
||||
SmGui::SameLine();
|
||||
SmGui::ForceSync();
|
||||
if (SmGui::Button("Cancel", ImVec2(100, 0))) {
|
||||
if (SmGui::Button("Cancel")) {
|
||||
open = false;
|
||||
valid = false;
|
||||
}
|
||||
@ -1207,7 +1206,7 @@ MOD_EXPORT void _INIT_() {
|
||||
json def = json({});
|
||||
def["devices"] = json({});
|
||||
def["device"] = "";
|
||||
config.setPath(options::opts.root + "/sdrplay_config.json");
|
||||
config.setPath(core::args["root"].s() + "/sdrplay_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/widgets/stepped_slider.h>
|
||||
#include <utils/optionlist.h>
|
||||
#include <gui/dialogs/dialog_box.h>
|
||||
@ -30,7 +29,7 @@ public:
|
||||
this->name = name;
|
||||
|
||||
// Yeah no server-ception, sorry...
|
||||
if (options::opts.serverMode) { return; }
|
||||
if (core::args["server"].b()) { return; }
|
||||
|
||||
// Initialize lists
|
||||
sampleTypeList.define("Int8", dsp::PCM_TYPE_I8);
|
||||
@ -141,7 +140,7 @@ private:
|
||||
|
||||
static void menuHandler(void* ctx) {
|
||||
SDRPPServerSourceModule* _this = (SDRPPServerSourceModule*)ctx;
|
||||
float menuWidth = ImGui::GetContentRegionAvailWidth();
|
||||
float menuWidth = ImGui::GetContentRegionAvail().x;
|
||||
|
||||
bool connected = (_this->client && _this->client->isOpen());
|
||||
gui::mainWindow.playButtonLocked = !connected;
|
||||
@ -282,7 +281,7 @@ MOD_EXPORT void _INIT_() {
|
||||
def["hostname"] = "localhost";
|
||||
def["port"] = 5259;
|
||||
def["servers"] = json::object();
|
||||
config.setPath(options::opts.root + "/sdrpp_server_source_config.json");
|
||||
config.setPath(core::args["root"].s() + "/sdrpp_server_source_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <SoapySDR/Logger.hpp>
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <options.h>
|
||||
#include <gui/smgui.h>
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
@ -525,7 +524,7 @@ private:
|
||||
};
|
||||
|
||||
MOD_EXPORT void _INIT_() {
|
||||
config.setPath(options::opts.root + "/soapy_source_config.json");
|
||||
config.setPath(core::args["root"].s() + "/soapy_source_config.json");
|
||||
json defConf;
|
||||
defConf["device"] = "";
|
||||
defConf["devices"] = json({});
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <core.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <gui/widgets/stepped_slider.h>
|
||||
#include <gui/smgui.h>
|
||||
|
||||
@ -308,7 +307,7 @@ MOD_EXPORT void _INIT_() {
|
||||
def["hostname"] = "localhost";
|
||||
def["port"] = 5555;
|
||||
def["devices"] = json::object();
|
||||
config.setPath(options::opts.root + "/spyserver_config.json");
|
||||
config.setPath(core::args["root"].s() + "/spyserver_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
|
||||
|
Reference in New Issue
Block a user