Example #1
0
        private void BLETest()
        {
            string MAC = "a8:10:87:6a:f7:e8";

            bluetooth = new BluetoothLECode(_serviceGuid, _writeCharacteristicGuid, _notifyCharacteristicGuid);
            bluetooth.ValueChanged += Bluetooth_ValueChanged;
            bluetooth.SelectDeviceFromIdAsync(MAC);
        }
Example #2
0
 private void button_Connect_Click(object sender, EventArgs e)
 {
     try
     {
         if (mConnect)
         {
             return;
         }
         else
         {
             _        = bluetooth.SelectDeviceFromIdAsync(BluetoothMAC);
             mConnect = true;
             button_Connect.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString(), "", MessageBoxButtons.OK);
     }
 }