// Minimum connection interval (units of 1.25ms, 80=100ms) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 80 //最小连接间隔
// Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 800 //最大连接间隔
// Slave latency to use if automatic parameter update request is enabled
#define DEFAULT_DESIRED_SLAVE_LATENCY 0 //可忽略连接间隔的次数,默认是不忽略
// Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_CONN_TIMEOUT 1000 //连接超时时间,连接IOS时此参数必须小于6S
// Whether to enable automatic parameter update request when a connection is formed
#define DEFAULT_ENABLE_UPDATE_REQUEST TRUE //使能连接参数更新请求
// Connection Pause Peripheral time value (in seconds)
#define DEFAULT_CONN_PAUSE_PERIPHERAL 6 //有时当CC2541断开连接时,主机端过10S才会断开,此时将此数值改小可让主机快速发现断开连接
// Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_CONN_TIMEOUT 100//1000 //连接超时时间,连接IOS时此参数必须小于6S
•Interval Max * (Slave Latency + 1) <= 2 s
•Interval Min >= 20 ms
•Interval Min + 20 ms <= Interval Max
•Slave Latency <= 4
•ConnSupervisionTimeout <= 6 s
•Interval Max * ( Slave Latency + 1) * 3 < ConnSupervisionTimeout
根据上述要求,要特别注意的是下面两点:
1、最大连接间隔要比最小连接间隔大20ms。
#define GAPROLE_NO_ACTION 0 // Take no action upon unsuccessful parameter updates
#define GAPROLE_RESEND_PARAM_UPDATE 1 // Continue to resend request until successful update
#define GAPROLE_TERMINATE_LINK 2 // Terminate link upon unsuccessful parameter updates