DrJukka / Heart-rate-monitor-UWP-

UWP heartrate monitor project with custom graph controls
1 stars 1 forks source link

Connecting and re-connecting to a BLE device. #1

Open marknotgeorge opened 8 years ago

marknotgeorge commented 8 years ago

Hello Jukka,

I too have been playing with BLE devices in a UWP app, in my case a Cycling Speed and Cadence device. I've been having a problem where if I run my app and connect to a freshly paired device, it works, but the second time throws an exception. The device has to be unpaired and re-paired before every run.

From the MSDN forum, it seems others have been having the same problem. Some of these people are also using Heart Rate monitors.

I was wondering if it was an issue you'd come across. I've developed a workaround which involves using the new pairing and unpairing APIs in build 10586, but it's a huge kludge and I'm still looking for something a bit more elegant.

Thanks for your time,

Mark

DrJukka commented 8 years ago

I just tested my app, and it does work without issues. Anyway, I'm using Windows 10 as platform, thus if you are using older platforms, there might be something additional there.

Only issue I had was with ReadClientCharacteristicConfigurationDescriptorAsync(), when using my own android based simulator, for some reason it appeared to hang, thus I ignored that step and went directly to use WriteClientCharacteristicConfigurationDescriptorAsync(), which indeed works fine. And I did not see any issues with the ReadClientCharacteristicConfigurationDescriptorAsync when I used android device as a receiver.