private static void onUpdateValueCallback(IntPtr peripheral, IntPtr characteristic, IntPtr data, long length) { UnityCBCharacteristic c = new UnityCBCharacteristic(characteristic); UnityCBPeripheral p = new UnityCBPeripheral(peripheral); byte[] result = new byte[length]; Marshal.Copy(data, result, 0, (int)length); UnityCoreBluetooth.onUpdateValueHandler(p, c, result); }
private static void onConnectPeripheralCallback(IntPtr peripheral) { UnityCBPeripheral p = new UnityCBPeripheral(peripheral); UnityCoreBluetooth.onConnectPeripheralHandler(p); }
public void Connect(UnityCBPeripheral peripheral) { unityCoreBluetooth_connect(nativePtr, peripheral.nativePtr); }