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

About conn_params_init and sec_params_init

My device is smart watch. We transfer some data to phone and receive notification from phone over BLE. My question is those two functions(connect_params_init and sec_params_init) use for what? Can I delete those two functions?

Or please explain why do I need these two functions.

Thank you.

Parents
  • Sorry for the late answer.

    sec_params_init initializes the struct that is passed to the softdevice and then to the peer device to say what kind of security parameters should be used. This must for example be set to show what kind of I/O capabilites your device have, whether you want to bond or use MITM protection and key sizes. It can hence not be removed. You can take a look at the first part of this Message Sequence Chart to see how it's used.

    conn_params_init initializes the ble_conn_params module. This is an SDK module that is responsible for requesting new connection parameters if the Central doesn't use parameters that are compatible with what the Peripheral device wants. If you don't want to send such requests, it can in principle be removed, but I would normally not recommend it. Take a look at this question to understand better what connection parameters are and how they are negotiated.

Reply
  • Sorry for the late answer.

    sec_params_init initializes the struct that is passed to the softdevice and then to the peer device to say what kind of security parameters should be used. This must for example be set to show what kind of I/O capabilites your device have, whether you want to bond or use MITM protection and key sizes. It can hence not be removed. You can take a look at the first part of this Message Sequence Chart to see how it's used.

    conn_params_init initializes the ble_conn_params module. This is an SDK module that is responsible for requesting new connection parameters if the Central doesn't use parameters that are compatible with what the Peripheral device wants. If you don't want to send such requests, it can in principle be removed, but I would normally not recommend it. Take a look at this question to understand better what connection parameters are and how they are negotiated.

Children
No Data
Related