Unreal Plugin For Remote
Introduction
This Unreal plugin allows Windows devices to connect Lovense toys and send control commands.
Note: Android and iOS Remote App requires "Game Mode" to be enabled, PC Remote App requires "Allow Control" to be enabled.
Compatibility
Unreal version: >= UE4.27
Import the plugin
Download the plugin package from here. The latest version of the current plugin is V1.3 click to view version records
Unzip the file to the
/Plugins/
folder.The file LovenseIntegration/Config/LovenseToySupportConfig.json is the configuration file for the toy support directive, and the version field represents the version of the information.
The current latest version is 1.4
. If it is older than this version, it is recommended to download and replace the file.
Dowload: LovenseToySupportConfig.json
Guide
1. Start Search
2. GetToys
3. Send Commands
3.1 Send Commands
Description:
Send function commands to the toys.
Parameter:
Name Type Default Required Description commands TArray<UELovenseCommands> yes See UELovenseCommands toy ULovenseToy yes the toy you want control time float yes Total running time in second, 0
represents no limitloopRunningSec float yes time running for each command loop in second loopPauseSec float yes time gap for each command loop in second callback FOnLovenseResponseDynamic yes the parameters is ULovenseToy* toy, int32 responseValue
3.2 Send Preset
Description:
Now we provide four preset patterns in the Lovense Remote app:
pulse
,wave
,fireworks
,earthquake
Parameter:
Name Type Default Required Description toy ULovenseToy* yes the toy you want to control name FString yes The preset name to send, we provide four preset patterns in the Lovense Remote app: pulse
,wave
,fireworks
,earthquake
timeSec float yes The total runtime in second, "0" = indefinite time length. Otherwise, the value should be greater than or equal to 1.
3.3 Send Pattern
Description:
Send a series of functions to the toys.
Parameter:
Name Type Default Required Description toy ULovenseToy* yes the toy you want control bVibrate FString yes The preset name to send, we provide four preset patterns in the Lovense Remote app: pulse
,wave
,fireworks
,earthquake
bRotate bool yes enable of rotate action bPump bool yes enable of pump action bThrust bool yes enable of thrusting action bSuck bool yes enable of suck action bFinger bool yes enable of fingering action interval int yes The level interval in milliseconds ,Should be greater than 100 timeSec float yes The total runtime in second, "0" = indefinite time length. Otherwise, the value should be greater than or equal to 1.
3.4 Send stop command
Description:
Send a stop command to the toy.
Parameter:
Name Type Default Required Description toy ULovenseToy* yes the toy you want control
3.5 Send position command
Description:
Controls the stroker to move to a specified position(0~100).
Parameter:
Name Type Default Required Description position int32 yes The position of the stroker toy ULovenseToy* yes The toy you want control
3.6 SetUpPatternV2
Description:
Send a series of positions to Solace Pro.
Parameters:
Name Type Description positions TArray<class UEPositionPatternValue*> The series value of PatternV2 toy ULovenseToy*
3.7 StartPatternV2
Description:
Play the predefined pattern.
Parameters:
Name Type Description toy ULovenseToy* startTime int The start time of playback. The value range is 0~7200000 (in ms). If you don’t include this, it will start playing from 0. offsetTime int The client-server offset time. The value range is 0~15000 (in ms). If you don’t include this, it will be set to 0.
3.8 StopPatternV2
Description:
Stop playing the predefined pattern.
Parameters:
Name Type Description toy ULovenseToy*
3.9 GetPatternV2SyncTime
Description:
Get the offset time from the server.
Parameters:
Name Type Description toy ULovenseToy*
4. Events API
4.1 Start Events API
Description:
Start Events API.
Parameter:
Name Type Default Required Description ip FString yes the Events API's ip port int yes the Events API's port resultCodeCallback FOnEventCode yes the result code of starting Events API, callback parameters is int resultCode
,resultCode=-1: socket connection error,resultCode=0: socket closed,resultCode=200: socket connection successed.toysCallback FOnGetLovenseEventToys yes If the Events API is successfully launched, it will respond with a list of toys that support the Events API in the Lovense Remote App, and the callback parameters is const TArray\<[UELovenseEventsToy]\> toys
4.2 Set connect event callback
Description:
Set callback for toy's connect status changed.
Parameter:
Name Type Default Required Description ip FString yes the Events API's ip connectCallback FOnLovenseConnectStatusEvent yes callback for toy's connect status changed, and the callback parameters is FString id, bool isConnected
4.3 Set battery event callback
Description:
Set callback for toy's battery changed.
Parameter:
Name Type Default Required Description ip FString yes the Events API's ip batteryCallback FOnLovenseConnectStatusEvent yes callback for toy's connect status changed,and the callback parameters is FString id, int32 battery
4.4 Set functions value event callback
Description:
Set callback for toy's functions value changed.
Parameter:
Name Type Default Required Description ip FString yes the Events API's ip functionsValueCallback FOnFunctionsEvent yes callback for toy's function('See ELovenseEventType') value changed,and the callback parameters is (FString id, ELovenseEventType type,int32 value,int32 index)
4.5 Set every shake event callback
Description:
Set callback for each shake of the toys.
Parameter:
Name Type Default Required Description ip FString yes the Events API's ip everyShakeCallback FOnEveryShakeEvent yes callback for each shake of the toys, and the callback parameters is FString id
4.6 Set button event callback
Description:
Set callback for the button gesture of the toys.
Parameter:
Name Type Default Required Description ip FString yes the Events API's ip buttonCallback FOnButtonEvent yes callback for the button gesture of the toys,and the callback parameters is FString id, [ELovenseButtonEventType] type
,int32 index
4.7 Stop Events API
Description:
Stop the Events API.
Parameter:
Name Type Default Required Description ip FString yes the Events API's ip
5. Get Supported Commands
5.1 Toy is support this command
Description:
Determine whether specific types of toys support specific toys.
Parameter:
Name Type Default Required Description toyType FString yes the toy type commandType [ELovenseCommandType] yes the command type Return: bool
5.2 Get support commands by type
Description:
Get all supported command types based on toy type.
Parameter:
Name Type Default Required Description toyType FString yes the toy type commandType [ELovenseCommandType] yes the command type Return: TArray<[ELovenseCommandType]>
Class
ULovenseToy
Method
GetFullToyName
Description:
Get the toy's name
Parameters: None
Return: FString
GetAssociatedAdapterPlatformName
Description:
Get the Platform Name
Parameters: None
Return: FString
IsConnected
Description:
Whether this toy's connection to the Lovense App is active.
Parameters:None
Return: bool
GetBatteryStatus
Description:
Current battery status of the toy. Value is percentage charged, range is 0-100%.
Parameters:None
Return: int32
IsValidToy
Description:
Checks whether this is a valid UObject and has all required information for normal functionality.
Parameters:None
Return: bool
ELovenseCommandType
Description:
The enum of the toy function type.
Enum:
type Range VIBRATE 0-20 VIBRATE1 0-20 VIBRATE2 0-20 VIBRATE3 0-20 ROTATE 0-20 PUMP 0-3 THRUST 0-20 SUCTION 0-20 FINGERING 0-20 DEPTH 0-3
The DEPTH command is a setting command that requires the THRUSTRING command to take effect.
UELovenseCommands
Description:
Send the class containing the types and values of commands.
Property
name | type | Description |
---|---|---|
type | UELovenseCommands | the type of command |
value | int | the value of command |
Method
SetType
Description:
Set the type of commands.
SetValue
Description:
Set the value of commands.
UELovenseEventsToy
Property
name | type | Description |
---|---|---|
id | FString | the id of the toy |
name | FString | the name of the toy |
type | FString | the id of the toy |
hVersion | FString | the hardware version of the toy |
fVersion | int | the Firmware version of the toy |
nickName | FString | the nick name of the toy |
battery | int | the battery level of the toy |
connected | bool | the connect status of the toy |
ELovenseEventType
Description:
The enum of the toy function type.
Enum:
type VIBRATE ROTATE INFLATION THRUST SUCTION FINGERING SHAKE DEPTH POSITION
ELovenseButtonEventType
Description:
The enum of the button gesture type.
Enum:
type BUTTON_DOWN BUTTON_UP BUTTON_PRESSED
UELovenseSolaceProCommands
Description:
Extends from UELovenseCommands, specially designed for use with Solace Pro.
Property
name | type | Description |
---|---|---|
Name | Type | Description |
----- | -------------------- | -------------- |
strokeLow | int | The stroke Value at the low end |
strokeHigh | int | The stroke Value at the high end, strokeHigh - strokeLow must be greater than 20 |
Method
GetStrokeLow
Description:
Get the value of strokeLow.
GetStrokeHigh
Description:
Get the value of strokeHigh.
SetStrokeLow
Description:
Set the value of strokeLow.
SetStrokeHigh
Description:
Set the value of strokeHigh.
UEPositionPatternValue
Description:
The position command.
Properties:
Name Type Description time int the time in milliseconds position int The position of the stroker(0-100)
Method
GetTime
Description:
Get the value of time.
GetPosition
Description:
Get the value of position.
SetTime
Description:
Set the value of time.
SetPosition
Description:
Set the value of position.
Version Records
[Version1.3] - 2024-08-23
- Support Solace Pro, Update
- Update the configuration file to version1.4.
[Version1.23] - 2024-05-15
- Fix the thrust instruction.
- Compatible with UE5.4.
[Version1.22] - 2024-01-16
- Add capability with Mac OS X.
[Version1.21] - 2023-12-13
- Add pre-built content.
[Version1.2] - 2023-11-15
- Add Vibrate1,Vibrate2,Vibrate3,Depth commands
- Add a function to obtain toy supported commands.and add an updatable configuration file
- Update the configuration file to version1.3.
[Version1.1] - 2023-10-16
- Add Events API.
[Version1.0] - 2023-09-21
- Send Commands
- Send Pattern Command
- Send Preset Command
- Send Stop Command