Author Topic: Bluetooth discovery  (Read 13444 times)

jordi120

  • Guest
Bluetooth discovery
« on: July 20, 2010, 04:25:28 PM »
I'm trying to make my Own 'proximitySender' with a couple of new features I needed, but when I try to discover remote devices the application don't respond for a long time period. Maybe some remote device takes a lot of time to respond to a discover petition? or I am doing something wrong?

The code is something like this:


            t1 = new Thread(deviceInquirerThread);
            t1.Start();


        private void deviceInquirerThread()
        {
            while (!this.inquiryShutdown)
            {
                if (this.device != null)
                {
                    if (!this.inquiryActive)
                    {
                         MessageBox.Show("Buscando dispositivos remotos");
                        wcl.wclErrors.wclShowError(bluetoothDiscovery.Discovery(this.device));
                    }
                }
                else
                    MessageBox.Show("No hay dispositivo USB");
                Thread.Sleep(10000);
            }
        }

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Bluetooth discovery
« Reply #1 on: July 20, 2010, 05:42:23 PM »
Hello,

First, you do not need any threads as discovering is asyncronous procedure. Also I do recomend to use wclProximitySender.

jordi120

  • Guest
Re: Bluetooth discovery
« Reply #2 on: July 20, 2010, 06:55:44 PM »
I've just discovered the true power of the wclProximitySender with their events.

Thanks!

 

Sitemap 1 2 3 4 5 6 7