🎉 25% off Pre-Sale! Bluetooth LE course with real hardware included - no SDK required
Bluetooth® Low Energy Protocol · · 7 min read

How Bluetooth Low Energy Works: Advertisements (Part 1)

A deep dive into Bluetooth LE advertisements: GAP roles, advertising channels, packet formats, PDU types (legacy and extended), scanning, and advertising data structures.

How Bluetooth Low Energy Works Advertisements (Part 1)

To fully understand advertisements in BLE, we need to take a step back and learn about one of the layers within the architecture of BLE: the Generic Access Profile (GAP).

Image

GAP provides a framework that defines how BLE devices interact with each other. This includes:

There are four main GAP roles that a BLE device operates in:

A peripheral or broadcaster always starts with advertising before accepting a connection. In fact, the advertisement packets are the only way that allows a central or scanner to discover a peripheral or broadcaster.

The difference between two BLE devices being in a connected mode versus in an advertising-discovery mode is that the connected mode allows bi-directional data transfer between the two connected devices. An advertising device (peripheral or broadcaster), on the other hand, is not able to receive any data from the observer/central device in that state.

One exception to this is that if an advertiser/broadcaster supports what's called "scan requests", it is able to "respond" to a "scan request" packet that can be sent by the central/observer with a "scan response". This is usually employed in order to transmit additional data in scenarios when you can't fit all your data within the original advertising packet. So I guess in a sense, this could be considered "bi-directional".

In the Advertising state, a device sends out packets containing useful data for others to receive and process.

The packets are sent at a fixed interval defined as the Advertising Interval. There are 40 RF channels in BLE, each separated by 2 MHz (center-to-center), as shown in the following figure.

BLE RF Channels
Advertising Channels in BLE

Three of these channels are called the Primary Advertising Channels (labeled 37, 38, and 39), while the remaining 37 channels are called the Secondary Advertisement Channels (they are also the ones used for data transfer during a connection).

Secondary advertising channels are used as "auxiliary" channels meaning that a device has to first advertise on the primary advertising channels before sending out advertising packets on the secondary channels.

If a device wants to utilize the secondary advertising channels, it sends out advertising packets on the primary channels that point to the secondary advertising packets. We'll go over how this exactly works in a later section.

Advertising Packet Format

Let's look at the format of the advertising packets:

BLE Uncoded PHY Packet Format
Source: Bluetooth Core Specification document

The PDU (Protocol Data Unit) field is what we're interested in. This is the field that changes depending on the type of packet being transmitted (data vs. advertising) and the one that includes the "user-data" that your application is interested in sending out.

Even though the top diagram within the figure is for Uncoded PHY, the PDU is still the same for the Coded PHY case (if you're not familiar with Coded PHY, it is a new PHY that was introduced in Bluetooth version 5.0 and is useful in long-range communication and/or in noisy environments – refer to my post on Long-range Bluetooth communication for more information).

Let's define each of the fields within the PDU:

PDU Header

PDU Type: this field is 4 bits in length and has the following possible values:

BLE Advertising PDU Types
Source: Bluetooth Core Specification document

The PDUs are split up into multiple categories depending on the purpose.

Before we list each of the PDUs, let's cover some common terminology:

Legacy Advertising PDUs

These are available for all Bluetooth versions – also enables backward compatibility with older versions and are used on the Primary advertising channels.

Extended Advertising PDUs

These types were introduced in Bluetooth version 5.0. They provide devices the option to advertise on the Secondary advertising channels in addition to the Primary advertising channels. The benefit of the Secondary channels is that they allow increased advertising data capacity.

Scanning PDUs

These are used to utilize the Scan Request → Scan Response functionality, which enables devices to broadcast more advertising data than is allowed in a single advertising packet.

Initiating PDUs

These are used in establishing a connection between a peripheral device and a central device.

RFU: Reserved for future use

ChSel: this bit will be set to 1 if the advertiser supports the LE Channel Selection Algorithm #2 feature (refer to the Bluetooth Core Specification Vol. 6, Part B, Section 4.5.8.3).

TxAdd: this bit is set to 1 if the advertiser's address is random, and set to 0 if the address is public

RxAdd: this bit is set to 1 if the target device's address is random, and set to 0 if the address is public

Length: holds the Length of the payload of the packet.

PDU Payload

The content of the payload of the advertising packet and its maximum size are dependent on the PDU type used. The advertising data includes the information the advertiser wants to relay to the observer/central device.

Here we're mostly interested in the PDU types that contain advertising data. Those PDUs are:

Advertising Data

There are a number of standard data types that can be included in the advertising data. The data is formatted as follows:

BLE Advertising Data Format
Source: Bluetooth Core Specification Document

These are defined in a specification document that's separate from the Core Specification document called the Core Specification Supplement (https://www.bluetooth.com/specifications/bluetooth-core-specification/).

The different BLE advertising data types are:

Ok, that's it for this week's post. We'll be covering more in Part 2 of this series, including:

📚
Continue the series: In Part 2, we cover real-world advertising examples, broadcasting vs. connectable behavior, discoverable modes, and advertising parameters.
💡
Insider Tip: Want to dive deeper into Bluetooth LE advertising and beyond? Check out the Bluetooth Developer Academy for comprehensive courses that take you from beginner to expert!

Read next