1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-03 14:34:57 -04:00

REST API: config: GET (11). Support of the rest of devices

This commit is contained in:
f4exb
2019-08-04 20:24:44 +02:00
parent 16e9684118
commit a078239685
205 changed files with 3843 additions and 494 deletions
@@ -795,7 +795,26 @@ int PlutoSDRInput::webapiSettingsPutPatch(
{
(void) errorMessage;
PlutoSDRInputSettings settings = m_settings;
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
MsgConfigurePlutoSDR *msg = MsgConfigurePlutoSDR::create(settings, force);
m_inputMessageQueue.push(msg);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigurePlutoSDR *msgToGUI = MsgConfigurePlutoSDR::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatDeviceSettings(response, settings);
return 200;
}
void webapiUpdateDeviceSettings(
PlutoSDRInputSettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)
{
if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getPlutoSdrInputSettings()->getCenterFrequency();
}
@@ -877,18 +896,6 @@ int PlutoSDRInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getPlutoSdrInputSettings()->getReverseApiDeviceIndex();
}
MsgConfigurePlutoSDR *msg = MsgConfigurePlutoSDR::create(settings, force);
m_inputMessageQueue.push(msg);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigurePlutoSDR *msgToGUI = MsgConfigurePlutoSDR::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatDeviceSettings(response, settings);
return 200;
}
int PlutoSDRInput::webapiReportGet(
@@ -920,7 +927,7 @@ void PlutoSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
response.getPlutoSdrInputSettings()->setLog2Decim(settings.m_log2Decim);
response.getPlutoSdrInputSettings()->setLpfBw(settings.m_lpfBW);
response.getPlutoSdrInputSettings()->setGain(settings.m_gain);
response.getPlutoSdrInputSettings()->setAntennaPath((int) m_settings.m_antennaPath);
response.getPlutoSdrInputSettings()->setAntennaPath((int) settings.m_antennaPath);
response.getPlutoSdrInputSettings()->setGainMode((int) settings.m_gainMode);
response.getPlutoSdrInputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getPlutoSdrInputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);