1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Reverse API: RTL-SDR (4) and Test Source (2) input changes

This commit is contained in:
f4exb
2018-12-18 21:46:03 +01:00
parent 8e8eb191a3
commit 442f23ca91
14 changed files with 360 additions and 6 deletions
@@ -552,6 +552,18 @@ int TestSourceInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getTestSourceSettings()->getFileRecordName();
}
if (deviceSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getTestSourceSettings()->getUseReverseApi() != 0;
}
if (deviceSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getTestSourceSettings()->getReverseApiAddress() != 0;
}
if (deviceSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getTestSourceSettings()->getReverseApiPort();
}
if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getTestSourceSettings()->getReverseApiDeviceIndex();
}
MsgConfigureTestSource *msg = MsgConfigureTestSource::create(settings, force);
m_inputMessageQueue.push(msg);
@@ -590,6 +602,17 @@ void TestSourceInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings&
} else {
response.getTestSourceSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
response.getTestSourceSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getTestSourceSettings()->getReverseApiAddress()) {
*response.getTestSourceSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getTestSourceSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getTestSourceSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getTestSourceSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
}
void TestSourceInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const TestSourceSettings& settings, bool force)