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

some ideas about the gap parameter in sdk

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)

I don't know if I think it makes sense.
Parents
  • Hi zk, 

    I don't think that would be the reason the iPhone disconnect. Even if you have preferred connection parameter that doesn't match with the guideline, the phone will just ignore it.

    How long did it usually take until the phone disconnect ? Do you have your application running on the foreground when disconnection happened ? The phone may disconnect if it's a background application with no activity. Do you see the same problem when testing with one of our example ? 

    Could you capture a sniffer trace ? 

Reply
  • Hi zk, 

    I don't think that would be the reason the iPhone disconnect. Even if you have preferred connection parameter that doesn't match with the guideline, the phone will just ignore it.

    How long did it usually take until the phone disconnect ? Do you have your application running on the foreground when disconnection happened ? The phone may disconnect if it's a background application with no activity. Do you see the same problem when testing with one of our example ? 

    Could you capture a sniffer trace ? 

Children
Related