Skip to main content

Subsection 15.1.4 How a Connection Is Made: GAP

Before two devices can exchange data, they have to find each other. The rules for that are the Generic Access Profile (GAP), the part of Bluetooth that controls advertising and connections. The peripheral advertises: it transmits a short packet, over and over, containing its name, the services it supports, and a unique identifier for each service, called a Universally Unique Identifier (UUID). A UUID is a long number that identifies one service unambiguously, so that a phone scanning a room full of devices can tell what each device offers. The central scans for advertisements and decides which device to connect to. As soon as a connection is established, the peripheral stops advertising itself, and other devices will no longer be able to see it or connect to it until the existing connection is broken.
You will see all of this on your own phone in Lab 9: the app’s scan list is built from the advertising packets it receives, and once you connect to your module, your module stops advertising and drops out of other phones’ scans.