1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -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
@@ -333,7 +333,26 @@ int RemoteInput::webapiSettingsPutPatch(
{
(void) errorMessage;
RemoteInputSettings settings = m_settings;
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
MsgConfigureRemoteInput *msg = MsgConfigureRemoteInput::create(settings, force);
m_inputMessageQueue.push(msg);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureRemoteInput *msgToGUI = MsgConfigureRemoteInput::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatDeviceSettings(response, settings);
return 200;
}
void webapiUpdateDeviceSettings(
RemoteInputSettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)
{
if (deviceSettingsKeys.contains("apiAddress")) {
settings.m_apiAddress = *response.getRemoteInputSettings()->getApiAddress();
}
@@ -367,18 +386,6 @@ int RemoteInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getRemoteInputSettings()->getReverseApiDeviceIndex();
}
MsgConfigureRemoteInput *msg = MsgConfigureRemoteInput::create(settings, force);
m_inputMessageQueue.push(msg);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureRemoteInput *msgToGUI = MsgConfigureRemoteInput::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatDeviceSettings(response, settings);
return 200;
}
void RemoteInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const RemoteInputSettings& settings)