1. nrf51822-qfaa
2. sdk10.0 & sd8.00
Q:
If the MAX_CONN_INTERVAL is set to greater than 200, NRF_ERROR_INVALID_PARAM will be returned when called sd_ble_gap_ppcp_set().
core v4.0:
1. nrf51822-qfaa
2. sdk10.0 & sd8.00
Q:
If the MAX_CONN_INTERVAL is set to greater than 200, NRF_ERROR_INVALID_PARAM will be returned when called sd_ble_gap_ppcp_set().
core v4.0:
Hello,
The problem is that the CONN_SUP_TIMEOUT is too short in your connection parameter settings.
If you look in the file ble_gap.h, you will see some constraints from line 711:
* @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:
* conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval
* that corresponds to the following Bluetooth Spec requirement:
* The Supervision_Timeout in milliseconds shall be larger than
* (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds.
A bit confusing, but we have two constraints here. It seems that your slave_latency = conn_latency = 0.
1st condition: conn_sup_timeout * 4 > max_conn_interval.
2nd condition: conn_sup_timeout > (1 + 0) * max_conn_interval*2 = 2*max_conn_interval.
These constraints might seem a bit contradicting, but I assume (not 100% sure) that slave_latency = 0 counts as "not specified", and hence, the 2nd condition applies. Hence, you can't have a conn_sup_timeout < 2 * max_conn_interval.
So try to increase the conn_sup_timeout (to e.g. 4000 = 4 sec).
Best regards,
Edvin
Hi, Edvin
Thanks for your help, increase the conn_sup_timeout can slove this problem.
Glad it worked out. You must have a conn_sup_timeout > 2 * max_conn_interval. If not, missing even one packet will cause the link to be lost, which is probably why it is a requirement in the BLE specification.