2017-12-17 05:09:51 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
|
|
|
|
// //
|
|
|
|
// Swagger server adapter interface //
|
|
|
|
// //
|
|
|
|
// 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 //
|
|
|
|
// //
|
|
|
|
// 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 SDRSRV_WEBAPI_WEBAPIADAPTERSRV_H_
|
|
|
|
#define SDRSRV_WEBAPI_WEBAPIADAPTERSRV_H_
|
|
|
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
#include "webapi/webapiadapterinterface.h"
|
|
|
|
|
|
|
|
class MainCore;
|
2017-12-17 17:15:42 -05:00
|
|
|
class DeviceSet;
|
2017-12-17 05:09:51 -05:00
|
|
|
|
|
|
|
class WebAPIAdapterSrv: public WebAPIAdapterInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WebAPIAdapterSrv(MainCore& mainCore);
|
|
|
|
virtual ~WebAPIAdapterSrv();
|
|
|
|
|
2017-12-17 17:15:42 -05:00
|
|
|
virtual int instanceSummary(
|
|
|
|
SWGSDRangel::SWGInstanceSummaryResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int instanceDelete(
|
2017-12-21 12:10:43 -05:00
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
2017-12-17 17:15:42 -05:00
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 07:31:53 -05:00
|
|
|
virtual int instanceDevices(
|
|
|
|
bool tx,
|
|
|
|
SWGSDRangel::SWGInstanceDevicesResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 07:36:27 -05:00
|
|
|
virtual int instanceChannels(
|
|
|
|
bool tx,
|
|
|
|
SWGSDRangel::SWGInstanceChannelsResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 07:39:31 -05:00
|
|
|
virtual int instanceLoggingGet(
|
|
|
|
SWGSDRangel::SWGLoggingInfo& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 08:50:58 -05:00
|
|
|
virtual int instanceLoggingPut(
|
|
|
|
SWGSDRangel::SWGLoggingInfo& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 16:05:43 -05:00
|
|
|
virtual int instanceAudioGet(
|
|
|
|
SWGSDRangel::SWGAudioDevices& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int instanceAudioPatch(
|
|
|
|
SWGSDRangel::SWGAudioDevicesSelect& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 16:35:48 -05:00
|
|
|
virtual int instanceLocationGet(
|
|
|
|
SWGSDRangel::SWGLocationInformation& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int instanceLocationPut(
|
|
|
|
SWGSDRangel::SWGLocationInformation& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 16:39:32 -05:00
|
|
|
virtual int instanceDVSerialPatch(
|
|
|
|
bool dvserial,
|
|
|
|
SWGSDRangel::SWGDVSeralDevices& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-18 19:11:34 -05:00
|
|
|
virtual int instancePresetFilePut(
|
|
|
|
SWGSDRangel::SWGPresetImport& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int instancePresetFilePost(
|
|
|
|
SWGSDRangel::SWGPresetExport& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-20 18:50:58 -05:00
|
|
|
virtual int instancePresetsGet(
|
2017-12-18 19:11:34 -05:00
|
|
|
SWGSDRangel::SWGPresets& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-20 08:31:17 -05:00
|
|
|
virtual int instancePresetPatch(
|
|
|
|
SWGSDRangel::SWGPresetTransfer& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-20 17:57:06 -05:00
|
|
|
virtual int instancePresetPut(
|
|
|
|
SWGSDRangel::SWGPresetTransfer& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-20 18:23:36 -05:00
|
|
|
virtual int instancePresetPost(
|
|
|
|
SWGSDRangel::SWGPresetTransfer& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-20 18:39:57 -05:00
|
|
|
virtual int instancePresetDelete(
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int instanceDeviceSetsGet(
|
|
|
|
SWGSDRangel::SWGDeviceSetList& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-21 19:07:03 -05:00
|
|
|
virtual int instanceDeviceSetPost(
|
2017-12-19 19:01:53 -05:00
|
|
|
bool tx,
|
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-21 19:07:03 -05:00
|
|
|
virtual int instanceDeviceSetDelete(
|
2017-12-19 19:01:53 -05:00
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-21 18:07:59 -05:00
|
|
|
virtual int devicesetGet(
|
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGDeviceSet& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int devicesetDevicePut(
|
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGDeviceListItem& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-22 10:41:37 -05:00
|
|
|
virtual int devicesetDeviceSettingsGet(
|
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGDeviceSettings& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int devicesetDeviceSettingsPutPatch(
|
|
|
|
int deviceSetIndex,
|
|
|
|
bool force,
|
|
|
|
SWGSDRangel::SWGDeviceSettings& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-22 12:19:49 -05:00
|
|
|
virtual int devicesetChannelPost(
|
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGChannelSettings& query,
|
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-23 16:33:30 -05:00
|
|
|
virtual int devicesetChannelDelete(
|
|
|
|
int deviceSetIndex,
|
|
|
|
int channelIndex,
|
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-17 05:09:51 -05:00
|
|
|
private:
|
|
|
|
MainCore& m_mainCore;
|
2017-12-17 17:15:42 -05:00
|
|
|
|
|
|
|
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList);
|
|
|
|
void getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, const DeviceSet* deviceSet, int deviceUISetIndex);
|
2017-12-18 08:50:58 -05:00
|
|
|
static QtMsgType getMsgTypeFromString(const QString& msgTypeString);
|
|
|
|
static void getMsgTypeString(const QtMsgType& msgType, QString& level);
|
2017-12-17 05:09:51 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* SDRSRV_WEBAPI_WEBAPIADAPTERSRV_H_ */
|