What does security mode and level 0 mean?

Hello,

I am using nrf52832 as a peripheral and running SD S112, nordic UART Profile and SDK 17.1.0 on it.

In the UART example the security mode and security level is set as 0.

The description in ble_gap.h says

/**@brief GAP connection security modes.

*

* Security Mode 0 Level 0: No access permissions at all (this level is not defined by     the Bluetooth Core specification).\n

* Security Mode 1 Level 1: No security is needed (aka open link).\n

* Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\n

* Security Mode 1 Level 3: MITM protected encrypted link required.\n

* Security Mode 1 Level 4: LESC MITM protected encrypted link using a 128-bit strength    encryption key required.\n

* Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary. \n

* Security Mode 2 Level 2: MITM protected signing required, unless link is MITM           protected encrypted.\n

My question is what does mode 0 and Level 0 mean? It is mentioned No access permission at all. Is it similar to mode 1, level 1 (aka open link)?

Thank you

Parents Reply
  • Thank you Susheel for your quick reply.

    Where can I define the security mode and levels in the code?

    Right now I see it is in gap_params_init() function and setting the security mode as 

    ble_gap_conn_sec_mode_t sec_mode = {0};

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

    sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)ble_config.dname, strlen((const char *)ble_config.dname));

    Is this correct?

Children
Related