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.
webapiadaptersrv.h
Go to the documentation of this file.
1 // Copyright (C) 2017 Edouard Griffiths, F4EXB. //
3 // //
4 // Swagger server adapter interface //
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 SDRSRV_WEBAPI_WEBAPIADAPTERSRV_H_
21 #define SDRSRV_WEBAPI_WEBAPIADAPTERSRV_H_
22 
23 #include <QtGlobal>
24 
26 
27 class MainCore;
28 class DeviceSet;
29 
31 {
32 public:
33  WebAPIAdapterSrv(MainCore& mainCore);
34  virtual ~WebAPIAdapterSrv();
35 
36  virtual int instanceSummary(
39 
40  virtual int instanceDelete(
43 
44  virtual int instanceConfigGet(
47 
48  virtual int instanceDevices(
49  int direction,
52 
53  virtual int instanceChannels(
54  int direction,
57 
58  virtual int instanceLoggingGet(
61 
62  virtual int instanceLoggingPut(
66 
67  virtual int instanceAudioGet(
70 
71  virtual int instanceAudioInputPatch(
73  const QStringList& audioInputKeys,
75 
76  virtual int instanceAudioOutputPatch(
78  const QStringList& audioOutputKeys,
80 
81  virtual int instanceAudioInputDelete(
84 
85  virtual int instanceAudioOutputDelete(
88 
92 
96 
97  virtual int instanceLocationGet(
100 
101  virtual int instanceLocationPut(
104 
105  virtual int instanceDVSerialGet(
108 
109  virtual int instanceDVSerialPatch(
110  bool dvserial,
113 
114  virtual int instanceAMBESerialGet(
117 
118  virtual int instanceAMBEDevicesGet(
119  SWGSDRangel::SWGAMBEDevices& response,
121 
122  virtual int instanceAMBEDevicesPut(
124  SWGSDRangel::SWGAMBEDevices& response,
126 
127  virtual int instanceAMBEDevicesPatch(
129  SWGSDRangel::SWGAMBEDevices& response,
131 
132  virtual int instanceAMBEDevicesDelete(
135 
136  virtual int instancePresetFilePut(
140 
141  virtual int instancePresetFilePost(
145 
146  virtual int instancePresetsGet(
147  SWGSDRangel::SWGPresets& response,
149 
150  virtual int instancePresetPatch(
154 
155  virtual int instancePresetPut(
159 
160  virtual int instancePresetPost(
164 
165  virtual int instancePresetDelete(
168 
169  virtual int instanceDeviceSetsGet(
172 
173  virtual int instanceDeviceSetPost(
174  int direction,
177 
178  virtual int instanceDeviceSetDelete(
181 
182  virtual int devicesetGet(
183  int deviceSetIndex,
184  SWGSDRangel::SWGDeviceSet& response,
186 
187  virtual int devicesetFocusPatch(
188  int deviceSetIndex,
191 
192  virtual int devicesetDevicePut(
193  int deviceSetIndex,
197 
198  virtual int devicesetDeviceSettingsGet(
199  int deviceSetIndex,
202 
204  int deviceSetIndex,
205  bool force,
206  const QStringList& deviceSettingsKeys,
209 
210  virtual int devicesetDeviceRunGet(
211  int deviceSetIndex,
212  SWGSDRangel::SWGDeviceState& response,
214 
215  virtual int devicesetDeviceRunPost(
216  int deviceSetIndex,
217  SWGSDRangel::SWGDeviceState& response,
219 
220  virtual int devicesetDeviceRunDelete(
221  int deviceSetIndex,
222  SWGSDRangel::SWGDeviceState& response,
224 
225  virtual int devicesetDeviceReportGet(
226  int deviceSetIndex,
229 
230  virtual int devicesetChannelsReportGet(
231  int deviceSetIndex,
234 
235  virtual int devicesetChannelPost(
236  int deviceSetIndex,
240 
241  virtual int devicesetChannelDelete(
242  int deviceSetIndex,
243  int channelIndex,
246 
247  virtual int devicesetChannelSettingsGet(
248  int deviceSetIndex,
249  int channelIndex,
252 
254  int deviceSetIndex,
255  int channelIndex,
256  bool force,
257  const QStringList& channelSettingsKeys,
260 
261  virtual int devicesetChannelReportGet(
262  int deviceSetIndex,
263  int channelIndex,
266 
267 private:
269 
270  void getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList);
271  void getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, const DeviceSet* deviceSet, int deviceUISetIndex);
272  void getChannelsDetail(SWGSDRangel::SWGChannelsDetail *channelsDetail, const DeviceSet* deviceSet);
273  static QtMsgType getMsgTypeFromString(const QString& msgTypeString);
274  static void getMsgTypeString(const QtMsgType& msgType, QString& level);
275 };
276 
277 #endif /* SDRSRV_WEBAPI_WEBAPIADAPTERSRV_H_ */
virtual int instanceAudioInputCleanupPatch(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetFilePut(SWGSDRangel::SWGPresetImport &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetDeviceReportGet(int deviceSetIndex, SWGSDRangel::SWGDeviceReport &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceDVSerialGet(SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelReportGet(int deviceSetIndex, int channelIndex, SWGSDRangel::SWGChannelReport &response, SWGSDRangel::SWGErrorResponse &error)
virtual ~WebAPIAdapterSrv()
virtual int instanceAMBEDevicesPut(SWGSDRangel::SWGAMBEDevices &query, SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList *deviceSetList)
virtual int instanceDeviceSetDelete(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
static void getMsgTypeString(const QtMsgType &msgType, QString &level)
virtual int instanceSummary(SWGSDRangel::SWGInstanceSummaryResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetDeviceRunDelete(int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceDeviceSetsGet(SWGSDRangel::SWGDeviceSetList &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioOutputDelete(SWGSDRangel::SWGAudioOutputDevice &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceLoggingGet(SWGSDRangel::SWGLoggingInfo &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceLocationGet(SWGSDRangel::SWGLocationInformation &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAMBEDevicesGet(SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceDelete(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelSettingsGet(int deviceSetIndex, int channelIndex, SWGSDRangel::SWGChannelSettings &response, SWGSDRangel::SWGErrorResponse &error)
WebAPIAdapterSrv(MainCore &mainCore)
virtual int instanceDevices(int direction, SWGSDRangel::SWGInstanceDevicesResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetFocusPatch(int deviceSetIndex, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceConfigGet(SWGSDRangel::SWGInstanceConfigResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioOutputCleanupPatch(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAMBEDevicesDelete(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
void getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, const DeviceSet *deviceSet, int deviceUISetIndex)
virtual int devicesetDeviceSettingsGet(int deviceSetIndex, SWGSDRangel::SWGDeviceSettings &response, SWGSDRangel::SWGErrorResponse &error)
void getChannelsDetail(SWGSDRangel::SWGChannelsDetail *channelsDetail, const DeviceSet *deviceSet)
virtual int devicesetChannelDelete(int deviceSetIndex, int channelIndex, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetsGet(SWGSDRangel::SWGPresets &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioInputDelete(SWGSDRangel::SWGAudioInputDevice &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceDVSerialPatch(bool dvserial, SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAMBEDevicesPatch(SWGSDRangel::SWGAMBEDevices &query, SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetPost(SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
static QtMsgType getMsgTypeFromString(const QString &msgTypeString)
virtual int devicesetDeviceSettingsPutPatch(int deviceSetIndex, bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioGet(SWGSDRangel::SWGAudioDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetPut(SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceLoggingPut(SWGSDRangel::SWGLoggingInfo &query, SWGSDRangel::SWGLoggingInfo &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetPatch(SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceLocationPut(SWGSDRangel::SWGLocationInformation &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceDeviceSetPost(int direction, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelsReportGet(int deviceSetIndex, SWGSDRangel::SWGChannelsDetail &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetDelete(SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelSettingsPutPatch(int deviceSetIndex, int channelIndex, bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetGet(int deviceSetIndex, SWGSDRangel::SWGDeviceSet &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioInputPatch(SWGSDRangel::SWGAudioInputDevice &response, const QStringList &audioInputKeys, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelPost(int deviceSetIndex, SWGSDRangel::SWGChannelSettings &query, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetDeviceRunPost(int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceChannels(int direction, SWGSDRangel::SWGInstanceChannelsResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioOutputPatch(SWGSDRangel::SWGAudioOutputDevice &response, const QStringList &audioOutputKeys, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetFilePost(SWGSDRangel::SWGPresetExport &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAMBESerialGet(SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetDevicePut(int deviceSetIndex, SWGSDRangel::SWGDeviceListItem &query, SWGSDRangel::SWGDeviceListItem &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetDeviceRunGet(int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)