Skip to content

UDEXREAL Unreal Engine Android Bluetooth SDK

All product guides

Applicable to Unreal Engine 5.1 and above Android platform versions.

1. SDK Overview

Udexreal UE Bluetooth HandDriver For Android hereinafter referred to as UE_BTD.This plugin is used for Udexreal motion capture gloves in Bluetooth transmission mode, integrated into Android applications developed by Unreal, and can be used on smartphones, VR devices, etc.

Note: Please do not use the Bluetooth device connection function in the headset operating system to connect to the glove, otherwise the glove will never connect again. Just use the Bluetooth application developed by this SDK to connect.

1.1. Plugin acquisition

Please contact Yudi Business Customer Service

1.2. SDK Feature Introduction

  • Bluetooth Initialization
  • Start searching for UDX Bluetooth devices
  • Terminate search for UDX Bluetooth devices
  • Get a list of currently searched UDX Bluetooth devices
  • Connect specified UDX Bluetooth devices
  • Check if the ServerID of the specified device is correct
  • Check if the specified device Characteristic ID is correct
  • Send Write data to the device
  • Send a Subscribe/Unsubscribe request to the device
  • Start and end of control calibration action
  • Get all joint change angles
  • Obtain calibration performance value
  • Get HandCom component parameters
  • Zero calibration of joystick position
  • Rocker range calibration control
  • Controlled vibration feedback
  • Obtain native motion capture angle data
  • Configure motion capture parameters
  • Animated blueprint node

2. Quick start

2.1. Install the plugin

Unpack the BTD plugin from Compressed Packet and drag it to the Plugins directory of the project project (if there is no Plugins folder, you need to manually create one with the same name).

2.2. Precondition

You need to complete the UnrealEngine Android environment configuration. For details, please refer to the Unreal official documentation: How to Set Up Android SDK and NDK For Your Unreal Engine Development Environment (this link applies to UnrealEngine 5.1 version).

2.3. Packaging using DEMO

Find Demo level in the plugin directory and select Project Settings - Project - Map and Mode - Default Map.

Pack it into an Apk and install it on your Android phone to use.

3. Data structure definition

3.1. Rotation data

TArray\Available by function GetUdexData

3.2. Input data

struct FInputData 
{
    float joyX; //range: -1 -> 1 摇杆X值

    float joyY;  //range: -1 -> 1 摇杆Y值

    bool bBtnJoy;//摇杆按键

    bool bBtnTrg;//Trg按键

    bool bBtnA;//按键A

    bool bBtnB;//按键B

    bool bGrab;//Grab按键

    bool bBtnMenu;//菜单按键

    bool bTrackpad_touch;//触摸板按键
};

Can be obtained by the function GetInputData

4. Interface function definition

4.1. Bluetooth connection

4.1.1. Init

static void Init ()Function description: To initialize Bluetooth configuration, you need to call this function before using the following method!!!

4.1.2. bIsBTSupported

static bool bIsBTSupported()Function: Whether the current device supports Bluetooth.

Return value Type Example values Explanation


Bool true Currently supports Bluetooth

4.1.3. bIsBTEnalbled

static bool bIsBTEnalbled()Function Description: Is Bluetooth currently enabled?

Return value Type Example values Explanation


Bool true Bluetooth is currently enabled

4.1.4. ToggleBluetoothState

static void ToggleBluetoothState()Function: Request to switch the current Bluetooth state.

4.1.5. StarScanUdexDevices

static void StarScanUdexDevices (FUdxDelegate OnDeivceFoun)Function description: Search for nearby Udex Bluetooth devices, and trigger the callback function when searching.

Parameter name Type Example values Explanation
UdxDelegate FUdxDelegate See Demo level The proxy called when searching for Udex Bluetooth gloves

4.1.6. StopScanUdexDevices

static void StopScanUdexDevices ();Function description: Stop searching for Udex Bluetooth devices, it is recommended to stop after connecting the device.

4.1.7. CheckDevicesIsConnected

static bool CheckDevicesIsConnected (const FString DeviceName)Function: Determine whether the device is already connected.

Parameter name Type Example values Explanation
DeviceName const FString UDSTAB3CC000001L

Device name to be judged

Return value Type Example values Explanation


Bool true This device is already connected

4.1.8. GetUdexDevices

static TArray\ GetUdexDevices()Function description: Get the currently found Udex Bluetooth gloves

Return value Type Example values Explanation


TArray\ No Searched Bluetooth device references

4.1.9. ConnectUdxDevice

static void ConnectUdxDevice(const FString DeviceName,FUdxDelegate OnConnect,FUdxDelegate OnDisonnect,FBleCharacteristicDataDelegate BlyOnNotify);

Function description: Connect the Udex Bluetooth glove that has been searched by device name and bind three agents (see parameter description for details).

Parameter name Type Example values Explanation
DeviceName const FString UDSTAB3CC000001L Currently supports Bluetooth
OnConnect FUdxDelegate No Proxy called when a connection is successful
OnDisonnect FUdxDelegate No Proxy called when connection fails
BlyOnNotify FBleCharacteristicDataDelegate No Agent called when updated data is receivedReturn TArray < uint8 > to output data for the glove.

4.2. Data transmission and reception

4.2.1. Pc2Mcu_StartReceive

static void Pc2Mcu_StartReceive(FString DeviceName);

Function description: Send a request to the device to start accepting data, and the device will return the data to BlyOnNotify. (See 3.1.9 for details)

Parameter name Type Example values Explanation
DeviceName FString UDSTAB3CC000001L Device you want to send to

4.2.2. Pc2Mcu_SendVibration

static void Pc2Mcu_SendVibration(FString DeviceName, int32 address1, int32 time, int32 stren);

Function Description: Send vibration command to the device.

Parameter name Type Example values Explanation
DeviceName FString UDSTAB3CC000001L Device you want to send to
address1 int32 01 Vibration point, range 1 or 2
time int32 04 Vibration duration (ms), range 04~ A
stren int32 04 Vibration intensity, range 04~ A

4.2.3. CreateUdexDevice

static bool CreateUdexDevice(FString name)

Create a UdexDevice class for managing devices and reading data. It is recommended to create it after a successful connection.

Parameter name Type Example values Explanation
name FString UDSTAB3CC000001L The device name created needs to be the same as the connected device name
Return value Type Example values Explanation

Bool true Created successfully

4.2.4. ReadData

static bool ReadData(FString name,TArray\ data)

Function description: Read the data of the glove, parse it into usable angle data, and call it after BlyOnNotify (see 4.1.9 for details).

Parameter name Type Example values Explanation
name FString UDSTAB3CC000001L Currently supported Bluetooth device names
data TArray<uint8> From BlyOnNotify ( see details here ) Glove data
Return value Type Example values Explanation
Whether the parsing was successful Bool true Analysis successful

4.2.5. GetUdexData

static TArray\ GetUdexData(FString name);Obtain the rotation data of the finger, which needs to be used after the success of ReadData .

Parameter name Type Example values Explanation
name FString UDSTAB3CC000001L Device name, get the rotation data of the device
Return value Type Example values Explanation
Rotation data TArray<double>
Return the device rotation data, followed by GetDataFromBLe for application.

4.2.6. GetInputData

static FInputData GetInputData(FString name);Get the input data of the device and return an FInputData structure.

Parameter name Type Example values Explanation
name FString UDSTAB3CC000001L Device name, get the input data of the device
Return value Type Example values Explanation
Input data FInputData
Return device data, buttons, joystick values, etc.

4.2.7. CalibrationCenterData

static void CalibrationCenterData(const FString DeviceName);Function description: Calibrate the middle value of the joystick.

Parameter name Type Example values Explanation
DeviceName const FString UDSTAB3CC000001L

Device name to be judged

4.2.8. StartCalibrationRangeData

static void StartCalibrationRangeData(const FString DeviceName);Function description: Start calibrating the extreme value of the joystick

Parameter name Type Example values Explanation
DeviceName const FString UDSTAB3CC000001L

Device name to be judged

4.2.9. StopCalibrationRangeData

static void StopCalibrationRangeData(const FString DeviceName);Function description: end calibration joystick extreme value

Parameter name Type Example values Explanation
DeviceName const FString UDSTAB3CC000001L

Device name to be judged

4.3. Data usage

4.3.1. HandComponent

Please refer to UDEXREAL HandDriver UE5 Plugin Tutorial, see the chapter - Full-body motion capture integration.

4.3.2. GetDataFromBLe

void GetDataFromBLe(TArray\Datas)

Function description: Pass the parsed data to the HandComponent component to drive the hand bones.

Parameter name Type Example values Explanation
Datas TArray<float> From ReadData ( see details here ) Data that drives hand models
Target hand component See demo The hand component passes data into it to call the hand bones that are bound to it.

4.3.3. GetGloveColorFromGlovePoint

static void GetGloveColorFromGlovePoint(const FString DeviceName, bool& bNotEmpty,TArray\& PointColor);

Function description: Get the color of the glove calibration point [For 0.0.6 version, please use the function "static void GetGloveColorFromPointValue (const FString DeviceName, bool & bNotEmpty, TArray < int32 > & ColorIndex) "]

Parameter name Type Example values Explanation
DeviceName const FString UDSTAB3CC000001L

Device name to be judged

bNotEmpty bool true The device for viewing information exists
PointColor TArray\& Color value Store the current color value of 12 points

4.3.4. GetGlovePointExtremeValue

static void GetGlovePointExtremeValue(const FString DeviceName, TArray\& min,TArray\& max);

Function description: Get the extreme value of the glove calibration point (maximum & minimum)

Parameter name Type Example values Explanation
DeviceName const FString UDSTAB3CC000001L Device name to be judged
min TArray<float> min[0] The minimum value of the first sensor
max TArray<float> max[0] The maximum value of the first sensor

5. Demo example

5.1. Video example

Downloads and files

5.2. APK download

View related guide