Author Topic: How does the OnDiscoveringCompleted event work?  (Read 14920 times)

Mond089

  • Guest
How does the OnDiscoveringCompleted event work?
« on: October 07, 2019, 09:14:27 AM »
Hi all,
I'm opening this topic because I'm not sure how the OnDiscoveringCompled event works.

I'm trying to discover all the BT devices around my workstation, so, after opening the communication, I call the method:
Code: [Select]
radio.Discover(Convert.ToByte(timeout.ToString()), wclBluetoothDiscoverKind.dkClassic);

where timeout is equal to 48 (I read that it's the maximun timeout allowed on Windows).

So I'm expecting that the OnDiscoveringCompled  event would be triggered after 48s but sometimes that happens after just 15-20s. So, I'm not able to find the devices I'm searching for.


Any help will be appreciate so much. Thank you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: How does the OnDiscoveringCompleted event work?
« Reply #1 on: October 07, 2019, 10:20:31 AM »
Hi,

The discovering timeout is not exactly how long Bluetooth driver will discovers for devices. It is just a recomendation for driver. Unfortunately I do not know internal driver's algorithm how it is used there. Usualy discoveing may take longer time that specified. It is because Bluetooth Framework also does some things internally. For example, on Win 7 there is no way to discover only new devices (with MS drivers). Windows 7 always returns paired devices during discovering even they are not availbale. So Bluetooth Framework does additional checks for such devices and it takes time.

However if discovering takes less time then specified then it usually mean that all devices were found and driver decided that there is nothing no new devices,

 

Sitemap 1 2 3 4 5 6 7