The protocol stack of BLE maintains a similar lower layer struc-ture as Classic Bluetooth, but also provides revised implementa-tions and a few new layers, such as the General Attribute Pro-file (GATT) and the Attribute Protocol (ATT). Fig. 2 shows the sim-plified stack for three major types of Bluetooth chipsets: ClassicBluetooth, Dual Mode, and BLE-only. For compatibility reasons, theBluetooth Dual Mode chipsets were introduced to support both LowEnergy and BR/EDR communications, which are commonly seenon phones and tablets. BLE-only chipsets are typically installed oncost- and resource-constrained devices.The implementation of the BLE stack layers focuses on low-latency and low energy consumption. Several highlights of thestack layers can be summarized as follows. First, the Physical (PHY)Layer of BLE defines 40 Radio Frequency (RF) channels in the2.4 GHz band, among which three channels are defined as adver-tising channels for disseminating data and 37 data channels areused for bidirectional exchange of messages in established connec-tions. The Link Layer (LL) defines two interaction patterns betweentwo devices: 1) connection-less communication, i.e., two devicesact as advertiser and scanner, where the advertiser broadcasts dataFig. 2. A simplified protocol stack for three types of Bluetooth chipsets (adaptedfrom [24]).packets and the scanner can receive them; 2) connection-basedcommunication, i.e., the scanner and the advertiser are able toestablish a bidirectional connection and adopt the role of centraland peripheral, respectively. The Host Controller Interface (HCI) isa standard protocol that takes care of the communication betweenthe Host and Controller.On top of the HCI si