Does the remote device think we are authenticated?

Topics: Bluetooth - Microsoft
Jan 10, 2013 at 10:39 PM
Edited Jan 10, 2013 at 10:40 PM

I'm running in to an odd corner case with bluetooth authentication.

If the host computer believes that we are authenticated, and the device disagrees, the call to BluetoothClient.Connect will pop a pair request dialog on the device.

The user then accepts/declines that request, the host receives the information, and tries again with BluetoothSecurity.PairRequest, resulting in a second pair request dialog on the device.

Unfortunately, I can't change the device firmware.  Is there a way to check whether the device believes us to be authenticated?  


Jan 11, 2013 at 12:40 PM

I'm not sure I'm understanding fully. Is your program calling PairRequest?

I would have expected: Connect atttempt causes pairing dialogs on both devices and the connect should succeed. Of course the pairing dialog can be handled automatically by using BluetoothWin32Authentication

The only way I know of to check if the device has a pairing for the local device is to try to connect to it...... :-,(

Jan 11, 2013 at 5:34 PM

The root of the problem is that the host doesn't really know whether or not the device "remembers" an authentication that happened in the past: the device could have deleted the information.  My first attempt was to use BluetoothDeviceInfo.Authenticated, but that only checks the host's information.

The symptom is that a call to BluetoothClient.Connect will pop a pair dialog on the device side that is currently guaranteed to fail (if the device is not already authenticated).  The information that that unexpected authentication attempt requires isn't available yet, and gathering it ahead of time makes the usual case (the device hasn't lost its authentication) cumbersome.

My question therefore is to ask what the appropriate way to establish a connection with a device that may or may not remember its authentication?


The options I see are:

1) Call connect in a way that it will fail without popping a dialog on the device.

2) Check ahead of time if connect will pop a dialog on the device.

3) Use BluetoothWin32Authentication - that looks perfect.  It appears to only be supported as MSFT/Win32 right now.  I'm fine with the Win32 limitation, but we're hoping to support widcomm as well.