rharrison
Posts: 31
Joined: Fri Oct 12, 2007 6:40 pm
Location: United Kingdom

Discovery doesn't discover

Fri Oct 31, 2008 2:51 pm

This problem has been observed on an HP iPAQ 2490 with Widcomm BT stack 1.7.1 build 1424 and an iPAQ 114 with Widcomm BT stack 1.8 build 5600.

The environment is such that the PDAs have recently been powered up out of standby (I don't think you can turn these models fully off) and a Bluetooth discovery has been started via DiscoverDevicesAsync(). The problem is that no device discovered notifications are received by my application.

I reckon that this is a long standing issue that I have not fully understood before. Previously, I thought this issue was caused by the underlying BT stack becoming unresponsive (indeed a separate issue), the blue LED is flashing on the device but you cannot connect or discover devices, even using the 'Bluetooth Manager' application that comes with the PDA. However, in the case of the above I was able to discover the BT devices in the vicinity using the PDA Bluetooth Manager, but could discover nothing with my application.

Soft-resetting the device allowed the discovery to work correctly once more. I would like to blame my application, but it doesn't do anything special other than start the discovery and receive the device discovered notifications. So could there be a problem in Bluetools with discovery?

I repeated the test on a Fujitsi Pocket Loox N560 with a Microsoft BT stack, brought out of standby after several days of inactivity. No problems with this one, devices were discovered fine.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Discovery doesn't discover

Fri Oct 31, 2008 3:22 pm

The Widcomm stack is very volatile. It's likely that it doesn't come out of the hibernation properly.

Regards,
Jonas

rharrison
Posts: 31
Joined: Fri Oct 12, 2007 6:40 pm
Location: United Kingdom

RE: Discovery doesn't discover

Fri Oct 31, 2008 4:10 pm

Originally posted by Jonas

The Widcomm stack is very volatile. It's likely that it doesn't come out of the hibernation properly.

But once in this state, you can still discover devices via 'Bluetooth Manager' (Start menu->Settings->Connections->Bluetooth) but not with my Bluetools-based application? So the stack appears to still be working.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Discovery doesn't discover

Fri Oct 31, 2008 4:20 pm

The Bluetooth manager is probably not hooked in the same way that the SDK is however. It probably has a more direct way of "talking" to the stack.
Or possibly the built-in manager reconnects to the stack when it comes out of hibernation. BlueTools on the other cannot do this as you must Dispose() of the Bluetooth manager to do this and then you cannot reconnect to it again without restarting your application.
To test the hypothesis, does it work if you restart your application?

Regards,
Jonas

rharrison
Posts: 31
Joined: Fri Oct 12, 2007 6:40 pm
Location: United Kingdom

RE: Discovery doesn't discover

Fri Oct 31, 2008 5:00 pm

Originally posted by Jonas

To test the hypothesis, does it work if you restart your application?

Excellent question. I will have to wait until I can get a PDA into this state again and then I will post my results. If I Dispose() the Manager I guess I cannot create a new instance via GetManager() ?

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Discovery doesn't discover

Fri Oct 31, 2008 9:06 pm

No, you cannot.

Regards,
Jonas

rharrison
Posts: 31
Joined: Fri Oct 12, 2007 6:40 pm
Location: United Kingdom

RE: Discovery doesn't discover

Fri Nov 28, 2008 5:26 pm

Sure enough. I had a PDA (iPAQ 110 series) application that was refusing to discover anything even though the embedded 'Bluetooth Manager' was discovering devices in range. Restarting the application fixed the problem.

Would using the Network.RadioStatus property help in this circumstance, i.e. if I detected the device coming out of standby followed by setting this property to 'Connectable'?

Ideally I would like to avoid having to restart the app when coming out of standby.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Discovery doesn't discover

Fri Nov 28, 2008 6:21 pm

An iPaq will run a Widcomm stack and RadioStatus doesn't affect the actual radio, so no changing the setting shouldn't make any difference.

Regards,
Jonas

rharrison
Posts: 31
Joined: Fri Oct 12, 2007 6:40 pm
Location: United Kingdom

RE: Discovery doesn't discover

Wed Feb 11, 2009 5:55 pm

Regarding this issue (sorry for the gaps inbetween) what state information does Bluetools hold on the Widcomm Bluetooth stack going in/out of standby? I ask as going forward this is beginning to present a problem

Return to “BlueTools”