1. Connection Subrating feature
It can sometimes be necessary for a device to use a low duty cycle connection for some use cases but be able to switch up to a high duty cycle when required to support other use cases.
Link Layer procedures that use "instants" such as the connection update procedure generally involve connection property changes that if not executed successfully by both devices can result in loss of connection.
To start the connection update procedure, the Host must send the controller a LE Connection Update command. The controller must respond by initiating the link layer Connection Update procedure, sending a LL_CONNECTION_UPDATE_IND PDU to the Peripheral with the
Instant field specifying a connection event which is at least six events in the future at which point the connection parameter changes must be applied by both the Peripheral and Central.
Bluetooth® Connection update |
---|
Use cases which are expected to benefit from subrated connections include Bluetooth LE Audio products such as hearing aids and monitoring systems which use sensors.
An audio device like a hearing aid can maintain a subrated connection to a smartphone, making the connection available for immediate use when it becomes necessary to handle audio communication.
Subrating saves power but also allows the connected isochronous stream to be established very quickly.
Using subrated connections, a sensor can efficiently maintain a persistent, low duty cycle subrated connection to another device which collects sensor data.
When required it can then switch the connection up to a high duty cycle quickly so that accumulated sensor data can be uploaded over a higher bandwidth connection.
Bluetooth LE connections offer a highly flexible way to adapt to dynamic changes of requirements in terms of data throughput and power.
A high duty cycle connection achieves higher data throughput on the expense of increased power consumption, while a low duty cycle connection saves power on the expense of data throughput.
1.1. Connection subrating capabilities and benefits
The LE Enhanced Connection Update change introduces the concept of subrated connections.
A subrated connection achieves a power saving low duty cycle in a different way to non-subrated connections and is able to switch up to a high duty cycle more quickly.
Subrated connections are also able to handle variable packet rates or bursty traffic in an efficient way.
The ability to switch quickly from a low duty cycle connection to a high duty cycle connection when required and in a short time, will provide an improved user experience for some important product types and is the main benefit of the new subrated connections feature.
1.2. Connection subrating
1.2.1. Basic Principles
Subrated connections are ACL connections which have additional properties assigned to them and behave differently in some ways.
The additional properties are called the subrate factor, subrate base event, and continuation number.
ACL connection properties which also have a significant effect on the behaviour of a subrated connection are the connection interval and the Peripheral latency value.
The subrated connection properties provide a mechanism for indicating that only a specific subset of connection events are to be actively used by the connected devices, with the radio not being used in other connection events.
Connection events are actively used when the peripheral listens to the event or sends data in the event.
A subrated connection can therefore have a short ACL connection interval but still exhibit a low duty cycle.
Bluetooth® A basic subrated connection with subrate factor=5 |
---|
Only one in every five connection events is used. The other four are skipped and so there is no radio activity during those connection events.
The connection event during which the radio is used to transmit and receive link layer packets is known as a subrated connection event.
1.2.2. Subrate base events
A subrated connection defines a number of consecutive ACL connection events of which one will be actively used (the subrated connection event)
But the subrated connection event does not have to be the first ACL connection event in the sequence of events. The choice of connection event to use from within the sequence of subrate factor events is controlled by the subrate base event value which is used to determine the phase of the subrated events.
The phase of the subrated events has been shifted by two connection events by specifying a subrate base event value of 2.
Bluetooth® A subrated connection with subrate factor=5, subrate base event=2 and Peripheral latency=0 |
---|
The subrate base event property provides packet schedulers with control over connection events and radio use so that a workable schedule can be established across one or more concurrent connections.
1.2.3. Continuation events
The rate of packets exchanged over a connection and the way in which the rate varies is called the traffic profile.
Connection subrating uses the concept of continuation events.
When a subrated connection is actively in use, with a link layer packet which has a non-zero length during the current subrated connection event, a specified number of the following ACL connection events (called the continuation events) will be selected instead of skip them.
This ensures that bursts of activity from the application are not slowed down by subrating.
After an actively used subrated connection event, a number of the connection events that follow on immediately from the subrated connection event will also be selected for use.
Bluetooth® Continuation events in a subrated connection. Continuation Number=1 |
---|
- At connection event #0 (the subrated connection base event), the link layer packet received had no payload and so continuation was not warranted. All other connection events until the next subrated connection event are therefore skipped.
- At the subrated event which occurs at ACL connection event #5, at least one non-zero length link layer packet was transmitted and so the next connection event (event #6) is designated a continuation event and is actively used.
- At least one non-empty link layer packet was handled during this continuation event, connection event #6 and so the next connection event, event #7 also becomes a continuation event.
- Data is handled in event #7 and so event #8 becomes a continuation event too.
- During event #8, there are no non-empty packets and so the sequence of continuation ends here.
1.2.4. Peripheral Latency and Subrated Connections
When peripheral latency is used with a subrated connection, the effect can sometimes differ from non-subrated connections.
It depends on whether or not continuation events are in use.
When Peripheral latency is greater than zero in a subrated connection, the Peripheral latency concept applies to subrated connection events only and these occur at the intervals determined by the subrate factor value.
Every other subrated connection event is skipped due to the Peripheral latency value of 1 in conjunction with the subrate connection parameters.
Bluetooth® A subrated connection with Peripheral Latency=1, subrate factor=3 and continuation number=0 |
---|
Example of a non-zero continuation number used with a non-zero Peripheral latency value.
The Peripheral listens at every other subrated connection event as you would expect but the Peripheral latency property value has no effect on the behaviour during continuation events.
After receiving data at a subrated connection event, the Peripheral listens at the next continuation event exactly as would have been the case with a Peripheral latency value of zero.
Bluetooth® A subrated connection with Peripheral Latency=1, subrate factor=3 and continuation number=1 |
---|
1.3. how to implement on STM32WBA applications
Feature available in "full Link Layer" (use of "full ble stack") for STM32WBA.
1.3.1. Peripheral and Central
It is necessary to set connection subrating feature.
hci_le_set_host_feature |
---|
Description
|
1.3.2. Peripheral or Central
After LE link establishment, the central requires subrating.
hci_le_subrate_request |
---|
Description
|
2. Example of Connection subrating feature on STM32WBA
2.1. Advertising data
At startup, Connection subrating Server application starts Advertising.
Data advertised are composed as follows:
Connection subrating Server Advertising packet | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Manufacturer data are encoded following STMicroelectronics BlueST SDK v2 as described below:
STMicroelectronics Manufacturer Advertising data | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2.2. On-board buttons configuration
Button configuration for Bluetooth® Low Energy connection subrating application on Nucleo-WBA55CG boards | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2.3. Connection Subrating Central and Peripheral applications
Bluetooth® Example of Notification Flow Diagram between a CS server and a CS client |
---|
Bluetooth® Example of Write Flow Diagram between a CS client and a CS server |
---|