title: C# 32Feet.Net can't detect Bluetooth device
body: <p>I used 32Feet.Net try to detect a Bluetooth device, but it's not working.
  <a href="https://imgur.com/a/PpGHMQX" rel="nofollow noreferrer">https://imgur.com/a/PpGHMQX</a></p>
  <p>Then I used Windows system Bluetooth function, it can detect that device.
  <a href="https://imgur.com/a/bjpodlu" rel="nofollow noreferrer">https://imgur.com/a/bjpodlu</a></p>
  <p>And here is my code, is there something wrong with my code or...?
  Please help me to solve this problem, many thanks!</p>
  <pre><code>using InTheHand.Net.Sockets;
  using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace BluetoothSearchTool
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          bool RUN = false;
  
          private void btnSearch_Click(object sender, EventArgs e)
          {
              if (!RUN)
              {
                  RUN = true;
                  Thread t = new Thread(Search);
                  t.Start();
              }
              else
              {
                  RUN = false;
              }
          }
  
          private void Search()
          {
              BluetoothClient bc = new BluetoothClient();
              BluetoothDeviceInfo[] bdi_list = null;
  
              ButtonText(&quot;Stop&quot;);
              AppendText(&quot;Start Searching&quot; + &quot;\r\n&quot;);
  
              while (RUN)
              {
                  bdi_list = bc.DiscoverDevicesInRange();
                  if (bdi_list.Length != 0)
                  {
                      foreach (BluetoothDeviceInfo bdi in bdi_list)
                      {
                          AppendText(bdi.DeviceName + &quot;\r\n&quot;);
                          AppendText(bdi.DeviceAddress + &quot;\r\n&quot;);
                          AppendText(&quot;-----------------&quot; + &quot;\r\n&quot;);
                      }
                  }
              }
  
              ButtonText(&quot;Search&quot;);
              AppendText(&quot;Stop Searching&quot; + &quot;\r\n&quot;);
          }
  
          private void ButtonText(string text)
          {
              if (this.InvokeRequired == true)
              {
                  this.BeginInvoke(new MethodInvoker(delegate { ButtonText(text); }));
                  return;
              }
              btnSearch.Text = text;
              Application.DoEvents();
          }
  
          private void AppendText(string content)
          {
              if (this.InvokeRequired == true)
              {
                  this.BeginInvoke(new MethodInvoker(delegate { AppendText(content); }));
                  return;
              }
              rtbContent.AppendText(content);
              rtbContent.ScrollToCaret();
              Application.DoEvents();
          }
      }
  }
  </code></pre>