You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sorry for posting yet another Unity issue. But despite much reading, I'm still having problems with Bluetooth LE and Unity, targeting Windows 11 deployment. I know Unity wasn't your primary target here, but right now 32feet is the pretty much the only good lead that we Unity devs have for BLE on Windows.
I have a minimal project that reproduces the issues I'm seeing, and I'm hoping this helps track down what I'm doing wrong. If we manage to resolve my issues, I'm happy to provide it as a working example in your documentation.
I have used two different ways to get the DLLs into the project, and I have the same issues either way:
Manually pulling them out of the .nupkg file
Using a third-party NuGetForUnity asset that does this automatically
I have also written a .NET console app (also in my repro repo) using the netstandard2.0 DLLs. I was hoping the real nuget package manager would pull in the proper native dependencies, but I'm still seeing the same issues with "PlatformNotSupportedException: Operation is not supported on this platform."
The .NET Standard libraries will definitely not work as they are merely the public API with no implementation. I'm not a Unity developer myself so I'm not sure what compatibility the runtimes in Unity have but previously the .NET 4.x versions have run under Unity Mono. I'll need to investigate why the WinSDK dependencies don't work - these are required as the bridge between the .NET and Windows runtime SDKs. The Bluetooth Classic API was simpler because for .NET4.x it just uses the Win32 APIs.
@peterfoot Thanks for following up with a definitive answer on the .NET Standard issues. I'll abandon that approach then. Next time I'm back on this, I may give .NET 4.x one final attempt. I'll try to remember to update this thread with whatever I learn.
I'm sorry for posting yet another Unity issue. But despite much reading, I'm still having problems with Bluetooth LE and Unity, targeting Windows 11 deployment. I know Unity wasn't your primary target here, but right now 32feet is the pretty much the only good lead that we Unity devs have for BLE on Windows.
I have a minimal project that reproduces the issues I'm seeing, and I'm hoping this helps track down what I'm doing wrong. If we manage to resolve my issues, I'm happy to provide it as a working example in your documentation.
https://github.com/MattLichter/InTheHandTest
I have tried all three runtime combinations, each on its own branch of that repository:
I am using Unity 2022.3.50f1 and InTheHand.BluetoothLE 4.0.37, but have seen the same problems on earlier versions of both.
What I've already tried
I read the following issues but none resolved my problems. I must be missing something.
I have used two different ways to get the DLLs into the project, and I have the same issues either way:
I have also written a .NET console app (also in my repro repo) using the netstandard2.0 DLLs. I was hoping the real nuget package manager would pull in the proper native dependencies, but I'm still seeing the same issues with "PlatformNotSupportedException: Operation is not supported on this platform."
I have also looked at this example project, and was able to get it to run. However, that example uses the classic Bluetooth library, not the LE library that I need. https://gitlab.com/jcs-workspace/bluetooth/32feet.Unity.Example
Are there any other approaches I should try? Am I just wrong thinking that BLE will work on Unity for Windows?
The text was updated successfully, but these errors were encountered: