kopia lustrzana https://github.com/AlexandreRouma/SDRPlusPlus
Porównaj commity
20 Commity
052167962d
...
eab4264604
Autor | SHA1 | Data |
---|---|---|
AlexandreRouma | eab4264604 | |
AlexandreRouma | 4b77d8c395 | |
AlexandreRouma | 854ed89b82 | |
AlexandreRouma | 27ab5bf3c1 | |
AlexandreRouma | 159f59b858 | |
AlexandreRouma | 93cafe7109 | |
AlexandreRouma | 74ae8a45d9 | |
AlexandreRouma | 691216a298 | |
AlexandreRouma | 3e58d4ba31 | |
AlexandreRouma | 86dcec7495 | |
Henner Zeller | 5a003e99d2 | |
AlexandreRouma | f197cf6bd9 | |
AlexandreRouma | 8cefeadbd4 | |
Henner Zeller | 23ae66151b | |
AlexandreRouma | fa76b4e865 | |
AlexandreRouma | 5e195a0d43 | |
AlexandreRouma | 5e299d9d23 | |
AlexandreRouma | fd5813df6d | |
AlexandreRouma | eabb842b6b | |
AlexandreRouma | 5a1945f779 |
|
@ -1,7 +1,4 @@
|
|||
# Important
|
||||
|
||||
Only minor bug fixes and bandplans are accepted.
|
||||
|
||||
Pull requests adding features or any bug fix that requires significant code changes will be automatically rejected.
|
||||
|
||||
Only bandplan, colormaps and themes are accepted. Code pull requests are **NOT welcome**.
|
||||
Open an issue requesting a feature or discussing a possible bugfix instead.
|
|
@ -85,7 +85,7 @@ jobs:
|
|||
path: ${{runner.workspace}}/sdrpp_windows_x64.zip
|
||||
|
||||
build_macos:
|
||||
runs-on: macos-11
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
@ -100,29 +100,29 @@ jobs:
|
|||
run: brew install pkg-config libusb fftw glfw airspy airspyhf portaudio hackrf libbladerf codec2 zstd autoconf automake libtool && pip3 install mako
|
||||
|
||||
- name: Install volk
|
||||
run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
|
||||
- name: Install SDRplay API
|
||||
run: wget https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-3.07.3.pkg && sudo installer -pkg SDRplay_RSP_API-MacOSX-3.07.3.pkg -target /
|
||||
|
||||
- name: Install libiio
|
||||
run: wget https://github.com/analogdevicesinc/libiio/archive/refs/tags/v0.25.zip && 7z x v0.25.zip && cd libiio-0.25 && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
run: wget https://github.com/analogdevicesinc/libiio/archive/refs/tags/v0.25.zip && 7z x v0.25.zip && cd libiio-0.25 && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
|
||||
- name: Install libad9361
|
||||
run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
|
||||
- name: Install LimeSuite
|
||||
run: git clone https://github.com/myriadrf/LimeSuite && cd LimeSuite && mkdir builddir && cd builddir && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
run: git clone https://github.com/myriadrf/LimeSuite && cd LimeSuite && mkdir builddir && cd builddir && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
|
||||
|
||||
- name: Install libperseus
|
||||
run: git clone https://github.com/Microtelecom/libperseus-sdr && cd libperseus-sdr && autoreconf -i && ./configure --prefix=/usr/local && make && make install && cd ..
|
||||
|
||||
- name: Install more recent librtlsdr
|
||||
run: git clone https://github.com/osmocom/rtl-sdr && cd rtl-sdr && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 LIBRARY_PATH=$(pkg-config --libs-only-L libusb-1.0 | sed 's/\-L//') && sudo make install && cd ../../
|
||||
run: git clone https://github.com/osmocom/rtl-sdr && cd rtl-sdr && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 LIBRARY_PATH=$(pkg-config --libs-only-L libusb-1.0 | sed 's/\-L//') && sudo make install && cd ../../
|
||||
|
||||
- name: Prepare CMake
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release
|
||||
run: cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
|
|
|
@ -1,65 +1,6 @@
|
|||
# Pull Requests
|
||||
|
||||
**I DO NOT ACCEPT PULL-REQUEST FOR FEATURES OR BUGFIXES REQUIRING SIGNIFICANT CODE/STRUCTURE CHANGES.**
|
||||
**SUCH PULL REQUESTS WILL BE CLOSED AUTOMATICALLY. OPEN AN ISSUE DETAILING FEATURE REQUESTS OR POTENTIAL BUGFIX INSTEAD.**
|
||||
|
||||
# Code Style
|
||||
|
||||
## Naming Convention
|
||||
|
||||
- Files: `snake_case.h` `snake_case.cpp`
|
||||
- Namespaces: `CamelCase`
|
||||
- Classes: `CamelCase`
|
||||
- Structs: `CamelCase_t`
|
||||
- Members: `camelCase`
|
||||
- Enum: `SNAKE_CASE`
|
||||
- Macros: `SNAKE_CASE`
|
||||
|
||||
## Brace Style
|
||||
|
||||
```c++
|
||||
int myFunction() {
|
||||
if (shortIf) { shortFunctionName(); }
|
||||
|
||||
if (longIf) {
|
||||
longFunction();
|
||||
otherStuff();
|
||||
myLongFunction();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Note: If it makes the code cleaner, remember to use the `?` keyword instead of a `if else` statement.
|
||||
|
||||
## Pointers
|
||||
|
||||
Please use `type* name` for pointers.
|
||||
|
||||
## Structure
|
||||
|
||||
Headers and their associated C++ files shall be in the same directory. All headers must use `#pragma once` instead of other include guards. Only include files in a header that are being used in that header. Include the rest in the associated C++ file.
|
||||
|
||||
# Modules
|
||||
|
||||
## Module Naming Convention
|
||||
|
||||
All modules names must be `snake_case`. If the module is a source, it must end with `_source`. If it is a sink, it must end with `_sink`.
|
||||
|
||||
For example, lets take the module named `cool_source`:
|
||||
|
||||
- Directory: `cool_source`
|
||||
- Class: `CoolSourceModule`
|
||||
- Binary: `cool_source.<os dynlib extension>`
|
||||
|
||||
## Integration into main repository
|
||||
|
||||
If the module meets the code quality requirements, it may be added to the official repository. A module that doesn't require any external dependencies that the core doesn't already use may be enabled for build by default. Otherwise, they must be disabled for build by default with a `OPT_BUILD_MODULE_NAME` variable set to `OFF`.
|
||||
|
||||
# JSON Formatting
|
||||
|
||||
The ability to add new radio band allocation identifiers and color maps relies on JSON files. Proper formatting of these JSON files is important for reference and readability. The following guides will show you how to properly format the JSON files for their respective uses.
|
||||
|
||||
**IMPORTANT: JSON File cannot contain comments, there are only in this example for clarity**
|
||||
Code pull requests are **NOT welcome**. Please open an issue discussing potential bugfixes or feature requests instead.
|
||||
|
||||
## Band Frequency Allocation
|
||||
|
||||
|
@ -119,8 +60,8 @@ Please follow this guide to properly format the JSON files for custom color maps
|
|||
}
|
||||
```
|
||||
|
||||
# Best Practices
|
||||
# JSON Formatting
|
||||
|
||||
* All additions and/or bug fixes to the core must not add additional dependencies.
|
||||
* Use VSCode for development, VS seems to cause issues.
|
||||
* DO NOT use libboost for any code meant for this repository
|
||||
The ability to add new radio band allocation identifiers and color maps relies on JSON files. Proper formatting of these JSON files is important for reference and readability. The following guides will show you how to properly format the JSON files for their respective uses.
|
||||
|
||||
**IMPORTANT: JSON File cannot contain comments, there are only in this example for clarity**
|
|
@ -88,7 +88,7 @@ int CommandArgsParser::parse(int argc, char* argv[]) {
|
|||
try {
|
||||
carg.ival = std::stoi(arg);
|
||||
}
|
||||
catch (std::exception e) {
|
||||
catch (const std::exception& e) {
|
||||
printf("Invalid argument, failed to parse integer\n");
|
||||
showHelp();
|
||||
return -1;
|
||||
|
@ -98,7 +98,7 @@ int CommandArgsParser::parse(int argc, char* argv[]) {
|
|||
try {
|
||||
carg.fval = std::stod(arg);
|
||||
}
|
||||
catch (std::exception e) {
|
||||
catch (const std::exception& e) {
|
||||
printf("Invalid argument, failed to parse float\n");
|
||||
showHelp();
|
||||
return -1;
|
||||
|
|
|
@ -36,8 +36,8 @@ void ConfigManager::load(json def, bool lock) {
|
|||
file >> conf;
|
||||
file.close();
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Config file '{0}' is corrupted, resetting it", path);
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Config file '{}' is corrupted, resetting it: {}", path, e.what());
|
||||
conf = def;
|
||||
save(false);
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace dsp {
|
|||
void disableBlock(Processor<T, T>* block, Func onOutputChange) {
|
||||
// Check that the block is part of the chain
|
||||
if (!blockExists(block)) {
|
||||
throw std::runtime_error("[chain] Tried to enable a block that isn't part of the chain");
|
||||
throw std::runtime_error("[chain] Tried to disable a block that isn't part of the chain");
|
||||
}
|
||||
|
||||
// If already disabled, don't do anything
|
||||
|
@ -163,10 +163,12 @@ namespace dsp {
|
|||
|
||||
private:
|
||||
Processor<T, T>* blockBefore(Processor<T, T>* block) {
|
||||
// TODO: This is wrong and must be fixed when I get more time
|
||||
for (auto& ln : links) {
|
||||
if (ln == block) { return NULL; }
|
||||
if (states[ln]) { return ln; }
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Processor<T, T>* blockAfter(Processor<T, T>* block) {
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace dsp::demod {
|
|||
else if (_mode == Mode::LSB) {
|
||||
return -_bandwidth / 2.0;
|
||||
}
|
||||
else if (_mode == Mode::DSB) {
|
||||
else {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -320,7 +320,7 @@ namespace net {
|
|||
}
|
||||
entry.handler(std::move(client), entry.ctx);
|
||||
}
|
||||
catch (std::exception e) {
|
||||
catch (const std::exception& e) {
|
||||
listening = false;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -257,6 +257,7 @@ namespace net::http {
|
|||
|
||||
// Deserialize
|
||||
req.deserialize(respData);
|
||||
return 0; // Might wanna return size instead
|
||||
}
|
||||
|
||||
int Client::sendResponseHeader(ResponseHeader& resp) {
|
||||
|
@ -274,6 +275,7 @@ namespace net::http {
|
|||
|
||||
// Deserialize
|
||||
resp.deserialize(respData);
|
||||
return 0; // Might wanna return size instead
|
||||
}
|
||||
|
||||
int Client::sendChunkHeader(ChunkHeader& chdr) {
|
||||
|
|
|
@ -80,8 +80,8 @@ public:
|
|||
try {
|
||||
client = net::rigctl::connect(host, port);
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Could not connect: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not connect: {}", e.what());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -200,8 +200,8 @@ private:
|
|||
listener = net::listen(hostname, port);
|
||||
listener->acceptAsync(clientHandler, this);
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Could not start rigctl server: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not start rigctl server: {}", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,10 @@ public:
|
|||
monoPacker.init(&s2m.out, 512);
|
||||
stereoPacker.init(_stream->sinkOut, 512);
|
||||
|
||||
#if RTAUDIO_VERSION_MAJOR >= 6
|
||||
audio.setErrorCallback(&errorCallback);
|
||||
#endif
|
||||
|
||||
bool created = false;
|
||||
std::string device = "";
|
||||
config.acquire();
|
||||
|
@ -42,12 +46,18 @@ public:
|
|||
device = config.conf[_streamName]["device"];
|
||||
config.release(created);
|
||||
|
||||
int count = audio.getDeviceCount();
|
||||
RtAudio::DeviceInfo info;
|
||||
#if RTAUDIO_VERSION_MAJOR >= 6
|
||||
for (int i : audio.getDeviceIds()) {
|
||||
#else
|
||||
int count = audio.getDeviceCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
#endif
|
||||
try {
|
||||
info = audio.getDeviceInfo(i);
|
||||
#if !defined(RTAUDIO_VERSION_MAJOR) || RTAUDIO_VERSION_MAJOR < 6
|
||||
if (!info.probed) { continue; }
|
||||
#endif
|
||||
if (info.outputChannels == 0) { continue; }
|
||||
if (info.isDefaultOutput) { defaultDevId = devList.size(); }
|
||||
devList.push_back(info);
|
||||
|
@ -55,8 +65,8 @@ public:
|
|||
txtDevList += info.name;
|
||||
txtDevList += '\0';
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("AudioSinkModule Error getting audio device info: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("AudioSinkModule Error getting audio device ({}) info: {}", i, e.what());
|
||||
}
|
||||
}
|
||||
selectByName(device);
|
||||
|
@ -156,6 +166,22 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
#if RTAUDIO_VERSION_MAJOR >= 6
|
||||
static void errorCallback(RtAudioErrorType type, const std::string& errorText) {
|
||||
switch (type) {
|
||||
case RtAudioErrorType::RTAUDIO_NO_ERROR:
|
||||
return;
|
||||
case RtAudioErrorType::RTAUDIO_WARNING:
|
||||
case RtAudioErrorType::RTAUDIO_NO_DEVICES_FOUND:
|
||||
case RtAudioErrorType::RTAUDIO_DEVICE_DISCONNECT:
|
||||
flog::warn("AudioSinkModule Warning: {} ({})", errorText, (int)type);
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error(errorText);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
bool doStart() {
|
||||
RtAudio::StreamParameters parameters;
|
||||
|
@ -172,8 +198,8 @@ private:
|
|||
audio.startStream();
|
||||
stereoPacker.start();
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
flog::error("Could not open audio device");
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not open audio device {0}", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,10 +141,10 @@ public:
|
|||
return;
|
||||
}
|
||||
}
|
||||
catch (std::exception e) {
|
||||
catch (const std::exception& e) {
|
||||
char buf[1024];
|
||||
sprintf(buf, "%016" PRIX64, serial);
|
||||
flog::error("Could not open Airspy {0}", buf);
|
||||
flog::error("Could not open Airspy {}", buf);
|
||||
}
|
||||
selectedSerial = serial;
|
||||
|
||||
|
|
|
@ -144,10 +144,10 @@ public:
|
|||
return;
|
||||
}
|
||||
}
|
||||
catch (std::exception e) {
|
||||
catch (const std::exception& e) {
|
||||
char buf[1024];
|
||||
sprintf(buf, "%016" PRIX64, serial);
|
||||
flog::error("Could not open Airspy HF+ {0}", buf);
|
||||
flog::error("Could not open Airspy HF+ {}", buf);
|
||||
}
|
||||
|
||||
selectedSerial = serial;
|
||||
|
|
|
@ -35,6 +35,10 @@ public:
|
|||
AudioSourceModule(std::string name) {
|
||||
this->name = name;
|
||||
|
||||
#if RTAUDIO_VERSION_MAJOR >= 6
|
||||
audio.setErrorCallback(&errorCallback);
|
||||
#endif
|
||||
|
||||
sampleRate = 48000.0;
|
||||
|
||||
handler.ctx = this;
|
||||
|
@ -83,21 +87,28 @@ public:
|
|||
void refresh() {
|
||||
devices.clear();
|
||||
|
||||
#if RTAUDIO_VERSION_MAJOR >= 6
|
||||
for (int i : audio.getDeviceIds()) {
|
||||
#else
|
||||
int count = audio.getDeviceCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
#endif
|
||||
try {
|
||||
// Get info
|
||||
auto info = audio.getDeviceInfo(i);
|
||||
|
||||
#if !defined(RTAUDIO_VERSION_MAJOR) || RTAUDIO_VERSION_MAJOR < 6
|
||||
if (!info.probed) { continue; }
|
||||
#endif
|
||||
// Check that it has a stereo input
|
||||
if (info.probed && info.inputChannels < 2) { continue; }
|
||||
if (info.inputChannels < 2) { continue; }
|
||||
|
||||
// Save info
|
||||
DeviceInfo dinfo = { info, i };
|
||||
devices.define(info.name, info.name, dinfo);
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Error getting audio device info: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Error getting audio device ({}) info: {}", i, e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -189,11 +200,11 @@ private:
|
|||
_this->audio.startStream();
|
||||
_this->running = true;
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Error opening audio device: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Error opening audio device: {}", e.what());
|
||||
}
|
||||
|
||||
flog::info("AudioSourceModule '{0}': Start!", _this->name);
|
||||
flog::info("AudioSourceModule '{}': Start!", _this->name);
|
||||
}
|
||||
|
||||
static void stop(void* ctx) {
|
||||
|
@ -254,6 +265,22 @@ private:
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if RTAUDIO_VERSION_MAJOR >= 6
|
||||
static void errorCallback(RtAudioErrorType type, const std::string& errorText) {
|
||||
switch (type) {
|
||||
case RtAudioErrorType::RTAUDIO_NO_ERROR:
|
||||
return;
|
||||
case RtAudioErrorType::RTAUDIO_WARNING:
|
||||
case RtAudioErrorType::RTAUDIO_NO_DEVICES_FOUND:
|
||||
case RtAudioErrorType::RTAUDIO_DEVICE_DISCONNECT:
|
||||
flog::warn("AudioSourceModule Warning: {} ({})", errorText, (int)type);
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error(errorText);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string name;
|
||||
bool enabled = true;
|
||||
dsp::stream<dsp::complex_t> stream;
|
||||
|
@ -290,4 +317,4 @@ MOD_EXPORT void _DELETE_INSTANCE_(ModuleManager::Instance* instance) {
|
|||
MOD_EXPORT void _END_() {
|
||||
config.disableAutoSave();
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,8 +139,8 @@ private:
|
|||
//gui::freqSelect.maxFreq = _this->centerFreq + (_this->sampleRate/2);
|
||||
//gui::freqSelect.limitFreq = true;
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
flog::error("Error: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Error: {}", e.what());
|
||||
}
|
||||
config.acquire();
|
||||
config.conf["path"] = _this->fileSelect.path;
|
||||
|
|
|
@ -154,8 +154,8 @@ private:
|
|||
_this->client = rfspace::connect(_this->hostname, _this->port, &_this->stream);
|
||||
_this->deviceInit();
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Could not connect to SDR: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not connect to SDR: {}", e.what());
|
||||
}
|
||||
}
|
||||
else if (connected && SmGui::Button("Disconnect##rfspace_source")) {
|
||||
|
|
|
@ -132,8 +132,8 @@ private:
|
|||
try {
|
||||
_this->client = rtltcp::connect(&_this->stream, _this->ip, _this->port);
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Could connect to RTL-TCP server: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could connect to RTL-TCP server: {}", e.what());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -233,8 +233,8 @@ private:
|
|||
client = server::connect(hostname, port, &stream);
|
||||
deviceInit();
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Could not connect to SDR: {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not connect to SDR: {}", e.what());
|
||||
if (!strcmp(e.what(), "Server busy")) { serverBusy = true; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "spectran_http_client.h"
|
||||
#include <utils/flog.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
SpectranHTTPClient::SpectranHTTPClient(std::string host, int port, dsp::stream<dsp::complex_t>* stream) {
|
||||
this->stream = stream;
|
||||
|
@ -50,10 +51,10 @@ void SpectranHTTPClient::setCenterFrequency(uint64_t freq) {
|
|||
// Make request
|
||||
net::http::RequestHeader rqhdr(net::http::METHOD_PUT, "/control", host);
|
||||
char buf[1024];
|
||||
sprintf(buf, "{\"frequencyCenter\":%d,\"frequencySpan\":%d,\"type\":\"capture\"}", freq, _samplerate);
|
||||
sprintf(buf, "{\"frequencyCenter\":%" PRIu64 ",\"frequencySpan\":%" PRIu64 ",\"type\":\"capture\"}", freq, _samplerate);
|
||||
std::string data = buf;
|
||||
char lenBuf[16];
|
||||
sprintf(lenBuf, "%d", data.size());
|
||||
sprintf(lenBuf, "%" PRIu64, (uint64_t)data.size());
|
||||
rqhdr.setField("Content-Length", lenBuf);
|
||||
controlHttp.sendRequestHeader(rqhdr);
|
||||
controlSock->sendstr(data);
|
||||
|
|
|
@ -283,8 +283,8 @@ private:
|
|||
flog::info("Connected to server");
|
||||
}
|
||||
}
|
||||
catch (std::exception e) {
|
||||
flog::error("Could not connect to spyserver {0}", e.what());
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Could not connect to spyserver {}", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue