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:
@@ -598,7 +598,26 @@ int RTLSDRInput::webapiSettingsPutPatch(
|
||||
{
|
||||
(void) errorMessage;
|
||||
RTLSDRSettings settings = m_settings;
|
||||
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
|
||||
|
||||
MsgConfigureRTLSDR *msg = MsgConfigureRTLSDR::create(settings, force);
|
||||
m_inputMessageQueue.push(msg);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
MsgConfigureRTLSDR *msgToGUI = MsgConfigureRTLSDR::create(settings, force);
|
||||
m_guiMessageQueue->push(msgToGUI);
|
||||
}
|
||||
|
||||
webapiFormatDeviceSettings(response, settings);
|
||||
return 200;
|
||||
}
|
||||
|
||||
void RTLSDRInput::webapiUpdateDeviceSettings(
|
||||
RTLSDRSettings& settings,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
SWGSDRangel::SWGDeviceSettings& response)
|
||||
{
|
||||
if (deviceSettingsKeys.contains("agc")) {
|
||||
settings.m_agc = response.getRtlSdrSettings()->getAgc() != 0;
|
||||
}
|
||||
@@ -659,18 +678,6 @@ int RTLSDRInput::webapiSettingsPutPatch(
|
||||
if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
settings.m_reverseAPIDeviceIndex = response.getRtlSdrSettings()->getReverseApiDeviceIndex();
|
||||
}
|
||||
|
||||
MsgConfigureRTLSDR *msg = MsgConfigureRTLSDR::create(settings, force);
|
||||
m_inputMessageQueue.push(msg);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
MsgConfigureRTLSDR *msgToGUI = MsgConfigureRTLSDR::create(settings, force);
|
||||
m_guiMessageQueue->push(msgToGUI);
|
||||
}
|
||||
|
||||
webapiFormatDeviceSettings(response, settings);
|
||||
return 200;
|
||||
}
|
||||
|
||||
void RTLSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const RTLSDRSettings& settings)
|
||||
|
||||
Reference in New Issue
Block a user