Bluetooth® Low Energy GAP Modes and Procedures

Last modified by Microchip on 2024/08/29 13:33

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."

Back to Top


Examples

Discovery Modes

  • Non-Discoverable
  • Limited-Discoverable
  • General-Discoverable

Connection Modes

  • Non-Connectable
  • Directed-Connectable
  • Undirected-Connectable

Refer to the "Bluetooth Specification version 4.2", Vol 3., Part C, Section 9 for a more detailed description of all BLE GAP modes and procedures.

Back to Top


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

Back to Top


Examples

Discovery Procedures

  • Limited-Discovery
  • General-Discovery

Connection Procedures

  • General-Connection
  • Direct-Connection

Refer to the "Bluetooth Specification version 4.2", Vol 3., Part C, Section 9 for more detailed description of all BLE GAP modes and procedures.

Back to Top


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:

Table which matches several peripheral "discovery" modes with applicable central "discovery" procedures

Back to Top


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.

Back to Top


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.

Refer to vendor-supplied configuration/programming utilities and/or BLE stack APIs to configure these settings.

Back to Top


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.

Since smartphones use Random/Private addresses, ADV_DIRECT_IND packets are generally not detectable by them. Use General-Discoverable mode on the peripheral device for connection to a smartphone application.

Back to Top


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.

Back to Top


Required Central Configuration

The following BLE parameters need to be setup in the central before beginning this procedure

Finally, scanning needs to be enabled.

Refer to vendor-supplied configuration/programming utilities and/or BLE stack APIs to configure these settings.

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.

Back to Top


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:

Table matches several peripheral connection modes with applicable central connection procedures

Back to Top


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").

Back to Top


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

During the Direct Connection Establishment Procedure, the Central's Link Layer is not aware of whether the peripheral device is available or connectable. Therefore, it should only be triggered upon reception of advertising packets, as discussed above.

Back to Top