BLE (Bluetooth Low Energy) plugin for Unreal Engine

Hello! Check out our Unreal Engine plugin that allows scanning for BLE devices with Cycling Power service running, connect to one of them and subscribe for its notifications. It is completely open-source, so feel free to use it.

This is what the plugin is able to do:

  • Works in Unreal Engine 4.20 for both iOS and Android platforms
  • Check if bluetooth Low Engergy is supported on the device
  • Check if bluetooth is enabled
  • Enable/disable bluetooth" (Android only)
  • Scan for bluetooth devices that have the “Cycling Power” service running
  • Connect to one of the found BLE devices from within the Unreal Engine app
  • Subscribe to the “Cycling Power” -> “Cycling Power Measurement” notifications
  • Return the received notification data as byte array to Unreal Engine

Project on GitHub: https://github.com/NinevaStudios/Ble…esPluginUnreal

Join our Discord server (Discord) and ask us anything!

UPD: The plugin is now updated and published on the Marketplace: BLE Utilities V2 in Code Plugins - UE Marketplace

1 Like

That sounds super nice - Looking forward to test it right now

This is really cool! I don’t have a cycling device so I’m just trying to see if I can discover some other custom devices I have. I’m successfully deploying to a Galaxy Note 9 with the sample app and have changed the cycling power UUID to a custom 128-bit one, but am unable to discover known broadcasting devices. Any idea why that might be? Minimum API version = 21

// BleUtilitiesPluginUnreal\Plugins\BleUtilities\Source\BleUtilities\Private\Java\BleUtilitiesDevice.java
// ---------------------------------------------------------------------------------------------------------------------------------------------
private static final String CUSTOM_SERVICE_UUID_STRING = “xxxx0000-xxxx-xxxx-xxxx-xxxxxxxxxxxx”;
private static final UUID CUSTOM_SERVICE_UUID = UUID.nameUUIDFromBytes(CUSTOM_SERVICE_UUID_STRING.getBytes());

This looks amazing, will the plugin work on latest engine?

i want the same for Windows Platform, how to get started to do the same task, scan, connect, list services, read/write characteristics of a BLE Device on Windows Platform ?

I have one problem and one question.

A) How can i talk with the other bluetooth item?

B) I cant packaging it!

ATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): [4/11] Module.BleUtilities.cpp [armv7-es2]
UATHelper: stIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(171,103): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
UATHelper: abort at runtime -Wnon-pod-varargs]
UATHelper: ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): C:/Users/jordi/Documents/Unreal Projects/TestIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(118,64): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort
at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BLEManagerJavaObject->CallMethod<void>(ConnectToDeviceMethod, FJavaClassObject::GetJString(BLEDevice->GetDeviceInternal()));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): C:/Users/jordi/Documents/Unreal Projects/TestIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(131,65): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort
at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BLEManagerJavaObject->CallMethod<void>(DisconnectDeviceMethod, FJavaClassObject::GetJString(BLEDevice->GetDeviceInternal()));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): C:/Users/jordi/Documents/Unreal Projects/TestIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(140,62): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort
at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BLEManagerJavaObject->CallMethod<void>(SetDeviceGuidMethod, FJavaClassObject::GetJString(deviceId), FJavaClassObject::GetJString(BLEDevice->GetDeviceGuid().ToString()));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): C:/Users/jordi/Documents/Unreal Projects/TestIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(140,102): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abor
t at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BLEManagerJavaObject->CallMethod<void>(SetDeviceGuidMethod, FJavaClassObject::GetJString(deviceId), FJavaClassObject::GetJString(BLEDevice->GetDeviceGuid().ToString()));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic constructor; call will abort at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): jstring Return = static_cast<jstring>(BLEManagerJavaObject->CallMethod<jobject>(GetDeviceNameMethod, FJavaClassObject::GetJString(deviceId)));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): C:/Users/jordi/Documents/Unreal Projects/TestIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(183,67): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort
at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): return BLEManagerJavaObject->CallMethod<bool>(IsDeviceConnected, FJavaClassObject::GetJString(deviceId));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): C:/Users/jordi/Documents/Unreal Projects/TestIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(188,74): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort
at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BLEManagerJavaObject->CallMethod<void>(SubscribeForNotificationsMethod, FJavaClassObject::GetJString(deviceId));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): C:/Users/jordi/Documents/Unreal Projects/TestIosBLE/Plugins/BleUtilities/Source/BleUtilities/Private/Android/BLEManager.cpp(193,66): error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort
at runtime -Wnon-pod-varargs]
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BLEManagerJavaObject->CallMethod<void>(StopNotificationsMethod, FJavaClassObject::GetJString(deviceId));
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ^
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): 9 errors generated.
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]
PackagingResults: Error: cannot pass object of non-trivial type ‘FScopedJavaObject<jstring>’ (aka ‘FScopedJavaObject<_jstring *>’) through variadic method; call will abort at runtime -Wnon-pod-varargs]

Hello guys, we have published this plugin on the Marketplace now: BLE Utilities V2 in Code Plugins - UE Marketplace

Thanks for all your interest and questions (or need some contract work done), you can talk to us on Discord: Discord

Hey there. Can you update the Discord invite link please? Set it to not expire. :slight_smile:

new Discord link - Nineva Support