weliem / bluez_inc

A C library for Bluez (BLE) that hides all DBus communication. It doesn't get easier than this. This library can also be used in C++.
MIT License
84 stars 19 forks source link

Set PIN for peripheral #19

Closed lizziemac closed 7 months ago

lizziemac commented 7 months ago

I didn't see anything in the code or documentation, but it's possible I might have missed something - does this library support setting a PIN for peripheral devices yet? If so, does it have to be 6 digits, or can it be 4?

weliem commented 7 months ago

Hi, returning a 6 digit PIN code is supported. See the section in the Readme on Bonding.

lizziemac commented 7 months ago

Thanks Martijn!

Oh yes, I see that it works the same way exactly for peripherals, I wrongly assumed the bonding section only applied to central devices.

I do have another question now that I'm a little further along: is there a way to set a custom passkey when using the DISPLAY_ONLY method on a peripheral?

Thanks again for all of your help! Liz

lizziemac commented 7 months ago

Never mind, after some research I found that this is not a recommended practice anyways.

GrubbyHalo commented 3 months ago

Never mind, after some research I found that this is not a recommended practice anyways.

@lizziemac I am also trying to setup a peripheral with only authorised access from client/centrals. I'm assuming you had the same issue ? I'm interested to know how you solved the problem. W.r.t. it not being recommended to use a pin for access, can you cite some sources for that ?