コード例 #1
0
        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);
        }
コード例 #2
0
        private static void onConnectPeripheralCallback(IntPtr peripheral)
        {
            UnityCBPeripheral p = new UnityCBPeripheral(peripheral);

            UnityCoreBluetooth.onConnectPeripheralHandler(p);
        }
コード例 #3
0
 public void Connect(UnityCBPeripheral peripheral)
 {
     unityCoreBluetooth_connect(nativePtr, peripheral.nativePtr);
 }