Author Topic: Unexpected behavior with Radio.Discover() timeout  (Read 16851 times)

Offline MrPaulCarpenter

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
Unexpected behavior with Radio.Discover() timeout
« on: December 20, 2018, 04:25:24 PM »
I had been using a value of 10 for timeout with : Radio.Discover(10, wclBluetoothDiscoverKind.dkClassic);

And changed  it to 90, because I observed that sometimes discovery goes well past 30 seconds.
When set to 90:

Int res = Radio.Discover(90, wclBluetoothDiscoverKind.dkClassic);

res is 0 (good)

Callback wclBluetoothManager_OnDiscoveringStarted() is called (also, good)

But callback wclBluetoothManager_OnDiscoveringCompleted(), is called nearly immediately, with
an error value of :
Error=0x000000010000 One or more arguments passed into the method or function are invalid

I have switched back to using 10, but am not sure how to correctly use that parameter.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Unexpected behavior with Radio.Discover() timeout
« Reply #1 on: December 20, 2018, 04:31:52 PM »
Hello,

For Microsoft the maximum allowed value is 48.

Timeout

Quote
A value that indicates the time out for the inquiry, expressed in increments of 1.28 seconds. For example, an inquiry of 12.8 seconds has a Timeout value of 10. The maximum value for this member is 48. When a value greater than 48 is used, the calling function immediately fails and returns E_INVALIDARG.

 

Sitemap 1 2 3 4 5 6 7