Bluetooth® Low Energy GAP Modes and Procedures
Bluetooth® Low Energy (BLE) Generic Access Profile (GAP) modes and procedures form the cornerstone for basic control plane operations:
- Discover and connect with peers
- Broadcast data
- Establish secure connections
Mode/Procedure pairs are defined for both the discovery and connection phases.
GAP Modes
A state in which a peripheral device can switch to for a certain time, in order to
- Achieve a goal, or
- Allow a peer to perform a "procedure."
Examples
- Non-Discoverable
- Limited-Discoverable
- General-Discoverable
- Non-Connectable
- Directed-Connectable
- Undirected-Connectable
GAP Procedure(s)
A sequence of actions undertaken by a central device to attain a goal, such as
- Discovery of peers
- Establishing a connection to a specific peer
Examples
- Limited-Discovery
- General-Discovery
- General-Connection
- Direct-Connection
Discovery Modes and Applicable Procedures
These are concerned with how a peripheral advertises its presence - and what central devices can/should do with that information. The following table matches several peripheral "discovery" modes with applicable central "discovery" procedures:
General-Discoverable Mode
This state indicates the peripheral's desire for discovery by peers for connection establishment. It is identified by the transmission of ADV_IND advertising packets at regular intervals. It represents the initial factory default state for the peripheral.
Required Peripheral Configuration
The following BLE parameters need to be setup in the peripheral before entering this mode (state):
- Advertising Packet Type (ADV_IND)
- Advertising Interval
- Advertising Packet Payload
- Local Name
- Service UUID
- (Optional) Scan Response Payload
- TX Power
- Battery Level
- Custom Data
Finally, advertising must be enabled on the peripheral device to signal entry into this mode for its peers.
Limited-Discoverable Mode
This state indicates the peripheral's desire to reconnect to a specific peer. It is identified by the transmission of ADV_DIRECT_IND advertising packets in short bursts. These packets contain the MAC address of the desired central device.
General Discovery Procedure
This procedure has the central device start scanning with no white-list filtering (i.e., analyzes all Advertising Packet Type flags received). If the advertising packet type is Limited-Discoverable or General-Discoverable, the peer device is reported to the application layer for further analysis.
Required Central Configuration
The following BLE parameters need to be setup in the central before beginning this procedure
Finally, scanning needs to be enabled.
Limited Discovery Procedure
This procedure is partially assisted by the BLE Link Layer. During scanning, if the Link Layer detects an ADV_DIRECT_IND packet with a matching MAC address, it will notify the application layer. Other BLE radios in the vicinity will ignore ADV_DIRECT_IND packets not addressed to them.
Connection Establishment Modes and Applicable Procedures
These are primarily concerned with how a central device selects which peripheral device to interact with. The following table matches several peripheral connection modes with applicable central connection procedures:
Undirected-Connectable Mode
A peripheral is automatically in this "connection mode" when operating in General-Discoverable mode as discussed above. It is sending ADV_IND packets (which are promiscuous), and looking for a connection with any peer ("Undirected").
General Connection Establishment Procedure
This is most commonly a two-step procedure, which has the Central.
Accept all ADV_IND packets, and filter on data found in the packet's payload, such as:
- Local Name
- Service UUID
- Custom Data
- etc.
This step produces the MAC address of the desired peripheral to connect with.
Stop scanning, and connect to that device using the Direct Connection Establishment procedure:
- Initiate a connection to a single device using its MAC address
- Uses CONNECT_REQ Initiating PDU advertising packet