iOS Bluetooth LE: Code=6 "The connection has timed out unexpectedly."

After some extensive support from Nordic Semiconductor, the manufacturer of the BLE module on the peripheral, we're pretty sure the cause of this is an inaccurate clock on the iPhone 5C BLE module. That is, it's less accurate than stated in the connection request. Here's my question on the Nordic forums:

https://devzone.nordicsemi.com/question/51258/ios-8-disconnection-code6-the-connection-has-timed-out-unexpectedly/


So I was facing this problem with Microchip BM78 Bluetooth module talking with iOS. I found this tech note which was very helpful: https://developer.apple.com/library/archive/qa/qa1931/_index.html

These settings are flashed onto the BM78 module. Here are the Apple 'rules' from the above tech note:

  • Interval Min ≥ 15 ms (multiples of 15 ms)
  • Interval Min + 15 ms ≤ Interval Max (Interval Max == 15 ms is allowed)
  • Interval Max * (Slave Latency + 1) ≤ 2 seconds
  • Interval Max * (Slave Latency + 1) * 3 < connSupervisionTimeout
  • Slave Latency ≤ 30
  • 2 seconds ≤ connSupervisionTimeout ≤ 6 seconds

My values (working well):

  • Interval Min = 15ms
  • Interval Max = 30ms
  • Slave Latency = 4
  • Connection Supervision Timeout =~ 5 seconds