SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
channelapi.h
Go to the documentation of this file.
1 // Copyright (C) 2019 Edouard Griffiths, F4EXB //
3 // //
4 // API for Rx channels //
5 // //
6 // This program is free software; you can redistribute it and/or modify //
7 // it under the terms of the GNU General Public License as published by //
8 // the Free Software Foundation as version 3 of the License, or //
9 // (at your option) any later version. //
10 // //
11 // This program is distributed in the hope that it will be useful, //
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14 // GNU General Public License V3 for more details. //
15 // //
16 // You should have received a copy of the GNU General Public License //
17 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
19 
20 #ifndef SDRBASE_CHANNEL_CHANNELAPI_H_
21 #define SDRBASE_CHANNEL_CHANNELAPI_H_
22 
23 #include <QString>
24 #include <QByteArray>
25 #include <stdint.h>
26 
27 #include "export.h"
28 
29 class DeviceAPI;
30 
31 namespace SWGSDRangel
32 {
33  class SWGChannelSettings;
34  class SWGChannelReport;
35 }
36 
38 public:
39  enum StreamType
40  {
43  StreamMIMO
44  };
45 
46  ChannelAPI(const QString& name, StreamType streamType);
47  virtual ~ChannelAPI() {}
48  virtual void destroy() = 0;
49 
50  virtual void getIdentifier(QString& id) = 0;
51  virtual void getTitle(QString& title) = 0;
52  virtual void setName(const QString& name) { m_name = name; }
53  virtual const QString& getName() const { return m_name; }
54  virtual qint64 getCenterFrequency() const = 0;
55 
56  virtual QByteArray serialize() const = 0;
57  virtual bool deserialize(const QByteArray& data) = 0;
58 
59  virtual int webapiSettingsGet(
61  QString& errorMessage)
62  {
63  (void) response;
64  errorMessage = "Not implemented"; return 501;
65  }
66 
68  bool force,
69  const QStringList& channelSettingsKeys,
71  QString& errorMessage)
72  {
73  (void) force;
74  (void) channelSettingsKeys;
75  (void) response;
76  errorMessage = "Not implemented"; return 501;
77  }
78 
79  virtual int webapiReportGet(
81  QString& errorMessage)
82  {
83  (void) response;
84  errorMessage = "Not implemented"; return 501;
85  }
86 
87  int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
88  void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
89  int getDeviceSetIndex() const { return m_deviceSetIndex; }
90  void setDeviceSetIndex(int deviceSetIndex) { m_deviceSetIndex = deviceSetIndex; }
91  DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
92  void setDeviceAPI(DeviceAPI *deviceAPI) { m_deviceAPI = deviceAPI; }
93  uint64_t getUID() const { return m_uid; }
94 
95  // MIMO support
96  StreamType getStreamType() const { return m_streamType; }
97  virtual int getNbSinkStreams() const = 0;
98  virtual int getNbSourceStreams() const = 0;
99  virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const = 0;
100 
101 
102 private:
107  QString m_name;
108 
113 };
114 
115 
116 #endif // SDRBASE_CHANNEL_CHANNELAPI_H_
virtual int webapiSettingsGet(SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
Definition: channelapi.h:59
virtual const QString & getName() const
Definition: channelapi.h:53
int getDeviceSetIndex() const
Definition: channelapi.h:89
Exposes a single source stream (output, Tx)
Definition: channelapi.h:42
virtual int webapiReportGet(SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
Definition: channelapi.h:79
StreamType m_streamType
Definition: channelapi.h:103
int m_deviceSetIndex
Definition: channelapi.h:110
virtual ~ChannelAPI()
Definition: channelapi.h:47
void setIndexInDeviceSet(int indexInDeviceSet)
Definition: channelapi.h:88
uint64_t getUID() const
Definition: channelapi.h:93
void setDeviceAPI(DeviceAPI *deviceAPI)
Definition: channelapi.h:92
DeviceAPI * m_deviceAPI
Definition: channelapi.h:111
int m_indexInDeviceSet
Definition: channelapi.h:109
StreamType
< This is the same enum as in PluginInterface
Definition: channelapi.h:39
virtual int webapiSettingsPutPatch(bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
Definition: channelapi.h:67
virtual void setName(const QString &name)
Definition: channelapi.h:52
StreamType getStreamType() const
Definition: channelapi.h:96
Exposes a single sink stream (input, Rx)
Definition: channelapi.h:41
DeviceAPI * getDeviceAPI()
Definition: channelapi.h:91
uint64_t m_uid
Definition: channelapi.h:112
#define SDRBASE_API
Definition: export.h:40
int getIndexInDeviceSet() const
Definition: channelapi.h:87
void setDeviceSetIndex(int deviceSetIndex)
Definition: channelapi.h:90
QString m_name
Definition: channelapi.h:107
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48