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

  1. Download the plugin package from here. The latest version of the current plugin is V1.23 click to view version records

    LovenseIntegration_4.27

    LovenseIntegration_5.0

    LovenseIntegration_5.1

    LovenseIntegration_5.2

    LovenseIntegration_5.3

    LovenseIntegration_5.4

  2. Unzip the file to the /Plugins/ folder.

  3. 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.3. If it is older than this version, it is recommended to download and replace the file.

Dowload: LovenseToySupportConfig.json

Guide

image

2. GetToys

image

3. Send Commands

3.1 Send Commands

  • Description:

    Send function commands to the toys.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    commandsTArray<UELovenseCommands>yesSee UELovenseCommands
    toyULovenseToyyesthe toy you want control
    timefloatyesTotal running time in second, 0 represents no limit
    loopRunningSecfloatyestime running for each command loop in second
    loopPauseSecfloatyestime gap for each command loop in second
    callbackFOnLovenseResponseDynamicyesthe 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

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    toyULovenseToy*yesthe toy you want to control
    nameFStringyesThe preset name to send, we provide four preset patterns in the Lovense Remote app: pulse, wave, fireworks, earthquake
    timeSecfloatyesThe 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    toyULovenseToy*yesthe toy you want control
    bVibrateFStringyesThe preset name to send, we provide four preset patterns in the Lovense Remote app: pulse, wave, fireworks, earthquake
    bRotateboolyesenable of rotate action
    bPumpboolyesenable of pump action
    bThrustboolyesenable of thrusting action
    bSuckboolyesenable of suck action
    bFingerboolyesenable of fingering action
    intervalintyesThe level interval in milliseconds ,Should be greater than 100
    timeSecfloatyesThe 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    toyULovenseToy*yesthe toy you want control

4. Events API

4.1 Start Events API

  • Description:

    Start Events API.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    ipFStringyesthe Events API's ip
    portintyesthe Events API's port
    resultCodeCallbackFOnEventCodeyesthe 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.
    toysCallbackFOnGetLovenseEventToysyesIf 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    ipFStringyesthe Events API's ip
    connectCallbackFOnLovenseConnectStatusEventyescallback 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    ipFStringyesthe Events API's ip
    batteryCallbackFOnLovenseConnectStatusEventyescallback 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    ipFStringyesthe Events API's ip
    functionsValueCallbackFOnFunctionsEventyescallback 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    ipFStringyesthe Events API's ip
    everyShakeCallbackFOnEveryShakeEventyescallback 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    ipFStringyesthe Events API's ip
    buttonCallbackFOnButtonEventyescallback 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    ipFStringyesthe 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.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    toyTypeFStringyesthe toy type
    commandType[ELovenseCommandType]yesthe command type
  • Return: bool

5.2 Get support commands by type

  • Description:

    Get all supported command types based on toy type.

    image

  • Parameter:

    NameTypeDefaultRequiredDescription
    toyTypeFStringyesthe toy type
    commandType[ELovenseCommandType]yesthe 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:

    typeRange
    VIBRATE0-20
    VIBRATE10-20
    VIBRATE20-20
    VIBRATE30-20
    ROTATE0-20
    PUMP0-3
    THRUST0-20
    SUCTION0-20
    FINGERING0-20
    DEPTH0-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

nametypeDescription
typeUELovenseCommandsthe type of command
valueintthe value of command

Method

SetType
  • Description:

    Set the type of commands.

SetValue
  • Description:

    Set the value of commands.

UELovenseEventsToy

Property

nametypeDescription
idFStringthe id of the toy
nameFStringthe name of the toy
typeFStringthe id of the toy
hVersionFStringthe hardware version of the toy
fVersionintthe Firmware version of the toy
nickNameFStringthe nick name of the toy
batteryintthe battery level of the toy
connectedboolthe connect status of the toy

ELovenseEventType

  • Description:

    The enum of the toy function type.

  • Enum:

    type
    VIBRATE
    ROTATE
    INFLATION
    THRUST
    SUCTION
    FINGERING
    SHAKE
    DEPTH

ELovenseButtonEventType

  • Description:

    The enum of the button gesture type.

  • Enum:

    type
    BUTTON_DOWN
    BUTTON_UP
    BUTTON_PRESSED

Version Records

[Version1.23] - 2024-05-15

  • 1.Fix the thrust instruction.

  • 2.Compatible with UE5.4.

[Version1.22] - 2024-01-16

  • 1.Add capability with Mac OS X.

[Version1.21] - 2023-12-13

  • 1.Add pre-built content.

[Version1.2] - 2023-11-15

  • 1.Add Vibrate1,Vibrate2,Vibrate3,Depth commands

  • 2.Add a function to obtain toy supported commands.and add an updatable configuration file

  • 3.Update the configuration file to version1.3.

[Version1.1] - 2023-10-16

  • 1.Add Events API.

[Version1.0] - 2023-09-21

  • 1.Send Commands

  • 2.Send Pattern Command

  • 3.Send Preset Command

  • 4.Send Stop Command