How to manage secure conections with multiple peripherals from a central in nRF connect SDK?

Hello people, 

I'm trying to develop an application that consist of a central device and multiple peripherals conected to it simultaneously (if possible, if not, could be by turns) by secure connections to transfer some data. 

So far I have developed the peripheral side based on the samples given in the bluetooth-low-energy-fundamentals course of the nordic academy. It was very helpfull! 

Currently I'm facing to develop the central device which is pretended to peer with a number of peripherals using a keypass (static by now) to bond and stablish a secure connection. 

My question is:

Is there any sample code of a central connecting to a peripheral device using LE secure connection that can help me to start? 

I'm using  nRF connect SDK and nRF52832 and also have an nRF52833dk board.

I have searched in the available samples of the SDK but I havent find a sample ussing a keypass to connect to the peripheral. 

Thank you for your help. 

Parents
  • Hello,

    Look for central BT examples with the following: bt_conn_set_security(conn, BT_SECURITY_L4). From the documentaiton you can find:

    /** Security level. */
    typedef enum __packed {
    	/** Level 0: Only for BR/EDR special cases, like SDP */
    	BT_SECURITY_L0,
    	/** Level 1: No encryption and no authentication. */
    	BT_SECURITY_L1,
    	/** Level 2: Encryption and no authentication (no MITM). */
    	BT_SECURITY_L2,
    	/** Level 3: Encryption and authentication (MITM). */
    	BT_SECURITY_L3,
    	/** Level 4: Authenticated Secure Connections and 128-bit key. */
    	BT_SECURITY_L4,
    	/** Bit to force new pairing procedure, bit-wise OR with requested
    	 *  security level.
    	 */
    	BT_SECURITY_FORCE_PAIR = BIT(7),
    } bt_security_t;

    Kenneth

  • Hello, 

    Thank you for your suggestion and sorry for the delay.

    I was looking from the samples included with the nRF connect SDK but Sadly I can't find any sample with BT_SECURITY_L4.  

    If you could show me any sample or where to find it, I would appreciate it. 

    Thank you!

Reply Children
Related