mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-10 13:40:37 -04:00
Reverse API: RTL-SDR input changes (2)
This commit is contained in:
parent
b29c3b5db8
commit
082fcc000d
plugins/samplesource/rtlsdr
@ -333,8 +333,7 @@ bool RTLSDRInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition()) {
|
||||
m_deviceAPI->startAcquisition();
|
||||
}
|
||||
}
|
||||
@ -343,6 +342,10 @@ bool RTLSDRInput::handleMessage(const Message& message)
|
||||
m_deviceAPI->stopAcquisition();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
webapiReverseSendStartStop(cmd.getStartStop());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -812,6 +815,21 @@ void RTLSDRInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
|
||||
delete swgDeviceSettings;
|
||||
}
|
||||
|
||||
void RTLSDRInput::webapiReverseSendStartStop(bool start)
|
||||
{
|
||||
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/run")
|
||||
.arg(m_settings.m_reverseAPIAddress)
|
||||
.arg(m_settings.m_reverseAPIPort)
|
||||
.arg(m_settings.m_reverseAPIDeviceIndex);
|
||||
m_networkRequest.setUrl(QUrl(channelSettingsURL));
|
||||
|
||||
if (start) {
|
||||
m_networkManager->sendCustomRequest(m_networkRequest, "POST");
|
||||
} else {
|
||||
m_networkManager->sendCustomRequest(m_networkRequest, "DELETE");
|
||||
}
|
||||
}
|
||||
|
||||
void RTLSDRInput::networkManagerFinished(QNetworkReply *reply)
|
||||
{
|
||||
if (reply->error())
|
||||
|
@ -168,6 +168,7 @@ private:
|
||||
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const RTLSDRSettings& settings);
|
||||
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const RTLSDRSettings& settings, bool force);
|
||||
void webapiReverseSendStartStop(bool start);
|
||||
|
||||
private slots:
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
|
Loading…
Reference in New Issue
Block a user