1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

REST API: added missing bits in some modulators and demodulators for reverse API

This commit is contained in:
f4exb 2019-04-20 19:53:16 +02:00
parent e1982f6068
commit d504b060f9
15 changed files with 200 additions and 9 deletions

View File

@ -640,7 +640,7 @@ int BFMDemod::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getBfmDemodSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getBfmDemodSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getBfmDemodSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getBfmDemodSettings()->getReverseApiPort();

View File

@ -920,7 +920,7 @@ int DSDDemod::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getDsdDemodSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getDsdDemodSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getDsdDemodSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getDsdDemodSettings()->getReverseApiPort();

View File

@ -676,6 +676,11 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
<< " m_audioMute: " << settings.m_audioMute
<< " m_agcActive: " << settings.m_agc
<< " m_audioDeviceName: " << settings.m_audioDeviceName
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
<< " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex
<< " force: " << force;
QList<QString> reverseAPIKeys;
@ -832,6 +837,21 @@ int FreeDVDemod::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getFreeDvDemodSettings()->getAudioDeviceName();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getFreeDvDemodSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getFreeDvDemodSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getFreeDvDemodSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getFreeDvDemodSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getFreeDvDemodSettings()->getReverseApiChannelIndex();
}
if (frequencyOffsetChanged)
{
@ -889,6 +909,18 @@ void FreeDVDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
} else {
response.getFreeDvDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getFreeDvDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getFreeDvDemodSettings()->getReverseApiAddress()) {
*response.getFreeDvDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getFreeDvDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getFreeDvDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getFreeDvDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getFreeDvDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void FreeDVDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)

View File

@ -502,6 +502,10 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
<< " m_audioMute: " << settings.m_audioMute
<< " m_audioDeviceName: " << settings.m_audioDeviceName
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
<< " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex
<< " force: " << force;
QList<QString> reverseAPIKeys;
@ -704,6 +708,21 @@ int NFMDemod::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getNfmDemodSettings()->getAudioDeviceName();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getNfmDemodSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getNfmDemodSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getNfmDemodSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getNfmDemodSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getNfmDemodSettings()->getReverseApiChannelIndex();
}
if (frequencyOffsetChanged)
{
@ -763,6 +782,18 @@ void NFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
} else {
response.getNfmDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getNfmDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getNfmDemodSettings()->getReverseApiAddress()) {
*response.getNfmDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getNfmDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getNfmDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getNfmDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getNfmDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void NFMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)

View File

@ -463,6 +463,11 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
<< " agcPowerThreshold: " << settings.m_agcPowerThreshold
<< " agcThresholdGate: " << settings.m_agcThresholdGate
<< " m_audioDeviceName: " << settings.m_audioDeviceName
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
<< " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex
<< " force: " << force;
QList<QString> reverseAPIKeys;
@ -724,6 +729,21 @@ int SSBDemod::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getSsbDemodSettings()->getAudioDeviceName();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getSsbDemodSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getSsbDemodSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getSsbDemodSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getSsbDemodSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getSsbDemodSettings()->getReverseApiChannelIndex();
}
if (frequencyOffsetChanged)
{
@ -788,6 +808,18 @@ void SSBDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
} else {
response.getSsbDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getSsbDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getSsbDemodSettings()->getReverseApiAddress()) {
*response.getSsbDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getSsbDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getSsbDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getSsbDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getSsbDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void SSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)

View File

@ -328,6 +328,11 @@ void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force)
<< " m_squelch: " << settings.m_squelch
<< " m_audioDeviceName: " << settings.m_audioDeviceName
<< " m_audioMute: " << settings.m_audioMute
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
<< " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex
<< " force: " << force;
QList<QString> reverseAPIKeys;
@ -482,6 +487,21 @@ int WFMDemod::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getWfmDemodSettings()->getAudioDeviceName();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getWfmDemodSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getWfmDemodSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getWfmDemodSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getWfmDemodSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getWfmDemodSettings()->getReverseApiChannelIndex();
}
if (frequencyOffsetChanged)
{
@ -537,6 +557,18 @@ void WFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
} else {
response.getWfmDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getWfmDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getWfmDemodSettings()->getReverseApiAddress()) {
*response.getWfmDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getWfmDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getWfmDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getWfmDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getWfmDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void WFMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)

View File

@ -512,6 +512,11 @@ void UDPSink::applySettings(const UDPSinkSettings& settings, bool force)
<< " m_udpAddressStr: " << settings.m_udpAddress
<< " m_udpPort: " << settings.m_udpPort
<< " m_audioPort: " << settings.m_audioPort
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
<< " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex
<< " force: " << force;
QList<QString> reverseAPIKeys;
@ -792,6 +797,21 @@ int UDPSink::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("title")) {
settings.m_title = *response.getUdpSinkSettings()->getTitle();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getUdpSinkSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getUdpSinkSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getUdpSinkSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getUdpSinkSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getUdpSinkSettings()->getReverseApiChannelIndex();
}
if (frequencyOffsetChanged)
{
@ -859,6 +879,18 @@ void UDPSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo
} else {
response.getUdpSinkSettings()->setTitle(new QString(settings.m_title));
}
response.getUdpSinkSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getUdpSinkSettings()->getReverseApiAddress()) {
*response.getUdpSinkSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getUdpSinkSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getUdpSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getUdpSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getUdpSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void UDPSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)

View File

@ -635,7 +635,7 @@ int AMMod::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getAmModSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getAmModSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getAmModSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getAmModSettings()->getReverseApiPort();

View File

@ -1362,7 +1362,7 @@ int ATVMod::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getAtvModSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getAtvModSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getAtvModSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getAtvModSettings()->getReverseApiPort();

View File

@ -900,7 +900,7 @@ int FreeDVMod::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getFreeDvModSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getFreeDvModSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getFreeDvModSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getFreeDvModSettings()->getReverseApiPort();

View File

@ -691,7 +691,7 @@ int NFMMod::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getNfmModSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getNfmModSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getNfmModSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getNfmModSettings()->getReverseApiPort();

View File

@ -1045,7 +1045,7 @@ int SSBMod::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getSsbModSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getSsbModSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getSsbModSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getSsbModSettings()->getReverseApiPort();

View File

@ -499,6 +499,11 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force)
<< " m_playLoop: " << settings.m_playLoop
<< " m_modAFInput: " << settings.m_modAFInput
<< " m_audioDeviceName: " << settings.m_audioDeviceName
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
<< " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex
<< " force: " << force;
QList<QString> reverseAPIKeys;
@ -656,6 +661,21 @@ int WFMMod::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("fmDeviation")) {
settings.m_fmDeviation = response.getWfmModSettings()->getFmDeviation();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getWfmModSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getWfmModSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getWfmModSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getWfmModSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getWfmModSettings()->getReverseApiChannelIndex();
}
if (channelSettingsKeys.contains("cwKeyer"))
{
@ -766,6 +786,18 @@ void WFMMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respon
} else {
response.getWfmModSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getWfmModSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getWfmModSettings()->getReverseApiAddress()) {
*response.getWfmModSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getWfmModSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getWfmModSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getWfmModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getWfmModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void WFMMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)

View File

@ -423,7 +423,7 @@ int RemoteSource::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getRemoteSourceSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getRemoteSourceSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getRemoteSourceSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getRemoteSourceSettings()->getReverseApiPort();

View File

@ -755,7 +755,7 @@ int UDPSource::webapiSettingsPutPatch(
settings.m_useReverseAPI = response.getUdpSourceSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getUdpSourceSettings()->getReverseApiAddress() != 0;
settings.m_reverseAPIAddress = *response.getUdpSourceSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getUdpSourceSettings()->getReverseApiPort();