Author Topic: Get paired and connected devices without running discovering function  (Read 19736 times)

mariluz.costa

  • Guest
Hi,

Does anybody know a way to get BlueSoleil's infos about paired and connected devices not using  myWCLBluetoothDiscovery.Discovery()?
My purpose: I want to save time and get wich devices BlueSoleil has discovered.

Thank you for your help.
Mariluz

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Get paired and connected devices without running discovering function
« Reply #1 on: February 01, 2016, 03:10:46 PM »
Hi,

The Discovery method takes 2 parameters: the first one is Timeout - used for limit time for discovering procedure (default value is 30 seconds). The second one if Fast The default value is "False" which means execute full discovering. If you set this second "Fast" parameter to "True" then the Discovery method returns only already paired devices.

Once you get this list (it executes fast) you can call wclBluetoothDevice.GetConnected() method which returns "True" through its "Value" parameter if the device is connected.

mariluz.costa

  • Guest
Re: Get paired and connected devices without running discovering function
« Reply #2 on: February 01, 2016, 04:16:09 PM »
Thank you for your answer Mike.

I didn't explain very well my problem.
Imagine I start the BlueSoleil application. It discovers and shows a list with devices it finds. I want my application to get this list and show it immediatly with no need to run discovery function.

First time: BlueSoleil is already started, has discovered devices and has made a list
Second time: I start my application and I want to use a function like ''myRadio.GetDevices()" and then "myDevices.select (d => d.paired == true)".

I hope I explained better this time.
Mariluz


Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Get paired and connected devices without running discovering function
« Reply #3 on: February 01, 2016, 04:23:08 PM »
That is exactly I offered you. When you set "Fast" to "True" WCL does not execute discovering. it simple returns already found/paired devices (this is for not only BlueSoleil but for any supported drivers). When "Fast" is "False" the Discover executes real discovering. But when "Fast" is "True" WCL calls absolutely different API function which returns already found/paired devices. Just to make it simple in use WCL has one method for both situations.

But you should know that in some cases BlueSoleil (others do not) may clear paired devices list until next full discovering. It may appears after full OS restart for example.

mariluz.costa

  • Guest
Re: Get paired and connected devices without running discovering function
« Reply #4 on: February 01, 2016, 05:26:29 PM »
Great!

Thank you Mike for your patience and explanations.
Mariluz

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Get paired and connected devices without running discovering function
« Reply #5 on: February 01, 2016, 05:30:22 PM »
You are very welcome.

 

Sitemap 1 2 3 4 5 6 7