0

I want to read the HeartRateMeasurement characteristic of a ble device, this requires pairing.

The program will run on a display without a input device so I've used ConfirmOnly for pairing so far. This worked fine for another device that usually requires a pin.

The HeartRate device gets paired succesfully with ConfirmOnly but the HeartRateMeasurement characteristic remains read restricted.

When using the pin the HeartRateMeasurement characteristic becomes readable.

Why is ConfirmOnly acting differently than ProvidePin?

Would it be possible to use ProvidePin without user input, i.e just accepting it without checking the pin?

timhi
  • 21
  • 2
  • It is because if you use ConfirmOnly there is no authentication (pairing) actually (and encryption is disabled). So yes, you have to use more secure PIn pairing. Yes, you can provide PIN in the authentication (pairing) handler. Use CustomPairing class. – Mike Petrichenko Aug 29 '19 at 15:06
  • @MikePetrichenko I have implemented ProvidePin but my issue is I won't be having a option to input the Pin. Is there a way to avoid this? – timhi Aug 29 '19 at 15:20
  • You do not need any user action. Simple provide predefined PIN. – Mike Petrichenko Aug 29 '19 at 15:34
  • @MikePetrichenko could you elaborate what you mean by "provide predefined PIN"? The device I'm pairing displays a randomly generated pin, I need to enter this pin in the DevicePairingKind.ProvidePin handler. – timhi Aug 29 '19 at 15:48
  • It is called Passkey entering. PIN is legacy PIN pairing. There are also Passkey notification (when device sends numeric passkey to your device and you have to type it on devices keyboard) and Numeric Confirmation (which is also used in Confirm only) pairings. So your device uses Passkey Notification. Unfortunately you can not use it with your device that has no keyboard. – Mike Petrichenko Aug 29 '19 at 16:51
  • Ok, thank you for clarifying . – timhi Aug 29 '19 at 18:00

0 Answers0