I'm running a UWP/C# app in Windows 10 and attempting to connect to a Bluetooth LE device (that was successfully paired) using BluetoothLEDevice.FromIdAsync(). It returns a device object, but it's always in a disconnected state. I've tried re-pairing the device multiple times, but it doesn't help. This device successfully connects in other environments - it's just Windows/UWP where I'm having trouble. Thoughts? After pairing, should a consent dialog automatically appear when attempting to connect?
Asked
Active
Viewed 764 times
0
-
Have you tried to subscribe to BluetoothLeDevice.ConnectionStatusChanged ? What kind of pairing do you use and what is the result ? There is no consent dialog for connection AFAIK, for pairing maybe. – Oswin Jun 15 '17 at 13:03
1 Answers
1
You must interact with it in order to connect to it, for example read/write some GATT value. You can also enable notifications for some characteristic which then will make the Bluetooth stack have a connection open to the device.

Emil
- 16,784
- 2
- 41
- 52
-
I considered that too, but attempting to read/write a value threw an exception. I actually think it might be a timing issue. If I attempt to connect after the first Added event raised from a DeviceWatcher, I get a BluetoothLEDevice in a disconnected state. But connecting upon subsequent Added/Updated events yields a device in a connected state. Perhaps the device was simply not ready. – Dan May 20 '17 at 22:11