We found the devices developed with nrf51 and nrf52 will disconnected from the iphone sometimes, and we can't find the real reason.
I study the gap parameters on nrf51 and nrf52 sdk, found the default value:
#define APP_TIMER_PRESCALER 0 /**< Value of the RTC1 PRESCALER register. */
#define APP_TIMER_OP_QUEUE_SIZE 4 /**< Size of timer operation queues. */
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(40, UNIT_1_25_MS)
#define SLAVE_LATENCY 2 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(3000, UNIT_10_MS)
and I found the values ios recommend's are:
intervalMax*(slaveLatency+1) <= 2 seconds
intervalMin >= 20 ms
intervalMin + 20 ms <= intervalMax
SlaveLatency <= 4
connsupervisionTimeout <= 6 seconds
intervalMax *(slavelatency+1)*3 < connsupervisionTimeout [6 seconds]
I have some personal ideas about Bluetooth gap parameters: maybe the sdk's gap param value is set at the boundary to meet the ios's need. Is the minute error caused by timing lead the value to fail meet the ios requirement?
why SDK can't set the param value to Leave some allowance, for example:
set : #define MIN_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(60, UNIT_1_25_MS)