Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: eeybye on June 08, 2015, 02:32:33 PM

Title: wclBluetoothDiscovery doesn't detect any devices before opening 'Add a device'
Post by: eeybye on June 08, 2015, 02:32:33 PM
Hello,

Often, the wclBluetoothDiscovery doesn't detect our device before going into Windows's 'Add a device' dialog. Is there a specific reason for this??

We're using the MS stack, on windows.
Title: Re: wclBluetoothDiscovery doesn't detect any devices before opening 'Add a device'
Post by: Mike Petrichenko on June 08, 2015, 02:44:34 PM
Hello,

Sorry but I am not sure I understood what you mean. Can you explaing?
Title: Re: wclBluetoothDiscovery doesn't detect any devices before opening 'Add a device'
Post by: eeybye on June 08, 2015, 03:43:18 PM
Okay,

In my code, I call wclBluetoothDiscovery.Discovery(.., 5, true)
and in the event method OnDiscoveryComplete, I list the devices found and then calls wclBluetoothDiscovery.Discovery(.., 2, false) again. This runs in a loop.

Often, the devices returned in the OnDiscoveryComplete dosn't contain my BT device. When I enter the 'Add a device' dialog in windows, this dialog will display found BT devices. After a few seconds, my BT device appear in the 'Add a device' dialog, and then it's also returned in the OnDiscoveryComplete method of wcl. It might not have anything to do with wcl, but is Windows doing something perhaps?

Best regards,
Erling
Title: Re: wclBluetoothDiscovery doesn't detect any devices before opening 'Add a device'
Post by: Mike Petrichenko on June 08, 2015, 04:00:04 PM
You use very short timeout for discovering. Use 20-30 seconds and all devices will be found.

Also, you use Fast Discovery = true (in first attempt). It returns only paired/remembered devices .
Title: Re: wclBluetoothDiscovery doesn't detect any devices before opening 'Add a device'
Post by: eeybye on June 09, 2015, 03:56:54 PM
Thanks for your reply.

Increasing the timeout value fixed the issue - thank you.
Title: Re: wclBluetoothDiscovery doesn't detect any devices before opening 'Add a device'
Post by: Mike Petrichenko on June 09, 2015, 04:15:46 PM
You are welcome.

If your device is closer to PC and you use it in not so busy area it is not bad idea to use 5-15 seconds interval. If it is far and you have lot of devices around use something like 30-40 seconds. That recomendation is based on our experience.