Skip to content

Commit

Permalink
Aaronia RTSA: Fixed API device settings PUT and PATCH
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed May 23, 2023
1 parent 2b6f033 commit 1934867
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sdrbase/webapi/webapirequestmapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4830,7 +4830,17 @@ bool WebAPIRequestMapper::getDeviceSettings(
extractKeys(settingsJsonObject, deviceSettingsKeys);
qDebug() << "WebAPIRequestMapper::getDeviceSettings: deviceSettingsKeys: " << deviceSettingsKeys;

if (deviceSettingsKey == "airspySettings")
if (deviceSettingsKey == "aaroniaRTSASettings")
{
deviceSettings->setAaroniaRtsaSettings(new SWGSDRangel::SWGAaroniaRTSASettings());
deviceSettings->getAaroniaRtsaSettings()->fromJsonObject(settingsJsonObject);
}
else if (deviceSettingsKey == "aaroniaRTSAOutputSettings")
{
deviceSettings->setAaroniaRtsaOutputSettings(new SWGSDRangel::SWGAaroniaRTSAOutputSettings());
deviceSettings->getAaroniaRtsaOutputSettings()->fromJsonObject(settingsJsonObject);
}
else if (deviceSettingsKey == "airspySettings")
{
deviceSettings->setAirspySettings(new SWGSDRangel::SWGAirspySettings());
deviceSettings->getAirspySettings()->fromJsonObject(settingsJsonObject);
Expand Down
4 changes: 4 additions & 0 deletions sdrbase/webapi/webapiutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ const QMap<QString, QString> WebAPIUtils::m_channelURIToSettingsKey = {
};

const QMap<QString, QString> WebAPIUtils::m_deviceIdToSettingsKey = {
{"sdrangel.samplesource.aaroniartsasource", "aaroniaRTSASettings"},
{"sdrangel.samplesink.aaroniartsaoutput", "aaroniaRTSAOutputSettings"},
{"sdrangel.samplesource.airspy", "airspySettings"},
{"sdrangel.samplesource.airspyhf", "airspyHFSettings"},
{"sdrangel.samplesource.audioinput", "audioInputSettings"},
Expand Down Expand Up @@ -209,6 +211,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToActionsKey = {
};

const QMap<QString, QString> WebAPIUtils::m_sourceDeviceHwIdToSettingsKey = {
{"AaroniaRTSA", "aaroniaRTSASettings"},
{"Airspy", "airspySettings"},
{"AirspyHF", "airspyHFSettings"},
{"AudioInput", "audioInputSettings"},
Expand Down Expand Up @@ -260,6 +263,7 @@ const QMap<QString, QString> WebAPIUtils::m_sourceDeviceHwIdToActionsKey = {
};

const QMap<QString, QString> WebAPIUtils::m_sinkDeviceHwIdToSettingsKey = {
{"AaroniaRTSAOutput", "aaroniaRTSAOutputSettings"},
{"AudioOutput", "audioOutputSettings"},
{"BladeRF1", "bladeRF1OutputSettings"},
{"BladeRF2", "bladeRF2OutputSettings"},
Expand Down

0 comments on commit 1934867

Please sign in to comment.