From 31af8bd64ec33d3f9fada330913e796568e11321 Mon Sep 17 00:00:00 2001 From: Michal Fratczak Date: Wed, 5 Feb 2020 00:58:20 +0100 Subject: [PATCH] Fix --device -1 option --- code/websocketServer/GLOBALS.h | 2 +- code/websocketServer/main.cpp | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/code/websocketServer/GLOBALS.h b/code/websocketServer/GLOBALS.h index d625e7f..94672e6 100644 --- a/code/websocketServer/GLOBALS.h +++ b/code/websocketServer/GLOBALS.h @@ -75,7 +75,7 @@ public: // options struct PARAMS { - int device_ = -1; // index to SoapySDR::Device::enumerate() + int device_ = 0; // index to SoapySDR::Device::enumerate() std::string command_host_ = "0.0.0.0"; int command_port_ = 5555; std::string station_callsign_ = ""; // habitat upload diff --git a/code/websocketServer/main.cpp b/code/websocketServer/main.cpp index 042bd5d..f23e0a2 100755 --- a/code/websocketServer/main.cpp +++ b/code/websocketServer/main.cpp @@ -112,6 +112,18 @@ bool SetupDevice(SoapySDR::Kwargs& o_device) } int device_index = GLOBALS::get().par_.device_; + + if(device_index < 0) + { + cout<= int(device_list.size()) ) { cout<