'Windows BLuetooth LE require pairing before connection?
It seems from other posts (all quite old) that Windows 10 BLE requires (external) pairing before one can work with the device.
Is this still true? Can I connect to a device without pairing and control the pairing myself (if needed)
If Windows requires pairing to work with a device, that is bad because many BLE devices do not support pairing.
My use case is remote patient monitoring, where a patient performs measurements with personal health medical devices. The patient needs to do as little as possible. On the Android I do the following and would like to do the same in Windows:
- Scan in the background for BTLE devices my app can work with (filtering on UUIDs; all devices that support the standard health thermometer, pulse ox, BP, Glucose, weigh scale, etc.).
When a supported device is discovered, a popup appears and all user has to do is select connect or no.
If the device needs pairing, it will be done automatically, either because the device sends a security request OR responds with an insufficient authentication error when I try to read/write/enable.
- If confirmation or passkey is needed, a second popup will occur. This is the most difficult part for the user.
- If pairing is not needed, it will never happen. I will never try to pair with a device that does not support it.
- If paired and bonded, the device is added to a list of known devices and when discovered, connection happens automatically with no user intervention.
- If unpairable, the device is still added to a list of known devices and when discovered, connection happens automatically with no user intervention. Of course I have to go through service discovery again.
That is what I would like to emulate on Windows. The user shall need to know nothing about the device except how to use it and, unfortunately, make it pairable and/or connectable which is not standard and a big hurdle. The user should also have as little engagement as possible with the app. The minimum is a one time choice to connect (or not) and a pairing dialog (if needed).
This works great on Android (barring Android's unstable BTLE).
Solution 1:[1]
No.Pairing is not even recommended, unless for security or if you want to combine your connections with Classic Bluetooth to get extra functionality.
With Bluetooth LE it quite common to connect and communicate without pairing. You can even send a small amount of user definable data to any listening devices without any connection at all via advertisement packets. However, if you connect without pairing, then the connection is not secure, because there are no link security keys that may be used to encrypt the connection.
Bonding and pairing in BLE often happen at the same time, but they are technically different. Pairing is part of the link encryption process, which may happen without bonding. Bonding is the long-term storage of encryption info (particularly keys) so that the devices “know” each other and can easily reconnect in an encrypted way. If you enable bondable mode, you are allowing this long-term storage to occur. Without bondable mode, it is still possible to temporarily pair to form an encrypted connection.
Here is a link to a site where it's explained rather good. It is about some specific BLE modules, but it's great information:
https://www.silabs.com/community/wireless/bluetooth/knowledge-base.entry.html/2015/08/06/_reference_bonding-lnVL
Solution 2:[2]
https://github.com/woodemi/quick_blue/issues/78#issuecomment-1078877700
In-app Bluetooth LE discovering available with BlueSoleil Bluetooth drivers and with BLED112 Bluetooth dongle on any Windows platform. With Microsoft Bluetooth drivers:
- On Windows 8 you must discovr and pair with Bluetooth LE device through Windows UI. After device paired you can discover it using in-app discovering methods.
- On Windows 10 1607 and below you also have to pair with Bluetooth LE device through Windows UI. After device paired you can discover it using in-app discovering methods.
- On Windows 10 1703 and above you do not need to pair with your device manually. You can discover nearby Bluetooth LE device using in-app discovering.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Sunbreak |
