REST API: config (7): preset channel Tx adapters where there is no CW keyer

pull/422/head
f4exb 2019-08-02 13:14:59 +02:00
rodzic c7d05aeaff
commit 9610a6b93a
25 zmienionych plików z 638 dodań i 22 usunięć

Wyświetl plik

@ -12,13 +12,15 @@ endif()
set(filesource_SOURCES
filesource.cpp
filesourceplugin.cpp
filesourcesettings.cpp
filesourcesettings.cpp
filesourcewebapiadapter.cpp
)
set(filesource_HEADERS
filesource.h
filesourceplugin.h
filesourcesettings.h
filesourcesettings.h
filesourcewebapiadapter.h
)
include_directories(

Wyświetl plik

@ -22,11 +22,12 @@
#include "filesourcegui.h"
#endif
#include "filesource.h"
#include "filesourcewebapiadapter.h"
#include "filesourceplugin.h"
const PluginDescriptor FileSourcePlugin::m_pluginDescriptor = {
QString("File channel source"),
QString("4.11.0"),
QString("4.11.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
@ -76,5 +77,7 @@ ChannelAPI* FileSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI) const
return new FileSource(deviceAPI);
}
ChannelAPI* FileSourcePlugin::createChannelWebAPIAdapter() const
{
return new FileSourceWebAPIAdapter();
}

Wyświetl plik

@ -38,6 +38,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) const;
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createChannelWebAPIAdapter() const;
private:
static const PluginDescriptor m_pluginDescriptor;

Wyświetl plik

@ -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 "filesource.h"
#include "filesourcewebapiadapter.h"
FileSourceWebAPIAdapter::FileSourceWebAPIAdapter() :
ChannelAPI(FileSource::m_channelIdURI, ChannelAPI::StreamSingleSource)
{}
FileSourceWebAPIAdapter::~FileSourceWebAPIAdapter()
{}
int FileSourceWebAPIAdapter::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
response.setFileSourceSettings(new SWGSDRangel::SWGFileSourceSettings());
response.getFileSourceSettings()->init();
FileSource::webapiFormatChannelSettings(response, m_settings);
return 200;
}
int FileSourceWebAPIAdapter::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
FileSource::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
return 200;
}

Wyświetl plik

@ -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_FILESOURCE_WEBAPIADAPTER_H
#define INCLUDE_FILESOURCE_WEBAPIADAPTER_H
#include "channel/channelapi.h"
#include "filesourcesettings.h"
/**
* Standalone API adapter only for the settings
*/
class FileSourceWebAPIAdapter : public ChannelAPI {
public:
FileSourceWebAPIAdapter();
virtual ~FileSourceWebAPIAdapter();
// 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:
FileSourceSettings m_settings;
};
#endif // INCLUDE_FILESOURCE_WEBAPIADAPTER_H

Wyświetl plik

@ -4,14 +4,16 @@ set(localsource_SOURCES
localsource.cpp
localsourcethread.cpp
localsourceplugin.cpp
localsourcesettings.cpp
localsourcesettings.cpp
localsourcewebapiadapter.cpp
)
set(localsource_HEADERS
localsource.h
localsourcethread.h
localsourceplugin.h
localsourcesettings.h
localsourcesettings.h
localsourcewebapiadapter.h
)
include_directories(

Wyświetl plik

@ -24,10 +24,12 @@
#include "localsourcegui.h"
#endif
#include "localsource.h"
#include "localsourcewebapiadapter.h"
#include "localsourceplugin.h"
const PluginDescriptor LocalSourcePlugin::m_pluginDescriptor = {
QString("Local channel source"),
QString("4.8.0"),
QString("4.11.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
@ -76,3 +78,8 @@ ChannelAPI* LocalSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI) const
{
return new LocalSource(deviceAPI);
}
ChannelAPI* LocalSourcePlugin::createChannelWebAPIAdapter() const
{
return new LocalSourceWebAPIAdapter();
}

Wyświetl plik

@ -39,6 +39,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) const;
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createChannelWebAPIAdapter() const;
private:
static const PluginDescriptor m_pluginDescriptor;

Wyświetl plik

@ -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 "localsource.h"
#include "localsourcewebapiadapter.h"
LocalSourceWebAPIAdapter::LocalSourceWebAPIAdapter() :
ChannelAPI(LocalSource::m_channelIdURI, ChannelAPI::StreamSingleSource)
{}
LocalSourceWebAPIAdapter::~LocalSourceWebAPIAdapter()
{}
int LocalSourceWebAPIAdapter::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
response.setLocalSourceSettings(new SWGSDRangel::SWGLocalSourceSettings());
response.getLocalSourceSettings()->init();
LocalSource::webapiFormatChannelSettings(response, m_settings);
return 200;
}
int LocalSourceWebAPIAdapter::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
LocalSource::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
return 200;
}

Wyświetl plik

@ -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_LOCALSOURCE_WEBAPIADAPTER_H
#define INCLUDE_LOCALSOURCE_WEBAPIADAPTER_H
#include "channel/channelapi.h"
#include "localsourcesettings.h"
/**
* Standalone API adapter only for the settings
*/
class LocalSourceWebAPIAdapter : public ChannelAPI {
public:
LocalSourceWebAPIAdapter();
virtual ~LocalSourceWebAPIAdapter();
// 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:
LocalSourceSettings m_settings;
};
#endif // INCLUDE_LOCALSOURCE_WEBAPIADAPTER_H

Wyświetl plik

@ -3,13 +3,15 @@ project(modatv)
set(modatv_SOURCES
atvmod.cpp
atvmodplugin.cpp
atvmodsettings.cpp
atvmodsettings.cpp
atvmodwebapiadapter.cpp
)
set(modatv_HEADERS
atvmod.h
atvmodplugin.h
atvmodsettings.h
atvmodsettings.h
atvmodwebapiadapter.h
)
include_directories(

Wyświetl plik

@ -22,11 +22,12 @@
#include "atvmodgui.h"
#endif
#include "atvmod.h"
#include "atvmodwebapiadapter.h"
#include "atvmodplugin.h"
const PluginDescriptor ATVModPlugin::m_pluginDescriptor = {
QString("ATV Modulator"),
QString("4.5.2"),
QString("4.11.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
@ -76,5 +77,7 @@ ChannelAPI* ATVModPlugin::createTxChannelCS(DeviceAPI *deviceAPI) const
return new ATVMod(deviceAPI);
}
ChannelAPI* ATVModPlugin::createChannelWebAPIAdapter() const
{
return new ATVModWebAPIAdapter();
}

Wyświetl plik

@ -38,6 +38,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) const;
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createChannelWebAPIAdapter() const;
private:
static const PluginDescriptor m_pluginDescriptor;

Wyświetl plik

@ -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 "atvmod.h"
#include "atvmodwebapiadapter.h"
ATVModWebAPIAdapter::ATVModWebAPIAdapter() :
ChannelAPI(ATVMod::m_channelIdURI, ChannelAPI::StreamSingleSource)
{}
ATVModWebAPIAdapter::~ATVModWebAPIAdapter()
{}
int ATVModWebAPIAdapter::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
response.setAtvModSettings(new SWGSDRangel::SWGATVModSettings());
response.getAtvModSettings()->init();
ATVMod::webapiFormatChannelSettings(response, m_settings);
return 200;
}
int ATVModWebAPIAdapter::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
ATVMod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
return 200;
}

Wyświetl plik

@ -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_ATVMOD_WEBAPIADAPTER_H
#define INCLUDE_ATVMOD_WEBAPIADAPTER_H
#include "channel/channelapi.h"
#include "atvmodsettings.h"
/**
* Standalone API adapter only for the settings
*/
class ATVModWebAPIAdapter : public ChannelAPI {
public:
ATVModWebAPIAdapter();
virtual ~ATVModWebAPIAdapter();
// 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:
ATVModSettings m_settings;
};
#endif // INCLUDE_ATVMOD_WEBAPIADAPTER_H

Wyświetl plik

@ -13,14 +13,16 @@ set(remotesource_SOURCES
remotesource.cpp
remotesourcethread.cpp
remotesourceplugin.cpp
remotesourcesettings.cpp
remotesourcesettings.cpp
remotesourcewebapiadapter.cpp
)
set(remotesource_HEADERS
remotesource.h
remotesourcethread.h
remotesourceplugin.h
remotesourcesettings.h
remotesourcesettings.h
remotesourcewebapiadapter.cpp
)
include_directories(

Wyświetl plik

@ -22,11 +22,12 @@
#include "remotesourcegui.h"
#endif
#include "remotesource.h"
#include "remotesourcewebapiadapter.h"
#include "remotesourceplugin.h"
const PluginDescriptor RemoteSourcePlugin::m_pluginDescriptor = {
QString("Remote channel source"),
QString("4.5.2"),
QString("4.11.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
@ -76,5 +77,7 @@ ChannelAPI* RemoteSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI) const
return new RemoteSource(deviceAPI);
}
ChannelAPI* RemoteSourcePlugin::createChannelWebAPIAdapter() const
{
return new RemoteSourceWebAPIAdapter();
}

Wyświetl plik

@ -38,6 +38,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) const;
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createChannelWebAPIAdapter() const;
private:
static const PluginDescriptor m_pluginDescriptor;

Wyświetl plik

@ -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 "remotesource.h"
#include "remotesourcewebapiadapter.h"
RemoteSourceWebAPIAdapter::RemoteSourceWebAPIAdapter() :
ChannelAPI(RemoteSource::m_channelIdURI, ChannelAPI::StreamSingleSource)
{}
RemoteSourceWebAPIAdapter::~RemoteSourceWebAPIAdapter()
{}
int RemoteSourceWebAPIAdapter::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
response.setRemoteSourceSettings(new SWGSDRangel::SWGRemoteSourceSettings());
response.getRemoteSourceSettings()->init();
RemoteSource::webapiFormatChannelSettings(response, m_settings);
return 200;
}
int RemoteSourceWebAPIAdapter::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
RemoteSource::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
return 200;
}

Wyświetl plik

@ -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_REMOTESOURCE_WEBAPIADAPTER_H
#define INCLUDE_REMOTESOURCE_WEBAPIADAPTER_H
#include "channel/channelapi.h"
#include "remotesourcesettings.h"
/**
* Standalone API adapter only for the settings
*/
class RemoteSourceWebAPIAdapter : public ChannelAPI {
public:
RemoteSourceWebAPIAdapter();
virtual ~RemoteSourceWebAPIAdapter();
// 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:
RemoteSourceSettings m_settings;
};
#endif // INCLUDE_REMOTESOURCE_WEBAPIADAPTER_H

Wyświetl plik

@ -5,7 +5,8 @@ set(udpsource_SOURCES
udpsourceplugin.cpp
udpsourceudphandler.cpp
udpsourcemsg.cpp
udpsourcesettings.cpp
udpsourcesettings.cpp
udpsourcewebapiadapter.cpp
)
set(udpsource_HEADERS
@ -13,7 +14,8 @@ set(udpsource_HEADERS
udpsourceplugin.h
udpsourceudphandler.h
udpsourcemsg.h
udpsourcesettings.h
udpsourcesettings.h
udpsourcewebapiadapter.h
)
include_directories(

Wyświetl plik

@ -25,10 +25,12 @@
#include "udpsourcegui.h"
#endif
#include "udpsource.h"
#include "udpsourcewebapiadapter.h"
#include "udpsourceplugin.h"
const PluginDescriptor UDPSourcePlugin::m_pluginDescriptor = {
QString("UDP Channel Source"),
QString("4.5.2"),
QString("4.11.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
@ -78,4 +80,7 @@ ChannelAPI* UDPSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI) const
return new UDPSource(deviceAPI);
}
ChannelAPI* UDPSourcePlugin::createChannelWebAPIAdapter() const
{
return new UDPSourceWebAPIAdapter();
}

Wyświetl plik

@ -39,6 +39,7 @@ public:
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) const;
virtual BasebandSampleSource* createTxChannelBS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createTxChannelCS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createChannelWebAPIAdapter() const;
private:
static const PluginDescriptor m_pluginDescriptor;

Wyświetl plik

@ -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 "udpsource.h"
#include "udpsourcewebapiadapter.h"
UDPSourceWebAPIAdapter::UDPSourceWebAPIAdapter() :
ChannelAPI(UDPSource::m_channelIdURI, ChannelAPI::StreamSingleSource)
{}
UDPSourceWebAPIAdapter::~UDPSourceWebAPIAdapter()
{}
int UDPSourceWebAPIAdapter::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
response.setUdpSourceSettings(new SWGSDRangel::SWGUDPSourceSettings());
response.getUdpSourceSettings()->init();
UDPSource::webapiFormatChannelSettings(response, m_settings);
return 200;
}
int UDPSourceWebAPIAdapter::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
UDPSource::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
return 200;
}

Wyświetl plik

@ -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_UDPSOURCE_WEBAPIADAPTER_H
#define INCLUDE_UDPSOURCE_WEBAPIADAPTER_H
#include "channel/channelapi.h"
#include "udpsourcesettings.h"
/**
* Standalone API adapter only for the settings
*/
class UDPSourceWebAPIAdapter : public ChannelAPI {
public:
UDPSourceWebAPIAdapter();
virtual ~UDPSourceWebAPIAdapter();
// 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:
UDPSourceSettings m_settings;
};
#endif // INCLUDE_UDPSOURCE_WEBAPIADAPTER_H