Connection interval versus effective connection interval with slave latency

The Bluetooth LE connection parameters tell the Bluetooth hardware how to maintain a GATT connection. They control how fast communication is and how much power the device needs. Usually they do not need to be changed, because the vendor of the remote device has already tuned them. However, to increase the data transfer rate or save battery, they often do need to be adjusted.

Before Windows 11 there was no way to change them. Microsoft later added the feature, so on Windows 11 an application can change the current connection parameters of a BLE GATT link. On earlier Windows versions, the BLED112 USB Bluetooth dongle is the way to do it.


The three parameters

Connection parameters affect power consumption, data transfer speed, and stability. The central and peripheral exchange them when they first connect. The central always sets the parameters actually used, but the peripheral can send an update request that the central can accept or reject. It is important to understand the units used by the Bluetooth stack when sending these values.

Connection interval

Determines how often the central asks the peripheral for data. The connection interval must be between 7.5 ms and 4 s. Unit: 1.25 ms. For example, a value of 80 means 80 * 1.25 = 100 ms.

The connection interval has an inverse effect on throughput:

DataThroughput = (8 * BytesPerPacket * PacketsPerInterval * 1000) / ConnectionInterval

Slave latency

With 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. This allows a peripheral to stay asleep longer when idle while remaining able to send data quickly when needed. Slave latency is the main lever for reducing power consumption.

Supervision timeout

Determines the timeout from the last data exchange until a link is considered lost. Unit: 10 ms. For example, a value of 800 means 800 * 10 = 8000 ms (8 seconds).


Effective connection interval

The effective connection interval is the time between two connection events, assuming the slave skips the maximum number of events allowed by slave latency. If slave latency is 0, it equals the actual connection interval.

Slave latency is the maximum number of events that can be skipped, from 0 to 499. The resulting effective connection interval must not exceed 16 s. The formula is:

Effective Connection Interval = Connection Interval * (1 + Slave Latency)

Example: with a connection interval of 80 (100 ms) and a slave latency of 4, the effective connection interval is 100 ms * (1 + 4) = 500 ms.


Trade-offs

The effective connection interval is what matters when selecting or requesting parameters. Each direction has its own effect.

Reducing the connection interval

  • Increases power consumption for both devices.
  • Increases throughput in both directions.
  • Reduces the time for sending data in either direction.

Increasing the connection interval

  • Reduces power consumption for both devices.
  • Reduces throughput in both directions.
  • Increases the time for sending data in either direction.

Reducing slave latency (or setting it to zero)

  • Increases power consumption for the peripheral device.
  • Reduces the time for the peripheral device to receive data sent from the central.

Increasing slave latency

  • Reduces power consumption for the peripheral when it has no data to send.
  • Increases the time for the peripheral device to receive data sent from the central.

Setting connection parameters

If an application uses the standard Microsoft UWP Bluetooth LE API and runs on Windows 11, it can set predefined connection parameters through that API. The predefined sets are:

  • Balanced — a balance between throughput and power usage.
  • Power Optimized — a more power-efficient set, optimized for power at the expense of throughput.
  • Throughput Optimized — a more aggressive set, optimized for faster throughput at the expense of power.

There are two problems with the UWP API: it is available only on Windows 11, and it does not allow custom values. The Bluetooth Framework removes both. It allows changing parameters on any Windows version with the BLED112 dongle, and it allows custom values on any platform.

Parameters can be managed from both sides of the connection: from the GATT Client (Central) and from the GATT Server (Peripheral). Below are examples for both roles.

Reading current parameters (GATT Client)

To read the currently used parameters from the client side, use the GetConnectionParams method of the wclGattClient.

var
  Params: TwclBluetoothLeConnectionParameters;
  Res: Integer;
begin
  Res := wclGattClient.GetConnectionParams(Params);
  if Res = WCL_E_SUCCESS then begin
    Trace('Connection interval: ' + IntToStr(Params.Interval));
    Trace('Connection latency: ' + IntToStr(Params.Latency));
    Trace('Link timeout: ' + IntToStr(Params.LinkTimeout));
  end;
end;
TwclBluetoothLeConnectionParameters Params;
int Res = wclGattClient->GetConnectionParams(Params);
if (Res == WCL_E_SUCCESS)
{
    Trace("Connection interval: " + IntToStr(Params.Interval));
    Trace("Connection latency: " + IntToStr(Params.Latency));
    Trace("Link timeout: " + IntToStr(Params.LinkTimeout));
}
wclBluetoothLeConnectionParameters Params;
Int32 Res = Client.GetConnectionParams(out Params);
if (Res == wclErrors.WCL_E_SUCCESS)
{
    Trace("Connection interval: " + Params.Interval.ToString());
    Trace("Connection latency: " + Params.Latency.ToString());
    Trace("Link timeout: " + Params.LinkTimeout.ToString());
}
Dim Params As wclBluetoothLeConnectionParameters
Dim Res As Int32 = Client.GetConnectionParams(Params)
If Res = wclErrors.WCL_E_SUCCESS Then
    Trace("Connection interval: " + Params.Interval.ToString())
    Trace("Connection latency: " + Params.Latency.ToString())
    Trace("Link timeout: " + Params.LinkTimeout.ToString())
End If
wclBluetoothLeConnectionParameters Params;
int Res = wclGattClient.GetConnectionParams(Params);
if (Res == WCL_E_SUCCESS)
{
    Trace(_T("Connection interval: ") + IntToStr(Params.Interval));
    Trace(_T("Connection latency: ") + IntToStr(Params.Latency));
    Trace(_T("Link timeout: ") + IntToStr(Params.LinkTimeout));
}

Setting parameters (GATT Client)

The client can request predefined or custom parameters. Note that the server may reject the request.

var
  ParamsValue: TwclBluetoothLeConnectionParametersValue;
  Params: TwclBluetoothLeConnectionParametersType;
  Res: Integer;
begin
  // Predefined parameters:
  Res := wclGattClient.SetConnectionParams(ppBalanced);
  
  // Or custom parameters (Interval 84 = 105ms, Timeout 800 = 8000ms):
  ParamsValue.MinInterval := 84;
  ParamsValue.MaxInterval := 84;
  ParamsValue.Latency := 0;
  ParamsValue.LinkTimeout := 800;
  Res := wclGattClient.SetConnectionParams(ParamsValue);
end;
int Res = wclGattClient->SetConnectionParams(ppBalanced);

TwclBluetoothLeConnectionParametersValue ParamsValue = { 84, 84, 0, 800 };
Res = wclGattClient->SetConnectionParams(ParamsValue);
Int32 Res = Client.SetConnectionParams(wclBluetoothLeConnectionParametersType.ppBalanced);

wclBluetoothLeConnectionParametersValue ParamsValue = new wclBluetoothLeConnectionParametersValue();
ParamsValue.MinInterval = 84;
ParamsValue.MaxInterval = 84;
ParamsValue.Latency = 0;
ParamsValue.LinkTimeout = 800;
Res = Client.SetConnectionParams(ParamsValue);
Dim Res As Int32 = Client.SetConnectionParams(wclBluetoothLeConnectionParametersType.ppBalanced)

Dim ParamsValue As New wclBluetoothLeConnectionParametersValue()
ParamsValue.MinInterval = 84
ParamsValue.MaxInterval = 84
ParamsValue.Latency = 0
ParamsValue.LinkTimeout = 800
Res = Client.SetConnectionParams(ParamsValue)
int Res = wclGattClient.SetConnectionParams(ppBalanced);

wclBluetoothLeConnectionParametersValue ParamsValue = { 84, 84, 0, 800 };
Res = wclGattClient.SetConnectionParams(ParamsValue);

Reading and Setting parameters (GATT Server)

The GATT Server can also inspect the current connection parameters and request changes using the wclGattServerClient object.

var
  Params: TwclBluetoothLeConnectionParameters;
  ParamsValue: TwclBluetoothLeConnectionParametersValue;
  Res: Integer;
begin
  // Read current
  if Client.GetConnectionParams(Params) = WCL_E_SUCCESS then
    Trace('Interval: ' + IntToStr(Params.Interval));

  // Set custom
  ParamsValue.MinInterval := 84;
  ParamsValue.MaxInterval := 84;
  ParamsValue.Latency := 0;
  ParamsValue.LinkTimeout := 800;
  Res := Client.SetConnectionParams(ParamsValue);
end;
TwclBluetoothLeConnectionParameters Params;
if (Client->GetConnectionParams(Params) == WCL_E_SUCCESS)
    Trace("Interval: " + IntToStr(Params.Interval));

TwclBluetoothLeConnectionParametersValue ParamsValue;
ParamsValue.MinInterval = 84;
ParamsValue.MaxInterval = 84;
ParamsValue.Latency = 0;
ParamsValue.LinkTimeout = 800;
int Res = Client->SetConnectionParams(ParamsValue);
wclBluetoothLeConnectionParameters Params;
if (Client.GetConnectionParams(out Params) == wclErrors.WCL_E_SUCCESS)
    Trace("Interval: " + Params.Interval.ToString());

wclBluetoothLeConnectionParametersValue ParamsValue = new wclBluetoothLeConnectionParametersValue();
ParamsValue.MinInterval = 84;
ParamsValue.MaxInterval = 84;
ParamsValue.Latency = 0;
ParamsValue.LinkTimeout = 800;
Int32 Res = Client.SetConnectionParams(ParamsValue);
Dim Params As wclBluetoothLeConnectionParameters
If Client.GetConnectionParams(Params) = wclErrors.WCL_E_SUCCESS Then
    Trace("Interval: " + Params.Interval.ToString())
End If

Dim ParamsValue As New wclBluetoothLeConnectionParametersValue()
ParamsValue.MinInterval = 84
ParamsValue.MaxInterval = 84
ParamsValue.Latency = 0
ParamsValue.LinkTimeout = 800
Dim Res As Int32 = Client.SetConnectionParams(ParamsValue)
wclBluetoothLeConnectionParameters Params;
if (Client->GetConnectionParams(Params) == WCL_E_SUCCESS)
    Trace(_T("Interval: ") + IntToStr(Params.Interval));

wclBluetoothLeConnectionParametersValue ParamsValue;
ParamsValue.MinInterval = 84;
ParamsValue.MaxInterval = 84;
ParamsValue.Latency = 0;
ParamsValue.LinkTimeout = 800;
int Res = Client->SetConnectionParams(ParamsValue);

Handling parameter changes

When parameters are successfully changed by either side, the framework fires an event. This allows you to update your UI or adjust application logic (e.g., modifying data transfer rates) accordingly.

// GATT Client side
procedure TfmMain.wclGattClientConnectionParamsChanged(Sender: TObject);
begin
  TraceEvent(wclGattClient.Address, 'Connection params changed', '', '');
  GetConnectionParams; // Your method to read and display them
end;

// GATT Server side
procedure TfmMain.wclGattServerConnectionParamsChanged(Sender: TObject;
  const Client: TwclGattServerClient);
begin
  UpdateConnectionParams(Client);
  Trace('Connection parameters changed: ' + IntToHex(Client.Address, 12));
end;
// GATT Client side
void __fastcall TfmMain::wclGattClientConnectionParamsChanged(TObject *Sender)
{
    TraceEvent(wclGattClient->Address, "Connection params changed", "", "");
    GetConnectionParams();
}

// GATT Server side
void __fastcall TfmMain::wclGattServerConnectionParamsChanged(TObject *Sender,
      const TwclGattServerClient *Client)
{
    UpdateConnectionParams((TwclGattServerClient*)Client);
    Trace("Connection parameters changed: " + IntToHex(Client->Address, 12));
}
// GATT Client side
void Client_OnConnectionParamsChanged(object sender, EventArgs e)
{
    TraceEvent(Client.Address, "Connection params changed", "", "");
    GetConnectionParams();
}

// GATT Server side
void GattServerConnectionParamsChanged(object Sender, wclGattServerClient Client)
{
    UpdateConnectionParams(Client);
    Trace("Connection parameters changed: " + Client.Address.ToString("X12"));
}
' GATT Client side
Private Sub Client_OnConnectionParamsChanged(sender As Object, e As System.EventArgs) Handles Client.OnConnectionParamsChanged
    TraceEvent(Client.Address, "Connection params changed", "", "")
    GetConnectionParams()
End Sub

' GATT Server side
Private Sub GattServerConnectionParamsChanged(Sender As Object, Client As wclGattServerClient) Handles FServer.OnConnectionParamsChanged
    UpdateConnectionParams(Client)
    Trace("Connection parameters changed: " + Client.Address.ToString("X12"))
End Sub
// GATT Client side
void CGattClientDlg::wclGattClientConnectionParamsChanged(void* Sender)
{
    TraceEvent(wclGattClient.Address, _T("Connection params changed"), _T(""), _T(""));
    GetConnectionParams();
}

// GATT Server side
void CGattServerDlg::GattServerConnectionParamsChanged(void* Sender,
    CwclGattServerClient* const Client)
{
    UpdateConnectionParams(Client);
    Trace(_T("Connection parameters changed: ") + IntToHex(Client->Address));
}

Frequently asked questions

What are Bluetooth LE connection parameters?
They are the connection interval, slave latency, and connection supervision timeout. Together they control power consumption, data throughput, and connection stability.
How can I change BLE connection parameters on Windows?
On Windows 11 the Microsoft UWP API provides predefined settings. For custom values or older Windows versions, the Bluetooth Framework allows full control and also works with the BLED112 dongle.
What is the effective connection interval?
It is the actual interval between connection events when slave latency is applied. Formula: Effective Connection Interval = Connection Interval * (1 + Slave Latency).