Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: MrPaulCarpenter on December 20, 2018, 04:25:24 PM

Title: Unexpected behavior with Radio.Discover() timeout
Post by: MrPaulCarpenter 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.
Title: Re: Unexpected behavior with Radio.Discover() timeout
Post by: Mike Petrichenko 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.