示例#1
0
    void onBondStateChanged(MLBluetoothLE.Device device, MLBluetoothLE.BondState state)
    {
        print("onBondStateChanged");

        if (state.Equals(MLBluetoothLE.BondState.Bonded))
        {
            print("Device bonded!");
            MLBluetoothLE.DiscoverServices();
        }
    }
示例#2
0
    void onScanResult(MLBluetoothLE.Device device)
    {
        // print("Scan Result");
        // print(device.Address);


        if (device.Address == KEYBOARD_ADDRESS)
        {
            print("Keyboard found!");
            print(device.Name);
            print(device.DeviceType.ToString());

            this.device = device;

            MLBluetoothLE.StopScan();

            print("Attempting to connect");
            MLBluetoothLE.GattConnect(device.Address);
        }
    }