1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

XTRX output: REST API fixes

This commit is contained in:
f4exb 2019-01-16 01:56:43 +01:00
parent 919c88b0ce
commit 8d4dc0c8ff
2 changed files with 18 additions and 3 deletions

View File

@ -1171,8 +1171,8 @@ int XTRXOutput::webapiSettingsGet(
QString& errorMessage)
{
(void) errorMessage;
response.setXtrxInputSettings(new SWGSDRangel::SWGXtrxInputSettings());
response.getXtrxInputSettings()->init();
response.setXtrxOutputSettings(new SWGSDRangel::SWGXtrxOutputSettings());
response.getXtrxOutputSettings()->init();
webapiFormatDeviceSettings(response, m_settings);
return 200;
}
@ -1280,7 +1280,7 @@ int XTRXOutput::webapiReportGet(
{
(void) errorMessage;
response.setXtrxOutputReport(new SWGSDRangel::SWGXtrxOutputReport());
response.getXtrxInputReport()->init();
response.getXtrxOutputReport()->init();
webapiFormatDeviceReport(response);
return 200;
}

View File

@ -2085,6 +2085,21 @@ bool WebAPIRequestMapper::validateDeviceSettings(
return false;
}
}
else if ((*deviceHwType == "XTRX") && (deviceSettings.getTx() != 0))
{
if (jsonObject.contains("xtrxOutputSettings") && jsonObject["xtrxOutputSettings"].isObject())
{
QJsonObject xtrxOutputSettingsJsonObject = jsonObject["xtrxOutputSettings"].toObject();
deviceSettingsKeys = xtrxOutputSettingsJsonObject.keys();
deviceSettings.setXtrxOutputSettings(new SWGSDRangel::SWGXtrxOutputSettings());
deviceSettings.getXtrxOutputSettings()->fromJsonObject(xtrxOutputSettingsJsonObject);
return true;
}
else
{
return false;
}
}
else
{
return false;