Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: jordi120 on July 20, 2010, 04:25:28 PM

Title: Bluetooth discovery
Post by: jordi120 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);
            }
        }
Title: Re: Bluetooth discovery
Post by: Mike Petrichenko 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.
Title: Re: Bluetooth discovery
Post by: jordi120 on July 20, 2010, 06:55:44 PM
I've just discovered the true power of the wclProximitySender with their events.

Thanks!