pabloesp
Posts: 7
Joined: Fri Jan 16, 2009 1:33 pm
Location: Spain

Unable to connect a not discovered device

Fri Jan 16, 2009 1:45 pm

Hi,

We have a problem using Bluetools with .NETCF 2.0
The PDA is a IPAQ 240 with Widcomm stack.

Our application has to connect to a bluetooth device which exposes a serial service. We are using ConnectDevice(addr,name) to connect without doing a DiscoverDevices() before.

It works OK if we have connected to this MAC address before with that device. But we can not connect if it is the first time that that device connects this MAC address.

We have some devices, for which we know their MAC addresses that shouldn't be visible, but in this case we can never connect them. If we try to open the Stream, it does return an "unknown device" exception.
If the device is visible, we do a DiscoverDevices() and after that a ConnectDevice(addr,name) with their MAC and works OK.

Coult it be an issue with an internal caching feature for MAC addreses? A device MUST be discovered at least once before been connected?

Please excuse my poor english.
Hope you can help us.

Best Regards.
Pablo.

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

RE: Unable to connect a not discovered device

Fri Jan 16, 2009 5:44 pm

This is not a known issue, but it's possible that it's a bug in the later versions of the Widcomm stack. (I assume the iPaq 240 is running Windows Mobile 6 or later?)

Regards,
Jonas

pabloesp
Posts: 7
Joined: Fri Jan 16, 2009 1:33 pm
Location: Spain

RE: Unable to connect a not discovered device

Sat Jan 17, 2009 12:56 pm

Yes. It has Windows Mobile 6. Is there a way to solve or contact Widcomm to repair it?

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

RE: Unable to connect a not discovered device

Sat Jan 17, 2009 6:03 pm

I've tried contacting them about other issues but they don't seem interested.

Regards,
Jonas

pabloesp
Posts: 7
Joined: Fri Jan 16, 2009 1:33 pm
Location: Spain

RE: Unable to connect a not discovered device

Wed Jan 21, 2009 3:54 pm

Jonas,

I've found a solution. The problem is that, when you do the connection without discovery, the configuration values of the remote device are written in registry.
If I connect the remote device without discovery, "ServiceType" and "DeviceName" values are not correctly written in registry. If you do a discovery, they are written OK.

So my solution has been writing this values into registry "by hand", trying to connect without discovery (all other values are written at this moment) and bonding fails, but if you retry bonding, second time it works OK.

I can't know if the problem is that our device do not shows this params in a direct connect or Widcomm stack do not read them.

I have found that manipulating registry can be a good way to solve this kind of problems.

Thanks anyway.

Return to “BlueTools”