Page 513 - From GMS to LTE
P. 513
Bluetooth and Bluetooth Low Energy 499
7.7.3 BLE SMP, GAP and Connection Establishment
On the management side of the protocol stack that is multiplexed by the L2CAP layer,
the Security Manager Protocol (SMP) is the basis for the Generic Access Protocol
(GAP). GAP and the underlying security functionality are used by a device to establish
a secured or open connection to a remote device. Like in ‘classic’ Bluetooth, GAP is the
‘usage model’ of the lower‐level radio protocols; it defines the roles and procedures that
allow devices to broadcast data (beacons), discover devices and establish connections,
and it performs authentication and negotiates secure connections.
In practice, a device can be in one of four GAP states. While not connected to another
device, a device can act either as a broadcaster and periodically send advertising packets
or it can be an observer. When two devices are connected the initiator of a connection
becomes the GAP ‘Central’, i.e. the link layer master. The device that has sent the adver-
tisement and to which a connection is established becomes the GAP ‘Peripheral’, i.e. the
link layer slave.
To establish a connection between two devices, a device scans for advertisement
packets on the three channels that are only used for advertisements. The periodicity of
advertisements can be set by a device from a few milliseconds up to several seconds.
This way it is possible to find a balance between detection and connection setup speed
and power consumption. In practice, the default advertisement interval of many bea-
cons is 100 ms. Especially for devices with small batteries this interval might be too
power intensive and hence advertisement intervals of a second or more might be a
better choice at the expense of the time it takes a device to find the advertisement and
act on it.
After finding the advertisement packet of the device the link layer scanner device
becomes the link layer master by responding on the same channel with a ‘Connect
Request’ packet. In the packet the master defines a number of parameters for the dedi-
cated connection, as shown in Figure 7.30.
In the Connect Request message the master defines the parameters for what are
referred to as subsequent connection events. The following parameters are used to
CONNECT_REQ packet parameters
Link Layer Data
Access Address: 0xaf9a9394
CRC Init: 0xac1369
Window Size: 3 3 * 1.25 ms = 3.75 ms
Window Offset: 9
Interval: 54 54 * 1.5 ms = 81 ms
Latency: 0
Timeout: 42 42 * 10 ms = 420 ms
Channel Map: ffffffff1f
.... ...1 = RF Channel 1 (2404 MHz - Data - 0): True
.... ..1. = RF Channel 2 (2406 MHz - Data - 1): True
.... .1.. = RF Channel 3 (2408 MHz - Data - 2): True
[…]
1010 1... = Hop: 21 channel = (curr_channel + hop) mod 37
Figure 7.30 BLE Connect Request packet excerpt.