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

ble_cfg.gap_cfg.role_count_cfg.central_sec_count clarification

I'm trying to reduce the RAM requirements of the softdevice for my application and am looking at some of the options in ble_cfg_t.

What does ble_cfg.gap_cfg.role_count_cfg.central_sec_count actually do?

documentation states

/**< Number of SMP instances shared between all connections acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT. */

If central_sec_count defaults to 1, does that mean I can have only 1 security negotiation (started by pm_conn_secure) happening at a time? If I had a second negotiation start, would I see pm_conn_secure return NRF_ERROR_NO_MEM? This means

If no more authentication procedures can run in parallel for the given role. See @ref sd_ble_gap_authenticate.

Is there a similar setting for peripheral connections?

  • Hi goldwake!

    You pretty much got it correct in your question.
    The central_sec_count defines how many SMP instances that can occur at the same time. If you need to create more than one secure connection simultaniously, then you would have to increase the value of the central_sec_count. If you don't, then you would see the NRF_ERROR_NO_MEM, like you said.
    Increasing/reducing the number of SMP instances will alsso increase/reduce the RAM requirements.

    There are no such setting for the peripheral, because it is always the central that initiate security. The peripheral will only send a security request to the peer (central). Then it is up to the central to initiate pairing or encryption. If the central ignores the request, a timeout event occurs. If the central accepts the request it will initiate security, in which case things happen as if the peer had initiated security itself.

    Best regards,
    Joakim

Related