This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PINCODE

Hi everyone,

Somebody knows if its possible and how to configure a Pin code to establish the connection between the nRF51 peripheral and a phone as a central? Something like 4 or 5 digit pass code.

Thanks!

  • Hi, can you elaborate what you are trying to achieve?

    Is it to pair the phone with the peripheral? Does the peripheral have a display or keyboard? In Bluetooth low energy the pairing pin will be a 6 digit key. It will be generated by the device that have the display, and can not be fixed.

  • Hi,

    I have a nRF51 peripheral with no Display nor keyboard and a mobile phone. I want when the mobile try to connect to the nRF this one ask to the phone for a pincode for bonding. Then if the phone is bonded and try to connect, will not be ask for the pincode.

    I think that this is a common feature in Bluetooth connections, I could be wrong...

    Thanks!!

  • With BLE, it isn't really possible to use a passkey for bonding as long as one of the devices doesn't have a keyboard or display. Table 2.4 in the Bluetooth Core Specification, Volume 3, Part H, section 2.3.5.1 shows which bonding methods are doable depending on the I/O capabilities of the devices in question.

    It could in principle be possible to implement something similar to a passkey in the application, but this could easily become quite complicated, and isn't something I'd normally recommend.

    (Just for completeness: If you have complete control over both ends, you could in principle set both devices to be KeyboardOnly, in which case the table would give Numeric comparison as the method. This means that the user is supposed to enter the same passkey on both devices, and this could in principle then be done by having a static passkey label on one of them and asking the user to enter this on the other device. However, most Central devices (smartphones, tablets, PCs) don't give you such control over the I/O capabilities, making this impossible for most practical use cases.)

  • Thank you very much for the answer.

    I see that is much more complicated than I was thinking. Could you recommend me another way to do something similar? The peripheral to "authorize" the central on the first connection.

  • Hi again , trying to summarize,

    I need some way to authorize the pairing from the peripheral side. Imagine that you have a device and only want a specific smartphone to connect to it, this is my case. So if it is not possible to do it with a passkey because the device dont have a keyboard, it could be possible by holding a button or something similar?

    My device has to buttons which could be use for pairing.

Related