mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 12:51:49 -05:00
REST API: config: (6): config preset channel Rx adapters
This commit is contained in:
parent
2274d20856
commit
a4007b762e
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = {
|
const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = {
|
||||||
QString("AM Demodulator"),
|
QString("AM Demodulator"),
|
||||||
QString("4.5.2"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
|
@ -3,6 +3,7 @@ project(bfm)
|
|||||||
set(bfm_SOURCES
|
set(bfm_SOURCES
|
||||||
bfmdemod.cpp
|
bfmdemod.cpp
|
||||||
bfmdemodsettings.cpp
|
bfmdemodsettings.cpp
|
||||||
|
bfmdemodwebapiadapter.cpp
|
||||||
bfmplugin.cpp
|
bfmplugin.cpp
|
||||||
rdsdemod.cpp
|
rdsdemod.cpp
|
||||||
rdsdecoder.cpp
|
rdsdecoder.cpp
|
||||||
@ -13,6 +14,7 @@ set(bfm_SOURCES
|
|||||||
set(bfm_HEADERS
|
set(bfm_HEADERS
|
||||||
bfmdemod.h
|
bfmdemod.h
|
||||||
bfmdemodsettings.h
|
bfmdemodsettings.h
|
||||||
|
bfmdemodwebapiadapter.h
|
||||||
bfmplugin.h
|
bfmplugin.h
|
||||||
rdsdemod.h
|
rdsdemod.h
|
||||||
rdsdecoder.h
|
rdsdecoder.h
|
||||||
|
51
plugins/channelrx/demodbfm/bfmdemodwebapiadapter.cpp
Normal file
51
plugins/channelrx/demodbfm/bfmdemodwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "bfmdemod.h"
|
||||||
|
#include "bfmdemodwebapiadapter.h"
|
||||||
|
|
||||||
|
BFMDemodWebAPIAdapter::BFMDemodWebAPIAdapter() :
|
||||||
|
ChannelAPI(BFMDemod::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
BFMDemodWebAPIAdapter::~BFMDemodWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int BFMDemodWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setBfmDemodSettings(new SWGSDRangel::SWGBFMDemodSettings());
|
||||||
|
response.getBfmDemodSettings()->init();
|
||||||
|
BFMDemod::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int BFMDemodWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
BFMDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/demodbfm/bfmdemodwebapiadapter.h
Normal file
65
plugins/channelrx/demodbfm/bfmdemodwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_BFMDEMOD_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_BFMDEMOD_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "bfmdemodsettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class BFMDemodWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
BFMDemodWebAPIAdapter();
|
||||||
|
virtual ~BFMDemodWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
BFMDemodSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_BFMDEMOD_WEBAPIADAPTER_H
|
@ -25,10 +25,12 @@
|
|||||||
#include "bfmdemodgui.h"
|
#include "bfmdemodgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "bfmdemod.h"
|
#include "bfmdemod.h"
|
||||||
|
#include "bfmdemodwebapiadapter.h"
|
||||||
|
#include "bfmplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor BFMPlugin::m_pluginDescriptor = {
|
const PluginDescriptor BFMPlugin::m_pluginDescriptor = {
|
||||||
QString("Broadcast FM Demodulator"),
|
QString("Broadcast FM Demodulator"),
|
||||||
QString("4.5.2"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -78,3 +80,7 @@ ChannelAPI* BFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new BFMDemod(deviceAPI);
|
return new BFMDemod(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* BFMPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new BFMDemodWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
@ -5,6 +5,7 @@ set(dsddemod_SOURCES
|
|||||||
dsddemodplugin.cpp
|
dsddemodplugin.cpp
|
||||||
dsddemodbaudrates.cpp
|
dsddemodbaudrates.cpp
|
||||||
dsddemodsettings.cpp
|
dsddemodsettings.cpp
|
||||||
|
dsddemodwebapiadapter.cpp
|
||||||
dsddecoder.cpp
|
dsddecoder.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ set(dsddemod_HEADERS
|
|||||||
dsddemodplugin.h
|
dsddemodplugin.h
|
||||||
dsddemodbaudrates.h
|
dsddemodbaudrates.h
|
||||||
dsddemodsettings.h
|
dsddemodsettings.h
|
||||||
|
dsddemodwebapiadapter.h
|
||||||
dsddecoder.h
|
dsddecoder.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -24,10 +24,12 @@
|
|||||||
#include "dsddemodgui.h"
|
#include "dsddemodgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "dsddemod.h"
|
#include "dsddemod.h"
|
||||||
|
#include "dsddemodwebapiadapter.h"
|
||||||
|
#include "dsddemodplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = {
|
const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = {
|
||||||
QString("DSD Demodulator"),
|
QString("DSD Demodulator"),
|
||||||
QString("4.5.6"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -77,3 +79,7 @@ ChannelAPI* DSDDemodPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new DSDDemod(deviceAPI);
|
return new DSDDemod(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* DSDDemodPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new DSDDemodWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
51
plugins/channelrx/demoddsd/dsddemodwebapiadapter.cpp
Normal file
51
plugins/channelrx/demoddsd/dsddemodwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "dsddemod.h"
|
||||||
|
#include "dsddemodwebapiadapter.h"
|
||||||
|
|
||||||
|
DSDDemodWebAPIAdapter::DSDDemodWebAPIAdapter() :
|
||||||
|
ChannelAPI(DSDDemod::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
DSDDemodWebAPIAdapter::~DSDDemodWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int DSDDemodWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setDsdDemodSettings(new SWGSDRangel::SWGDSDDemodSettings());
|
||||||
|
response.getDsdDemodSettings()->init();
|
||||||
|
DSDDemod::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int DSDDemodWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
DSDDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/demoddsd/dsddemodwebapiadapter.h
Normal file
65
plugins/channelrx/demoddsd/dsddemodwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_DSDDEMOD_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_DSDDEMOD_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "dsddemodsettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class DSDDemodWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
DSDDemodWebAPIAdapter();
|
||||||
|
virtual ~DSDDemodWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DSDDemodSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_DSDDEMOD_WEBAPIADAPTER_H
|
@ -3,12 +3,14 @@ project(demodfreedv)
|
|||||||
set(freedv_SOURCES
|
set(freedv_SOURCES
|
||||||
freedvdemod.cpp
|
freedvdemod.cpp
|
||||||
freedvdemodsettings.cpp
|
freedvdemodsettings.cpp
|
||||||
|
freedvdemodwebapiadapter.cpp
|
||||||
freedvplugin.cpp
|
freedvplugin.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(freedv_HEADERS
|
set(freedv_HEADERS
|
||||||
freedvdemod.h
|
freedvdemod.h
|
||||||
freedvdemodsettings.h
|
freedvdemodsettings.h
|
||||||
|
freedvdemodwebapiadapter.h
|
||||||
freedvplugin.h
|
freedvplugin.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
51
plugins/channelrx/demodfreedv/freedvdemodwebapiadapter.cpp
Normal file
51
plugins/channelrx/demodfreedv/freedvdemodwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "freedvdemod.h"
|
||||||
|
#include "freedvdemodwebapiadapter.h"
|
||||||
|
|
||||||
|
FreeDVDemodWebAPIAdapter::FreeDVDemodWebAPIAdapter() :
|
||||||
|
ChannelAPI(FreeDVDemod::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
FreeDVDemodWebAPIAdapter::~FreeDVDemodWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int FreeDVDemodWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setFreeDvDemodSettings(new SWGSDRangel::SWGFreeDVDemodSettings());
|
||||||
|
response.getFreeDvDemodSettings()->init();
|
||||||
|
FreeDVDemod::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FreeDVDemodWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
FreeDVDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/demodfreedv/freedvdemodwebapiadapter.h
Normal file
65
plugins/channelrx/demodfreedv/freedvdemodwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_FREEDVDEMOD_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_FREEDVDEMOD_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "freedvdemodsettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class FreeDVDemodWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
FreeDVDemodWebAPIAdapter();
|
||||||
|
virtual ~FreeDVDemodWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
FreeDVDemodSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_FREEDVDEMOD_WEBAPIADAPTER_H
|
@ -22,11 +22,12 @@
|
|||||||
#include "freedvdemodgui.h"
|
#include "freedvdemodgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "freedvdemod.h"
|
#include "freedvdemod.h"
|
||||||
|
#include "freedvdemodwebapiadapter.h"
|
||||||
#include "freedvplugin.h"
|
#include "freedvplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor FreeDVPlugin::m_pluginDescriptor = {
|
const PluginDescriptor FreeDVPlugin::m_pluginDescriptor = {
|
||||||
QString("FreeDV Demodulator"),
|
QString("FreeDV Demodulator"),
|
||||||
QString("4.5.5"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -76,3 +77,7 @@ ChannelAPI* FreeDVPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new FreeDVDemod(deviceAPI);
|
return new FreeDVDemod(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* FreeDVPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new FreeDVDemodWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
@ -3,12 +3,14 @@ project(nfm)
|
|||||||
set(nfm_SOURCES
|
set(nfm_SOURCES
|
||||||
nfmdemod.cpp
|
nfmdemod.cpp
|
||||||
nfmdemodsettings.cpp
|
nfmdemodsettings.cpp
|
||||||
|
nfmdemodwebapiadapter.cpp
|
||||||
nfmplugin.cpp
|
nfmplugin.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(nfm_HEADERS
|
set(nfm_HEADERS
|
||||||
nfmdemod.h
|
nfmdemod.h
|
||||||
nfmdemodsettings.h
|
nfmdemodsettings.h
|
||||||
|
nfmdemodwebapiadapter.h
|
||||||
nfmplugin.h
|
nfmplugin.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
51
plugins/channelrx/demodnfm/nfmdemodwebapiadapter.cpp
Normal file
51
plugins/channelrx/demodnfm/nfmdemodwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "nfmdemod.h"
|
||||||
|
#include "nfmdemodwebapiadapter.h"
|
||||||
|
|
||||||
|
NFMDemodWebAPIAdapter::NFMDemodWebAPIAdapter() :
|
||||||
|
ChannelAPI(NFMDemod::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
NFMDemodWebAPIAdapter::~NFMDemodWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int NFMDemodWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setNfmDemodSettings(new SWGSDRangel::SWGNFMDemodSettings());
|
||||||
|
response.getNfmDemodSettings()->init();
|
||||||
|
NFMDemod::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int NFMDemodWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
NFMDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/demodnfm/nfmdemodwebapiadapter.h
Normal file
65
plugins/channelrx/demodnfm/nfmdemodwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_NFMDEMOD_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_NFMDEMOD_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "nfmdemodsettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class NFMDemodWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
NFMDemodWebAPIAdapter();
|
||||||
|
virtual ~NFMDemodWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
NFMDemodSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_NFMDEMOD_WEBAPIADAPTER_H
|
@ -6,10 +6,12 @@
|
|||||||
#include "nfmdemodgui.h"
|
#include "nfmdemodgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "nfmdemod.h"
|
#include "nfmdemod.h"
|
||||||
|
#include "nfmdemodwebapiadapter.h"
|
||||||
|
#include "nfmplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor NFMPlugin::m_pluginDescriptor = {
|
const PluginDescriptor NFMPlugin::m_pluginDescriptor = {
|
||||||
QString("NFM Demodulator"),
|
QString("NFM Demodulator"),
|
||||||
QString("4.5.2"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -59,3 +61,7 @@ ChannelAPI* NFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new NFMDemod(deviceAPI);
|
return new NFMDemod(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* NFMPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new NFMDemodWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
@ -3,12 +3,14 @@ project(ssb)
|
|||||||
set(ssb_SOURCES
|
set(ssb_SOURCES
|
||||||
ssbdemod.cpp
|
ssbdemod.cpp
|
||||||
ssbdemodsettings.cpp
|
ssbdemodsettings.cpp
|
||||||
|
ssbdemodwebapiadapter.cpp
|
||||||
ssbplugin.cpp
|
ssbplugin.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ssb_HEADERS
|
set(ssb_HEADERS
|
||||||
ssbdemod.h
|
ssbdemod.h
|
||||||
ssbdemodsettings.h
|
ssbdemodsettings.h
|
||||||
|
ssbdemodwebapiadapter.h
|
||||||
ssbplugin.h
|
ssbplugin.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
51
plugins/channelrx/demodssb/ssbdemodwebapiadapter.cpp
Normal file
51
plugins/channelrx/demodssb/ssbdemodwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "ssbdemod.h"
|
||||||
|
#include "ssbdemodwebapiadapter.h"
|
||||||
|
|
||||||
|
SSBDemodWebAPIAdapter::SSBDemodWebAPIAdapter() :
|
||||||
|
ChannelAPI(SSBDemod::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
SSBDemodWebAPIAdapter::~SSBDemodWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int SSBDemodWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setSsbDemodSettings(new SWGSDRangel::SWGSSBDemodSettings());
|
||||||
|
response.getSsbDemodSettings()->init();
|
||||||
|
SSBDemod::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SSBDemodWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
SSBDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/demodssb/ssbdemodwebapiadapter.h
Normal file
65
plugins/channelrx/demodssb/ssbdemodwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_SSBDEMOD_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_SSBDEMOD_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "ssbdemodsettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class SSBDemodWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
SSBDemodWebAPIAdapter();
|
||||||
|
virtual ~SSBDemodWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
SSBDemodSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_SSBDEMOD_WEBAPIADAPTER_H
|
@ -6,10 +6,12 @@
|
|||||||
#include "ssbdemodgui.h"
|
#include "ssbdemodgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "ssbdemod.h"
|
#include "ssbdemod.h"
|
||||||
|
#include "ssbdemodwebapiadapter.h"
|
||||||
|
#include "ssbplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor SSBPlugin::m_pluginDescriptor = {
|
const PluginDescriptor SSBPlugin::m_pluginDescriptor = {
|
||||||
QString("SSB Demodulator"),
|
QString("SSB Demodulator"),
|
||||||
QString("4.10.0"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -59,3 +61,7 @@ ChannelAPI* SSBPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new SSBDemod(deviceAPI);
|
return new SSBDemod(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* SSBPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new SSBDemodWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
@ -3,12 +3,14 @@ project(wfm)
|
|||||||
set(wfm_SOURCES
|
set(wfm_SOURCES
|
||||||
wfmdemod.cpp
|
wfmdemod.cpp
|
||||||
wfmdemodsettings.cpp
|
wfmdemodsettings.cpp
|
||||||
|
wfmdemodwebapiadapter.cpp
|
||||||
wfmplugin.cpp
|
wfmplugin.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(wfm_HEADERS
|
set(wfm_HEADERS
|
||||||
wfmdemod.h
|
wfmdemod.h
|
||||||
wfmdemodsettings.h
|
wfmdemodsettings.h
|
||||||
|
wfmdemodwebapiadapter.h
|
||||||
wfmplugin.h
|
wfmplugin.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
51
plugins/channelrx/demodwfm/wfmdemodwebapiadapter.cpp
Normal file
51
plugins/channelrx/demodwfm/wfmdemodwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "wfmdemod.h"
|
||||||
|
#include "wfmdemodwebapiadapter.h"
|
||||||
|
|
||||||
|
WFMDemodWebAPIAdapter::WFMDemodWebAPIAdapter() :
|
||||||
|
ChannelAPI(WFMDemod::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
WFMDemodWebAPIAdapter::~WFMDemodWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int WFMDemodWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setWfmDemodSettings(new SWGSDRangel::SWGWFMDemodSettings());
|
||||||
|
response.getWfmDemodSettings()->init();
|
||||||
|
WFMDemod::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int WFMDemodWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
WFMDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/demodwfm/wfmdemodwebapiadapter.h
Normal file
65
plugins/channelrx/demodwfm/wfmdemodwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_WFMDEMOD_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_WFMDEMOD_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "wfmdemodsettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class WFMDemodWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
WFMDemodWebAPIAdapter();
|
||||||
|
virtual ~WFMDemodWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
WFMDemodSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_WFMDEMOD_WEBAPIADAPTER_H
|
@ -7,10 +7,12 @@
|
|||||||
#include "wfmdemodgui.h"
|
#include "wfmdemodgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "wfmdemod.h"
|
#include "wfmdemod.h"
|
||||||
|
#include "wfmdemodwebapiadapter.h"
|
||||||
|
#include "wfmplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor WFMPlugin::m_pluginDescriptor = {
|
const PluginDescriptor WFMPlugin::m_pluginDescriptor = {
|
||||||
QString("WFM Demodulator"),
|
QString("WFM Demodulator"),
|
||||||
QString("4.9.1"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -60,3 +62,7 @@ ChannelAPI* WFMPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new WFMDemod(deviceAPI);
|
return new WFMDemod(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* WFMPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new WFMDemodWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
@ -3,12 +3,14 @@ project(freqtracker)
|
|||||||
set(freqtracker_SOURCES
|
set(freqtracker_SOURCES
|
||||||
freqtracker.cpp
|
freqtracker.cpp
|
||||||
freqtrackersettings.cpp
|
freqtrackersettings.cpp
|
||||||
|
freqtrackerwebapiadapter.cpp
|
||||||
freqtrackerplugin.cpp
|
freqtrackerplugin.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(freqtracker_HEADERS
|
set(freqtracker_HEADERS
|
||||||
freqtracker.h
|
freqtracker.h
|
||||||
freqtrackersettings.h
|
freqtrackersettings.h
|
||||||
|
freqtrackerwebapiadapter.h
|
||||||
freqtrackerplugin.h
|
freqtrackerplugin.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,11 +22,12 @@
|
|||||||
#include "freqtrackergui.h"
|
#include "freqtrackergui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "freqtracker.h"
|
#include "freqtracker.h"
|
||||||
|
#include "freqtrackerwebapiadapter.h"
|
||||||
#include "freqtrackerplugin.h"
|
#include "freqtrackerplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor FreqTrackerPlugin::m_pluginDescriptor = {
|
const PluginDescriptor FreqTrackerPlugin::m_pluginDescriptor = {
|
||||||
QString("Frequency Tracker"),
|
QString("Frequency Tracker"),
|
||||||
QString("4.7.0"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -76,3 +77,7 @@ ChannelAPI* FreqTrackerPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new FreqTracker(deviceAPI);
|
return new FreqTracker(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* FreqTrackerPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new FreqTrackerWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
51
plugins/channelrx/freqtracker/freqtrackerwebapiadapter.cpp
Normal file
51
plugins/channelrx/freqtracker/freqtrackerwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "freqtracker.h"
|
||||||
|
#include "freqtrackerwebapiadapter.h"
|
||||||
|
|
||||||
|
FreqTrackerWebAPIAdapter::FreqTrackerWebAPIAdapter() :
|
||||||
|
ChannelAPI(FreqTracker::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
FreqTrackerWebAPIAdapter::~FreqTrackerWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int FreqTrackerWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setFreqTrackerSettings(new SWGSDRangel::SWGFreqTrackerSettings());
|
||||||
|
response.getFreqTrackerSettings()->init();
|
||||||
|
FreqTracker::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FreqTrackerWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
FreqTracker::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/freqtracker/freqtrackerwebapiadapter.h
Normal file
65
plugins/channelrx/freqtracker/freqtrackerwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_FREQTRACKER_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_FREQTRACKER_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "freqtrackersettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class FreqTrackerWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
FreqTrackerWebAPIAdapter();
|
||||||
|
virtual ~FreqTrackerWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
FreqTrackerSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_FREQTRACKER_WEBAPIADAPTER_H
|
@ -3,6 +3,7 @@ project(localsink)
|
|||||||
set(localsink_SOURCES
|
set(localsink_SOURCES
|
||||||
localsink.cpp
|
localsink.cpp
|
||||||
localsinksettings.cpp
|
localsinksettings.cpp
|
||||||
|
localsinkwebapiadapter.cpp
|
||||||
localsinkthread.cpp
|
localsinkthread.cpp
|
||||||
localsinkplugin.cpp
|
localsinkplugin.cpp
|
||||||
)
|
)
|
||||||
@ -10,6 +11,7 @@ set(localsink_SOURCES
|
|||||||
set(localsink_HEADERS
|
set(localsink_HEADERS
|
||||||
localsink.h
|
localsink.h
|
||||||
localsinksettings.h
|
localsinksettings.h
|
||||||
|
localsinkwebapiadapter.h
|
||||||
localsinkthread.h
|
localsinkthread.h
|
||||||
localsinkplugin.h
|
localsinkplugin.h
|
||||||
)
|
)
|
||||||
|
@ -24,10 +24,12 @@
|
|||||||
#include "localsinkgui.h"
|
#include "localsinkgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "localsink.h"
|
#include "localsink.h"
|
||||||
|
#include "localsinkwebapiadapter.h"
|
||||||
|
#include "localsinkplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor LocalSinkPlugin::m_pluginDescriptor = {
|
const PluginDescriptor LocalSinkPlugin::m_pluginDescriptor = {
|
||||||
QString("Local channel sink"),
|
QString("Local channel sink"),
|
||||||
QString("4.6.0"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -76,3 +78,8 @@ ChannelAPI* LocalSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
{
|
{
|
||||||
return new LocalSink(deviceAPI);
|
return new LocalSink(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* LocalSinkPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new LocalSinkWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
51
plugins/channelrx/localsink/localsinkwebapiadapter.cpp
Normal file
51
plugins/channelrx/localsink/localsinkwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "localsink.h"
|
||||||
|
#include "localsinkwebapiadapter.h"
|
||||||
|
|
||||||
|
LocalSinkWebAPIAdapter::LocalSinkWebAPIAdapter() :
|
||||||
|
ChannelAPI(LocalSink::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
LocalSinkWebAPIAdapter::~LocalSinkWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int LocalSinkWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setLocalSinkSettings(new SWGSDRangel::SWGLocalSinkSettings());
|
||||||
|
response.getLocalSinkSettings()->init();
|
||||||
|
LocalSink::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LocalSinkWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
LocalSink::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/localsink/localsinkwebapiadapter.h
Normal file
65
plugins/channelrx/localsink/localsinkwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LOCALSINK_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_LOCALSINK_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "localsinksettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class LocalSinkWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
LocalSinkWebAPIAdapter();
|
||||||
|
virtual ~LocalSinkWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
LocalSinkSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_LOCALSINK_WEBAPIADAPTER_H
|
@ -12,6 +12,7 @@ endif()
|
|||||||
set(remotesink_SOURCES
|
set(remotesink_SOURCES
|
||||||
remotesink.cpp
|
remotesink.cpp
|
||||||
remotesinksettings.cpp
|
remotesinksettings.cpp
|
||||||
|
remotesinkwebapiadapter.cpp
|
||||||
remotesinkthread.cpp
|
remotesinkthread.cpp
|
||||||
remotesinkplugin.cpp
|
remotesinkplugin.cpp
|
||||||
)
|
)
|
||||||
@ -19,6 +20,7 @@ set(remotesink_SOURCES
|
|||||||
set(remotesink_HEADERS
|
set(remotesink_HEADERS
|
||||||
remotesink.h
|
remotesink.h
|
||||||
remotesinksettings.h
|
remotesinksettings.h
|
||||||
|
remotesinkwebapiadapter.h
|
||||||
remotesinkthread.h
|
remotesinkthread.h
|
||||||
remotesinkplugin.h
|
remotesinkplugin.h
|
||||||
)
|
)
|
||||||
|
@ -24,10 +24,12 @@
|
|||||||
#include "remotesinkgui.h"
|
#include "remotesinkgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "remotesink.h"
|
#include "remotesink.h"
|
||||||
|
#include "remotesinkwebapiadapter.h"
|
||||||
|
#include "remotesinkplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor RemoteSinkPlugin::m_pluginDescriptor = {
|
const PluginDescriptor RemoteSinkPlugin::m_pluginDescriptor = {
|
||||||
QString("Remote channel sink"),
|
QString("Remote channel sink"),
|
||||||
QString("4.5.6"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -77,6 +79,7 @@ ChannelAPI* RemoteSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new RemoteSink(deviceAPI);
|
return new RemoteSink(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* RemoteSinkPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new RemoteSinkWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
51
plugins/channelrx/remotesink/remotesinkwebapiadapter.cpp
Normal file
51
plugins/channelrx/remotesink/remotesinkwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "remotesink.h"
|
||||||
|
#include "remotesinkwebapiadapter.h"
|
||||||
|
|
||||||
|
RemoteSinkWebAPIAdapter::RemoteSinkWebAPIAdapter() :
|
||||||
|
ChannelAPI(RemoteSink::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
RemoteSinkWebAPIAdapter::~RemoteSinkWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int RemoteSinkWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setRemoteSinkSettings(new SWGSDRangel::SWGRemoteSinkSettings());
|
||||||
|
response.getRemoteSinkSettings()->init();
|
||||||
|
RemoteSink::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int RemoteSinkWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
RemoteSink::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/remotesink/remotesinkwebapiadapter.h
Normal file
65
plugins/channelrx/remotesink/remotesinkwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_REMOTESINK_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_REMOTESINK_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "remotesinksettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class RemoteSinkWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
RemoteSinkWebAPIAdapter();
|
||||||
|
virtual ~RemoteSinkWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
RemoteSinkSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_REMOTESINK_WEBAPIADAPTER_H
|
@ -4,12 +4,14 @@ set(udpsink_SOURCES
|
|||||||
udpsink.cpp
|
udpsink.cpp
|
||||||
udpsinkplugin.cpp
|
udpsinkplugin.cpp
|
||||||
udpsinksettings.cpp
|
udpsinksettings.cpp
|
||||||
|
udpsinkwebapiadapter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(udpsink_HEADERS
|
set(udpsink_HEADERS
|
||||||
udpsink.h
|
udpsink.h
|
||||||
udpsinkplugin.h
|
udpsinkplugin.h
|
||||||
udpsinksettings.h
|
udpsinksettings.h
|
||||||
|
udpsinkwebapiadapter.h
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
|
@ -23,11 +23,12 @@
|
|||||||
#include "udpsinkgui.h"
|
#include "udpsinkgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "udpsink.h"
|
#include "udpsink.h"
|
||||||
|
#include "udpsinkwebapiadapter.h"
|
||||||
#include "udpsinkplugin.h"
|
#include "udpsinkplugin.h"
|
||||||
|
|
||||||
const PluginDescriptor UDPSinkPlugin::m_pluginDescriptor = {
|
const PluginDescriptor UDPSinkPlugin::m_pluginDescriptor = {
|
||||||
QString("UDP Channel Sink"),
|
QString("UDP Channel Sink"),
|
||||||
QString("4.5.2"),
|
QString("4.11.6"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
@ -77,3 +78,7 @@ ChannelAPI* UDPSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
|
|||||||
return new UDPSink(deviceAPI);
|
return new UDPSink(deviceAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChannelAPI* UDPSinkPlugin::createChannelWebAPIAdapter() const
|
||||||
|
{
|
||||||
|
return new UDPSinkWebAPIAdapter();
|
||||||
|
}
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||||
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
|
||||||
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
|
||||||
|
virtual ChannelAPI* createChannelWebAPIAdapter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
51
plugins/channelrx/udpsink/udpsinkwebapiadapter.cpp
Normal file
51
plugins/channelrx/udpsink/udpsinkwebapiadapter.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "udpsink.h"
|
||||||
|
#include "udpsinkwebapiadapter.h"
|
||||||
|
|
||||||
|
UDPSinkWebAPIAdapter::UDPSinkWebAPIAdapter() :
|
||||||
|
ChannelAPI(UDPSink::m_channelIdURI, ChannelAPI::StreamSingleSink)
|
||||||
|
{}
|
||||||
|
|
||||||
|
UDPSinkWebAPIAdapter::~UDPSinkWebAPIAdapter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
int UDPSinkWebAPIAdapter::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
response.setUdpSinkSettings(new SWGSDRangel::SWGUDPSinkSettings());
|
||||||
|
response.getUdpSinkSettings()->init();
|
||||||
|
UDPSink::webapiFormatChannelSettings(response, m_settings);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
int UDPSinkWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage)
|
||||||
|
{
|
||||||
|
(void) errorMessage;
|
||||||
|
UDPSink::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||||
|
|
||||||
|
return 200;
|
||||||
|
}
|
65
plugins/channelrx/udpsink/udpsinkwebapiadapter.h
Normal file
65
plugins/channelrx/udpsink/udpsinkwebapiadapter.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// (at your option) any later version. //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDE_UDPSINK_WEBAPIADAPTER_H
|
||||||
|
#define INCLUDE_UDPSINK_WEBAPIADAPTER_H
|
||||||
|
|
||||||
|
#include "channel/channelapi.h"
|
||||||
|
#include "udpsinksettings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standalone API adapter only for the settings
|
||||||
|
*/
|
||||||
|
class UDPSinkWebAPIAdapter : public ChannelAPI {
|
||||||
|
public:
|
||||||
|
UDPSinkWebAPIAdapter();
|
||||||
|
virtual ~UDPSinkWebAPIAdapter();
|
||||||
|
|
||||||
|
// unused pure virtual methods
|
||||||
|
virtual void destroy() {}
|
||||||
|
virtual void getIdentifier(QString& id) {}
|
||||||
|
virtual void getTitle(QString& title) {}
|
||||||
|
virtual qint64 getCenterFrequency() const { return 0; }
|
||||||
|
virtual int getNbSinkStreams() const { return 1; }
|
||||||
|
virtual int getNbSourceStreams() const { return 0; }
|
||||||
|
|
||||||
|
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||||
|
{
|
||||||
|
(void) streamIndex;
|
||||||
|
(void) sinkElseSource;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual methods actually implemented
|
||||||
|
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||||
|
virtual bool deserialize(const QByteArray& data) { m_settings.deserialize(data); }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiSettingsPutPatch(
|
||||||
|
bool force,
|
||||||
|
const QStringList& channelSettingsKeys,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
|
private:
|
||||||
|
UDPSinkSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // INCLUDE_UDPSINK_WEBAPIADAPTER_H
|
Loading…
Reference in New Issue
Block a user