Exemplo n.º 1
0
 //if devices change disconnect
 private void DevicesComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     currentSelectedService        = null;
     currentSelectedCharacteristic = null;
     ConnectBtn.Enabled            = true;
     CharacteristicsTxtBox.Clear();
     ServiceTxtBox.Clear();
 }
Exemplo n.º 2
0
        //trigger StartBleDeviceWatcher() to start bluetoothLe Operation
        private void ScanBtn_Click(object sender, EventArgs e)
        {
            //empty bluetooth inputs
            DevicesComboBox.Items.Clear();
            CharacteristicsTxtBox.Clear();
            ServiceTxtBox.Clear();

            //empty devices list
            _knownDevices.Clear();
            UnknownDevices.Clear();

            //notify user
            Respond("Scanning nearby devices...");

            //disable scan button
            ScanBtn.Enabled = false;

            //finally, start scanning
            StartBleDeviceWatcher();
        }