Nordic Developer Academy BLE NUS Example with Pairing and Bonding: various problems

Hi Support Team,

I am encountering various problems with the Developer Academy example found here:

https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-4-bluetooth-le-data-exchange/topic/blefund-lesson-4-exercise-3/

1. Unable to debug without GATT errors

To overcome this issue I used logging but:

2. Logging is not working. None of the LOG directives is working

The cause why I need this is:

3. I set CONFIG_BT_NUS_SECURITY_ENABLED=y but nothing happend - security is not working

Could you tell me at least how to get the security in the example working?

Also logging is needed

Many thanks in advance.

Regards, Andreas

  • Hi Andreas, 

    The recommended way to trigger pairing/bonding is to let the central to connect, discover service and read/write a characteristic that requires security. 
    This is the recommendation from Apple guide line:https://www.bluetooth.com/wp-content/uploads/attachments/BluetoothDesignGuidelines.pdf

    See section 11.10: 
    The accessory should not request pairing until an ATT request is rejected using the Insufficient Authentication error code. See the Bluetooth 4.0 specification, Volume 3, Part F, Section 4 for details. If, for security reasons, the accessory requires a bonded relationship with the Central, the Peripheral should reject the ATT request using the Insufficient Authentication error code, as appropriate. As a result, the device may proceed with the necessary security procedures

    What you are doing may work in many cases, but as it's not recommended by Apple (and adopted by other vendors as well), it's suggested to do what we do at Lesson 5 Ex 1. 

Related