What are the connection parameters for a Bluetooth® Low Energy (BLE) link and how do they affect performance?
The connection parameters for a BLE connection are a set of parameters that determine when and how the central and peripheral in a link transmit data. The parameters are exchanged when the central and peripheral initially connect. It is always the central that actually sets the connection parameters used, but the peripheral can send a Connection Parameter Update Request, that the central can then accept or reject.
The three different parameters are:
- Connection Interval: Determines how often the central will ask for data from the peripheral. When the peripheral requests an update, it supplies a maximum and a minimum wanted interval. The connection interval must be between 7.5 ms and 4 s.
- Slave Latency: By setting a non-zero slave latency, the peripheral can choose not to answer when the central asks for data up to the slave latency number of times. However, if the peripheral has data to send, it can choose to send data at any time. This enables a peripheral to stay sleeping for a longer time if it doesn't have data to send but still send data fast if needed. The textbook example is the keyboard and mouse, which ideally, sleep for as long as possible when there is no data to send but still have low latency (and for the mouse, a low connection interval) when needed.
- Connection Supervision Timeout: This timeout determines the timeout from the last data exchange until a link is considered lost. The central will not try to reconnect before the timeout has passed, so if you have a device that goes in and out of range often and you need to notice when that happens, it might make sense to have a short timeout. Depending on which platform you're working with, there can be platform-specific recommendations or requirements on these. For iOS, Apple® maintains the "Accessory Design Guidelines for Apple Devices" (see the Bluetooth® section), which among other things includes rules on these parameters.