Creating Mobile App With Unity
This discussion was created from comments split from: Unity works perfectly with MetaWear sensor on first run, hangs on 2nd run.
This discussion has been closed.
Comments
Hello Guys!
I'm trying to use the sensor with Unity for mobile games (ios, android) and for the bluetooth connection I'm using this asset. https://assetstore.unity.com/packages/tools/network/bluetooth-le-for-ios-tvos-and-android-26661
Using the example "SimpleTest" (in asset) and the information in the links below. I managed to connect to the sensor.
https://www.cumulations.com/blogs/47/decoding-metawear-apis-using-ble-to-read-pulse-sensor
https://www.cumulations.com/blogs/66/decoding-metawear-apis-using-ble-to-read-gyro-sensor
After that I managed to communicate with the sensor and send data in an Android device following the steps in the link above. I can subscribe to the output characteristics but the problem is that I never receive the data.
I leave my test code
https://app.box.com/s/xnje2hh4qeihdjjfdyjbdj3g7t2s0xhp
Integrate the BLE plugin into the C# SDK and use said SDK. We do not support users using the raw byte protocol.
Hi Eric.
We already try it to integrate but the problem was with IBluetoothLeGatt and ILibraryIO implementations. The examples and sdk are for Win10 applications. We were looking for more information about the implementations but we doesn't found it only the links below.
https://github.com/mbientlab/MetaWear-SDK-CSharp
https://mbientlab.com/documents/metawear/csharp/1/interfaceMbientLab_1_1MetaWear_1_1Impl_1_1Platform_1_1IBluetoothLeGatt.html
https://mbientlab.com/documents/metawear/csharp/1/interfaceMbientLab_1_1MetaWear_1_1Impl_1_1Platform_1_1ILibraryIO.html
And with only this information we aren't able to use the sdk. Maybe because we doesn't have the enough knowledge about Bluetooth or sensor. Thats why we're using the raw byte protocol approach. If you can help us with more docummentation about the implementations or something like that, we would be happy to use the SDK.
Hey GabRiv, How did you manage to set up Unity to recognize the SDKs you used? did you place them on a specific folder, did you compile them as DLLs, or did you do anything different?
Hello Shrek.
We compile them as DLLs in Visual Studio. For Unity we place it in Assets->Plugins->MbientLab.MetaWear.dll
What specifically is unclear to you?