Wireless Communication Library Support Forum
Frameworks => Bluetooth Framework => Topic started by: Hawkins2k4 on April 10, 2019, 12:03:04 PM
-
I have been trying to test this library out with Unity to see if it will work for me, and every time I use any of the library functions in my code the library crashes after the demo notification appears.
I am just wondering if this is a function of the demo being incompatible with Unity, or whether I have not configured my project correctly. If I purchase the framework will this persist?
-
Hello,
Please make sure that you use .NET Standard with Unity and your project settings is .NET 4.0 compatibility.
If you still face any issue please download C++ Edition and try these demos: https://github.com/btframework/WCL-for-Unity
Please let me know if you need any help with building the demos.
-
Hi Mike,
Thanks for the fast response, I have it working now on the .NET version.
That being said, I'm looking to purchase the library, are there any differences between the .net version or the cpp version in terms of compatibility?
-
Actually there is no difference but:
On some Mono versions it may freezes when you close the app. It is something related to Mono clean up itself. And we still can not find work around for that. Fortunately it happens not on any Unity version and not on any platform. But because that is no common issue we still can not even find any correlation and with Mono version/Windows version.
In case if you face such issue with .NET Edition we recomend to use C++ Edition with .NET wrappers (we will help you to build/prepare/modify any wrapper/migration code for Bluetooth Framework in case of C++ Edition).
-
Okay, excellent, thank you. For now I am just looking at using the framework for in editor/desktop of a mobile game to speed up the testing/deployment time. I had an issue with it hanging a few minutes ago but realized I wasn't calling wclBluetoothManager.close() in OnApplicationQuit(), if that helps at all.
Thank you for your time, I'm requesting the funds for the library today, so hopefully I'll be able to make the purchase this week.
-
You are very welcome. Should yo uhave any question do not hesitate to ask.
-
Hi,
Does the C++ wrapper work for Unity using .NET 2.0?
If not, do you know if it is possible to write a DLL using your framework in C++ and use that DLL to add Bluetooth functionality to my Unity project using .NET 2.0?
-
Hi,
Yes, it does work with any .NET that is supported by Unity. Becasue the wrapper is a C++ DLL and a c# Unity script. So it is copiled (the c# script) by Unity itself.
-
Awesome!
I try to run the sample project "GattClient" in Unity version 2017.2.1f1 and get
"The class named 'GattClient' is not derived from MonoBehaviour or ScriptableObject!"
It seems to result in the GattClient script not being possible to load. See the attached image.
Is this a known issue or am I doing something wrong?
-
Rename the file (cs) to GattClientDemo. Not sure why it appeared sometimes.
-
That worked, thanks!
To me, it seems like the file should be renamed to GattClientDemo for MonoBehaviour to find the main class that is named "GattClientDemo". But I'm rather new to Unity so don't take my word for it.
-
You are correct. It worked with default name when I created the project (because of settings). But once not all settings exported to GitHub it requires that the file name should be the same as class name.
-
Great!