Author Topic: wclBluetoothDiscovery doesn't detect any devices before opening 'Add a device'  (Read 17929 times)

eeybye

  • Guest
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.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Hello,

Sorry but I am not sure I understood what you mean. Can you explaing?

eeybye

  • Guest
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

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
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 .

eeybye

  • Guest
Thanks for your reply.

Increasing the timeout value fixed the issue - thank you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
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.

 

Sitemap 1 2 3 4 5 6 7