From 430f411e8d961a1853a8e855ccec6a617f7f0c89 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 15 Nov 2018 08:46:29 +0100 Subject: [PATCH] SoapySDR support: REST API: recognize SoapySDR --- sdrbase/webapi/webapirequestmapper.cpp | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 5e53838cd..2a89d054d 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -1993,6 +1993,36 @@ bool WebAPIRequestMapper::validateDeviceSettings( return false; } } + else if ((*deviceHwType == "SoapySDR") && (deviceSettings.getTx() == 0)) + { + if (jsonObject.contains("soapySDRInputSettings") && jsonObject["soapySDRInputSettings"].isObject()) + { + QJsonObject soapySdrInputSettingsJsonObject = jsonObject["soapySDRInputSettings"].toObject(); + deviceSettingsKeys = soapySdrInputSettingsJsonObject.keys(); + deviceSettings.setSoapySdrInputSettings(new SWGSDRangel::SWGSoapySDRInputSettings()); + deviceSettings.getSoapySdrInputSettings()->fromJsonObject(soapySdrInputSettingsJsonObject); + return true; + } + else + { + return false; + } + } + else if ((*deviceHwType == "SoapySDR") && (deviceSettings.getTx() != 0)) + { + if (jsonObject.contains("soapySDROutputSettings") && jsonObject["soapySDROutputSettings"].isObject()) + { + QJsonObject soapySdrOutputSettingsJsonObject = jsonObject["soapySDROutputSettings"].toObject(); + deviceSettingsKeys = soapySdrOutputSettingsJsonObject.keys(); + deviceSettings.setSoapySdrOutputSettings(new SWGSDRangel::SWGSoapySDROutputSettings()); + deviceSettings.getSoapySdrOutputSettings()->fromJsonObject(soapySdrOutputSettingsJsonObject); + return true; + } + else + { + return false; + } + } else if (*deviceHwType == "TestSource") { if (jsonObject.contains("testSourceSettings") && jsonObject["testSourceSettings"].isObject())