Exemplo n.º 1
0
        public MainPage(BluetoothDevice btDevice)
        {
            InitializeComponent();

            if (btDevice != null)
            {
                MessageLabel.Text      = $"Trying to connect to Bluetooth device {btDevice.Name}...";
                _btDevice              = btDevice;
                _bluetoothDeviceHelper = DependencyService.Get <IBluetoothDeviceHelper>();
                Connect2BluetoothDevice();
            }
            else
            {
                MessageLabel.Text = "No Bluetooth device found.";
            }

            Device.StartTimer(TimeSpan.FromMilliseconds(_timerDelay), OnTimerTick);
        }