Lovense Integration: LovenseIntegration/Source/LovenseIntegration/Classes/Adapters/LovenseRemoteAdapterBase.h Source File

Lovense Integration

LovenseRemoteAdapterBase.h
1 // (CVN) - Candy Valley Network GmbH
2
3 #pragma once
4
5 #include <CoreMinimal.h>
6
7 // EXTERNAL INCLUDES
8
9 // INTERNAL INCLUDES
10 #include "Adapters/ILovenseAdapter.h"
11
12
16 class LovenseRemoteAdapterBase : public ILovenseAdapter {
17 public:
18 LovenseRemoteAdapterBase();
19
20 #if WITH_LOVENSE
21 virtual bool SendCommand_Test(const FString& toyId) override;
22 virtual bool SendCommand_Stop(const FString& parameters, const FString& toyId) override;
23 virtual bool SendCommand_Vibrate(const FString& parameters, const FString& toyId, uint8 vibrationSpeed) override { return true; }
24 virtual bool SendCommand_Vibrate1(const FString& parameters, const FString& toyId, uint8 vibrationSpeed) override { return true; }
25 virtual bool SendCommand_Vibrate2(const FString& parameters, const FString& toyId, uint8 vibrationSpeed) override { return true; }
26 virtual bool SendCommand_Rotate(const FString& parameters, const FString& toyId, uint8 rotationSpeed) override { return true; }
27 virtual bool SendCommand_RotateAntiClockwise(const FString& parameters, const FString& toyId, uint8 rotationSpeed) override { return true; }
28 virtual bool SendCommand_RotateClockwise(const FString& parameters, const FString& toyId, uint8 rotationSpeed) override { return true; }
29 virtual bool SendCommand_RotateChange(const FString& parameters, const FString& toyId) override { return true; }
30 virtual bool SendCommand_AirAuto(const FString& parameters, const FString& toyId, uint8 pulseSpeed) override { return true; }
31 virtual bool SendCommand_AirIn(const FString& parameters, const FString& toyId) override { return true; }
32 virtual bool SendCommand_AirOut(const FString& parameters, const FString& toyId) override { return true; }
33 virtual bool SendCommand_Thrust(const FString& parameters, const FString& toyId, uint8 thrustingSpeed) override { return true; }
34 virtual bool SendCommand_Suck(const FString& parameters, const FString& toyId, uint8 suctionSpeed) override { return true; }
35 virtual bool SendCommand_Finger(const FString& parameters, const FString& toyId, uint8 fingeringSpeed) override { return true; }
36 virtual bool SendCommand_Preset(const FString& parameters, const FString& toyId, uint8 pattern) override { return true; }
37 virtual bool SendCommand_Battery(const FString& parameters, const FString& toyId, FOnLovenseResponse callback) override;
38 virtual bool SendCommand_AVibrate(const FString& parameters, const FString& toyId, uint8 vibrationSpeed, int32 time) override;
39 virtual bool SendCommand_AVibrate1(const FString& parameters, const FString& toyId, uint8 vibrationSpeed, int32 time) override { return true; }
40 virtual bool SendCommand_AVibrate2(const FString& parameters, const FString& toyId, uint8 vibrationSpeed, int32 time) override { return true; }
41 virtual bool SendCommand_ARotate(const FString& parameters, const FString& toyId, uint8 rotationSpeed, int32 time) override;
42 virtual bool SendCommand_AAirLevel(const FString& parameters, const FString& toyId, uint8 pulseSpeed, int32 time) override;
43 virtual bool SendCommand_AThrust(const FString& parameters, const FString& toyId, uint8 thrustingSpeed, int32 time) override;
44 virtual bool SendCommand_ASuck(const FString& parameters, const FString& toyId, uint8 suctionSpeed, int32 time) override;
45 virtual bool SendCommand_AFinger(const FString& parameters, const FString& toyId, uint8 fingeringSpeed, int32 time) override;
46 virtual bool SendCommand_APreset(const FString& parameters, const FString& toyId, const FString& patternName, int32 time) override;
47 virtual bool SendCommand_AVibRotate(const FString& parameters, const FString& toyId, uint8 vibrationSpeed, uint8 rotationSpeed, int32 time) override;
48 virtual bool SendCommand_AVibAir(const FString& parameters, const FString& toyId, uint8 vibrationSpeed, uint8 pulseSpeed, int32 time) override;
49 virtual bool SendCommand_AVibRotateAir(const FString& parameters, const FString& toyId, uint8 vibrationSpeed, uint8 rotationSpeed, uint8 pulseSpeed, int32 time) override;
50 virtual bool SendCommand_AAll(const FString& parameters, const FString& toyId, uint8 vibrationSpeed, uint8 rotationSpeed, uint8 pulseSpeed, uint8 thrustingSpeed, uint8 fingeringSpeed, uint8 suctionSpeed, int32 time) override;
51 virtual bool SendCommand_Pattern(const FString& parameters, const FString& toyId, FLovensePattern& pattern) override;
52 #endif
53
54 protected:
55 virtual FHttpRequestPtr CreateHTTPRequest_GetToys() override;
56 virtual FHttpRequestPtr CreateHTTPRequest_SendCommand(const FString& command) override;
57
58 virtual void GetToysDataJsonObject(TSharedPtr<class FJsonObject> jsonObject, TSharedPtr<class FJsonObject>& outToysJsonObject) override;
59 virtual void ParseToyDescription(FLovenseToyDescription& toyDescription, TSharedPtr<class FJsonObject> toyObject) override;
60 };
ILovenseAdapter::SendCommand_Pattern
virtual bool SendCommand_Pattern(const FString &parameters, const FString &toyId, FLovensePattern &pattern)
See FLovenseManager::SendCommand_Pattern() for information on this command.
Definition: ILovenseAdapter.h:290
ILovenseAdapter::SendCommand_AVibrate1
virtual bool SendCommand_AVibrate1(const FString &parameters, const FString &toyId, uint8 vibrationSpeed, int32 time)
See FLovenseManager::SendCommand_AVibrate1() for information on this command.
Definition: ILovenseAdapter.h:186
LovenseRemoteAdapterBase::CreateHTTPRequest_SendCommand
virtual FHttpRequestPtr CreateHTTPRequest_SendCommand(const FString &command) override
Create HTTP request to send a command. Each API+Platform combination requires different HTTP reques...
Definition: LovenseRemoteAdapterBase.cpp:219
ILovenseAdapter::SendCommand_Finger
virtual bool SendCommand_Finger(const FString &parameters, const FString &toyId, uint8 fingeringSpeed)
See FLovenseManager::SendCommand_Vibrate() for information on this command.
Definition: ILovenseAdapter.h:157
ILovenseAdapter::SendCommand_AVibrate
virtual bool SendCommand_AVibrate(const FString &parameters, const FString &toyId, uint8 vibrationSpeed, int32 time)
See FLovenseManager::SendCommand_AVibrate() for information on this command.
Definition: ILovenseAdapter.h:178
LovenseRemoteAdapterBase::CreateHTTPRequest_GetToys
virtual FHttpRequestPtr CreateHTTPRequest_GetToys() override
Create HTTP request to poll for toy info. Each API+Platform combination requires different HTTP req...
Definition: LovenseRemoteAdapterBase.cpp:208
ILovenseAdapter::SendCommand_Vibrate2
virtual bool SendCommand_Vibrate2(const FString &parameters, const FString &toyId, uint8 vibrationSpeed)
See FLovenseManager::SendCommand_Vibrate2() for information on this command.
Definition: ILovenseAdapter.h:90
ILovenseAdapter::SendCommand_AVibrate2
virtual bool SendCommand_AVibrate2(const FString &parameters, const FString &toyId, uint8 vibrationSpeed, int32 time)
See FLovenseManager::SendCommand_AVibrate2() for information on this command.
Definition: ILovenseAdapter.h:194
ILovenseAdapter::SendCommand_AThrust
virtual bool SendCommand_AThrust(const FString &parameters, const FString &toyId, uint8 thrustingSpeed, int32 time)
See FLovenseManager::SendCommand_AThrust() for information on this command.
Definition: ILovenseAdapter.h:218
ILovenseAdapter::SendCommand_RotateAntiClockwise
virtual bool SendCommand_RotateAntiClockwise(const FString &parameters, const FString &toyId, uint8 rotationSpeed)
See FLovenseManager::SendCommand_RotateAntiClockwise() for information on this command.
Definition: ILovenseAdapter.h:104
ILovenseAdapter::SendCommand_Stop
virtual bool SendCommand_Stop(const FString &parameters, const FString &toyId)
See FLovenseManager::SendCommand_Stop() for information on this command.
Definition: ILovenseAdapter.cpp:300
ILovenseAdapter::SendCommand_AAirLevel
virtual bool SendCommand_AAirLevel(const FString &parameters, const FString &toyId, uint8 pulseSpeed, int32 time)
See FLovenseManager::SendCommand_AAirLevel() for information on this command.
Definition: ILovenseAdapter.h:210
ILovenseAdapter::SendCommand_AirAuto
virtual bool SendCommand_AirAuto(const FString &parameters, const FString &toyId, uint8 pulseSpeed)
See FLovenseManager::SendCommand_AirAuto() for information on this command.
Definition: ILovenseAdapter.h:124
ILovenseAdapter::SendCommand_Rotate
virtual bool SendCommand_Rotate(const FString &parameters, const FString &toyId, uint8 rotationSpeed)
See FLovenseManager::SendCommand_Rotate() for information on this command.
Definition: ILovenseAdapter.h:97
ILovenseAdapter::SendCommand_AAll
virtual bool SendCommand_AAll(const FString &parameters, const FString &toyId, uint8 vibrationSpeed, uint8 rotationSpeed, uint8 pulseSpeed, uint8 thrustingSpeed, uint8 fingeringSpeed, uint8 suctionSpeed, int32 time)
See FLovenseManager::SendCommand_AAll() for information on this command.
Definition: ILovenseAdapter.h:283
ILovenseAdapter::SendCommand_Suck
virtual bool SendCommand_Suck(const FString &parameters, const FString &toyId, uint8 suctionSpeed)
See FLovenseManager::SendCommand_Vibrate() for information on this command.
Definition: ILovenseAdapter.h:150
ILovenseAdapter::SendCommand_Vibrate
virtual bool SendCommand_Vibrate(const FString &parameters, const FString &toyId, uint8 vibrationSpeed)
See FLovenseManager::SendCommand_Vibrate() for information on this command.
Definition: ILovenseAdapter.h:76
ILovenseAdapter::SendCommand_AFinger
virtual bool SendCommand_AFinger(const FString &parameters, const FString &toyId, uint8 fingeringSpeed, int32 time)
See FLovenseManager::SendCommand_AFinger() for information on this command.
Definition: ILovenseAdapter.h:234
ILovenseAdapter::SendCommand_AVibAir
virtual bool SendCommand_AVibAir(const FString &parameters, const FString &toyId, uint8 vibrationSpeed, uint8 pulseSpeed, int32 time)
See FLovenseManager::SendCommand_AVibAir() for information on this command.
Definition: ILovenseAdapter.h:260
ILovenseAdapter::SendCommand_Battery
virtual bool SendCommand_Battery(const FString &parameters, const FString &toyId, FOnLovenseResponse callback)
See FLovenseManager::SendCommand_Battery() for information on this command.
Definition: ILovenseAdapter.h:170
ILovenseAdapter::SendCommand_AirOut
virtual bool SendCommand_AirOut(const FString &parameters, const FString &toyId)
See FLovenseManager::SendCommand_AirOut() for information on this command.
Definition: ILovenseAdapter.h:136
LovenseRemoteAdapterBase::GetToysDataJsonObject
virtual void GetToysDataJsonObject(TSharedPtr< class FJsonObject > jsonObject, TSharedPtr< class FJsonObject > &outToysJsonObject) override
Retrieve a json object holding an array of toys. The json structure is different between the API's,...
Definition: LovenseRemoteAdapterBase.cpp:230
ILovenseAdapter::SendCommand_ARotate
virtual bool SendCommand_ARotate(const FString &parameters, const FString &toyId, uint8 rotationSpeed, int32 time)
See FLovenseManager::SendCommand_ARotate() for information on this command.
Definition: ILovenseAdapter.h:202
ILovenseAdapter::SendCommand_Vibrate1
virtual bool SendCommand_Vibrate1(const FString &parameters, const FString &toyId, uint8 vibrationSpeed)
See FLovenseManager::SendCommand_Vibrate1() for information on this command.
Definition: ILovenseAdapter.h:83
ILovenseAdapter::SendCommand_RotateChange
virtual bool SendCommand_RotateChange(const FString &parameters, const FString &toyId)
See FLovenseManager::SendCommand_RotateChange() for information on this command.
Definition: ILovenseAdapter.h:117
ILovenseAdapter::SendCommand_RotateClockwise
virtual bool SendCommand_RotateClockwise(const FString &parameters, const FString &toyId, uint8 rotationSpeed)
See FLovenseManager::SendCommand_RotateClockwise() for information on this command.
Definition: ILovenseAdapter.h:111
ILovenseAdapter::SendCommand_AVibRotate
virtual bool SendCommand_AVibRotate(const FString &parameters, const FString &toyId, uint8 vibrationSpeed, uint8 rotationSpeed, int32 time)
See FLovenseManager::SendCommand_AVibRotate() for information on this command.
Definition: ILovenseAdapter.h:251
FLovensePattern
Structure holding all necessary information for a pattern command.
Definition: LovenseTypes.h:403
ILovenseAdapter::SendCommand_Thrust
virtual bool SendCommand_Thrust(const FString &parameters, const FString &toyId, uint8 thrustingSpeed)
See FLovenseManager::SendCommand_Vibrate() for information on this command.
Definition: ILovenseAdapter.h:143
ILovenseAdapter
Abstract base class for Lovense adapters. These adapters handle the communication with the Lovense ...
Definition: ILovenseAdapter.h:20
ILovenseAdapter::SendCommand_APreset
virtual bool SendCommand_APreset(const FString &parameters, const FString &toyId, const FString &patternName, int32 time)
See FLovenseManager::SendCommand_APreset() for information on this command.
Definition: ILovenseAdapter.h:242
FLovenseToyDescription
Container holding (mostly) raw HTTP request json data for a Lovense Toy instance.
Definition: LovenseTypes.h:192
ILovenseAdapter::SendCommand_ASuck
virtual bool SendCommand_ASuck(const FString &parameters, const FString &toyId, uint8 suctionSpeed, int32 time)
See FLovenseManager::SendCommand_ASuck() for information on this command.
Definition: ILovenseAdapter.h:226
ILovenseAdapter::SendCommand_AirIn
virtual bool SendCommand_AirIn(const FString &parameters, const FString &toyId)
See FLovenseManager::SendCommand_AirIn() for information on this command.
Definition: ILovenseAdapter.h:130
ILovenseAdapter::SendCommand_Test
virtual bool SendCommand_Test(const FString &toyId)
See FLovenseManager::SendCommand_Test() for information on this command.
Definition: ILovenseAdapter.cpp:269
LovenseRemoteAdapterBase::ParseToyDescription
virtual void ParseToyDescription(FLovenseToyDescription &toyDescription, TSharedPtr< class FJsonObject > toyObject) override
Parses a json object holding toy data and fills a toy description. The json structure is different be...
Definition: LovenseRemoteAdapterBase.cpp:244
ILovenseAdapter::SendCommand_AVibRotateAir
virtual bool SendCommand_AVibRotateAir(const FString &parameters, const FString &toyId, uint8 vibrationSpeed, uint8 rotationSpeed, uint8 pulseSpeed, int32 time)
See FLovenseManager::SendCommand_AVibRotateAir() for information on this command.
Definition: ILovenseAdapter.h:270
ILovenseAdapter::SendCommand_Preset
virtual bool SendCommand_Preset(const FString &parameters, const FString &toyId, uint8 pattern)
See FLovenseManager::SendCommand_Preset() for information on this command.
Definition: ILovenseAdapter.h:164
LovenseRemoteAdapterBase
Base class for all Lovense Remote adapters.
Definition: LovenseRemoteAdapterBase.h:16