This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

gap_ppcp_set invalid parameters

My call to sd_ble_gap_ppcp_set is returning NRF_ERROR_INVALID_PARAMETER.

I have the following connection interval settings:

#define MIN_CONN_INTERVAL                MSEC_TO_UNITS(500, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL                MSEC_TO_UNITS(1000, UNIT_1_25_MS)
#define SLAVE_LATENCY                    3
#define CONN_SUP_TIMEOUT                 MSEC_TO_UNITS(2000, UNIT_10_MS)

When initializing gap parameters in main.c, I run the following code:

gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency     = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;

err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);

Since it's a softdevice function, I can't see where in the function this error is being thrown. Any ideas/where I can find documentation that might help me?

If I use a shorter MIN_CONN_INTERVAL, the problem goes away, but 1) I want this longer connection interval 2) I've seen tons of example code with 500/1000 connection intervals.

PCA10040 RNF52832 SDK13

  • FormerMember
    0 FormerMember

    The reason for the error NRF_ERROR_INVALID_PARAMETER is the value of connection supervision timeout.

    By Bluetooth Core Specification v. 4.2, vol 6, part B, chapter 4.5.2, the minimum value for connection supervision timeout is the following, it depends on the connection interval and slave latency:

    The connSupervisionTimeout shall be a multiple of 10 ms in the range of 100 ms to 32.0 s and it shall be larger than (1 + connSlaveLatency) * connInterval * 2.

Related