Pre-pair a bluetooth device?

Hi,

We have a HID bluetooth device that’s very difficult to pair on Windows (7 and 8/8.1, Microsoft BT stack).
Mainly because the device only stays discoverable for a few seconds, not long enough for Windows to finish the pairing reliably.

We know all the details about the device we want to pair (vid, pid, Address, cod, services…).
To workaround the pairing problem, one idea is to “fake” (or pre-pair) the device, so when it wants to connect, Windows sees it at already paired.

My question is: how can we programmatically (usermode or kernelmode code?) “add” and pair a new BT device (the link key can be pre-generated and send to the device by other method, like usb or nfc).

Any suggestions is greatly appreciated!
Thx

William Levra-Juillet wrote:

Mainly because the device only stays discoverable for a
few seconds, not long enough for Windows to finish the
pairing reliably.

Uhh, I think you need to fix your device instead of worrying about “pre-pairing” it. Are you going to “pre-pair” it with Linux? Mac? Someones phone? Car?

That’s almost as bad as Microsoft BT mouse that won’t stay paired to MS BT stack in Windows 8. You would have thought that Microsoft at least makes sure their hardware works with their software.

Thank you Chris,
But that does not really help.

The device is already pairing fine on its preferred “host” (based on freeBSD)
It also pairs fine on mac and linux (bluez stack) using the “pre-pairing” method described above.

The problem is now on Windows. From the user mode BT stack API, we couldn’t find a way to add/pair a new device.
Is there any way we can achieve that?

Any suggestions welcome and appreciated :slight_smile:
Thx!

Did you try http://msdn.microsoft.com/en-us/library/windows/desktop/aa362770(v=vs.85).aspx

Sent from my iPhone

On Nov 18, 2014, at 8:48 AM, xxxxx@gmail.com wrote:

Thank you Chris,
But that does not really help.

The device is already pairing fine on its preferred “host” (based on freeBSD)
It also pairs fine on mac and linux (bluez stack) using the “pre-pairing” method described above.

The problem is now on Windows. From the user mode BT stack API, we couldn’t find a way to add/pair a new device.
Is there any way we can achieve that?

Any suggestions welcome and appreciated :slight_smile:
Thx!


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

That requires the remote device cooperation which is not happening here

d

Bent from my phone


From: Ramana Reddy Polakamailto:xxxxx
Sent: ?11/?18/?2014 6:32 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] Pre-pair a bluetooth device?

Did you try http://msdn.microsoft.com/en-us/library/windows/desktop/aa362770(v=vs.85).aspx

Sent from my iPhone

On Nov 18, 2014, at 8:48 AM, xxxxx@gmail.commailto:xxxxx wrote:

Thank you Chris,
But that does not really help.

The device is already pairing fine on its preferred “host” (based on freeBSD)
It also pairs fine on mac and linux (bluez stack) using the “pre-pairing” method described above.

The problem is now on Windows. From the user mode BT stack API, we couldn’t find a way to add/pair a new device.
Is there any way we can achieve that?

Any suggestions welcome and appreciated :slight_smile:
Thx!


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

As mentioned by Doron, BluetoothAuthenticateDevice(Ex) requires the device to be physically within reach and in “discoverable” mode, which is not the case (and when it is, the function fails because the device is already off by the time the function is called or completes)

What we want to achieve is add/pair the device “offline” (without the device being available).
We tried to manually generate the right registry keys/values, but it requires a machine reboot (restarting the bthserv service doesn’t seem to be enough). And even after a reboot the device could not connect. Obviously, we missed some important keys.

Surely there is a way to add a device programmatically…

Are you planning to sell this device? If yes, then go fix the device that it plays well. Otherwise just write it off before incurring more losses.

Thank you Alex,
I appreciate your suggestions.

The device is at it is (and already selling for years), but was not designed to work with 3rd party platforms (ie Windows, mac, linux…).
New project requires Windows pairing (we already have a solution for Mac and Linux).
So any help regarding my original question is greatly appreciated.
Thx.

I think it is a crypto stuff, and is probably not possible without the device interacting in crypto exchange.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi,
>
> We have a HID bluetooth device that’s very difficult to pair on Windows (7 and 8/8.1, Microsoft BT stack).
> Mainly because the device only stays discoverable for a few seconds, not long enough for Windows to finish the pairing reliably.
>
> We know all the details about the device we want to pair (vid, pid, Address, cod, services…).
> To workaround the pairing problem, one idea is to “fake” (or pre-pair) the device, so when it wants to connect, Windows sees it at already paired.
>
> My question is: how can we programmatically (usermode or kernelmode code?) “add” and pair a new BT device (the link key can be pre-generated and send to the device by other method, like usb or nfc).
>
> Any suggestions is greatly appreciated!
> Thx
>

On 19-Nov-2014 17:19, xxxxx@broadcom.com wrote:

Are you planning to sell this device? If yes, then go fix the device that it plays well. Otherwise just write it off before incurring more losses.

In the days of yore, cool hardware had to be “Designed for Windows”,
or at least be “Compatible”. Alas, the days long gone.
– pa