Bluetooth for Unity

I want to create an app with Unity to connect the sensor (For Andoird and iOS) but I am worried bluetooth connection won't work because GetMetaWearBoard recieves a variable of type BlutoothLEDevice, which is only supported on Windows. Can GetMetaWearBoard recieve another type of bluetooth object?

using MbientLab.MetaWear.Win10;

public async IMetaWearBoard macAddrToIMetaWearBoard(ulong mac) {
var device = await BluetoothLEDevice.FromBluetoothAddressAsync(mac);
return Application.GetMetaWearBoard(device);
}

Comments

  • No, that function is only for Windows 10 apps, hence why is it under the Win10 namespace.

    You need to plugin your own BluetoothLE libraries if you are deploying to other platforms.

  • Ok thanks!
    Are you planning on releasing a Unity SDK anytime soon?

  • There is no Unity SDK to create. The existing C# SDK already works as is in Unity2018 and it is up to the developer to plugin platform specific Bluetooth LE and File IO code for their target platform.

  • Ok, so now I've integrated a BLE library for Android and iOS on Unity, works fine, I can scan and connect my sensor, but I am still having troubles with the Mbientlab documentation. I can't find a way to initialize my IMetaWearBoard without using

    var device = await BluetoothLEDevice.FromBluetoothAddressAsync(mac);
    return Application.GetMetaWearBoard(device);

    Is there anything else? What I need is to get the accelerometer values but to do it, I need the IMetaWearBoard

    var accelerometer = metawear.GetModule();

This discussion has been closed.