BLE ARCHITECTURE (HOST )
HCI Host Controller Interface?
- ? sending commands to controller and receiving events back
- ? sending and receiving data from peer device
-? logical interface defines a number of packet formats for commands, events and data
- physical interface defines how these packets can be transported between the host and controller
For a system in which the controller and the host are on separate chips connected by a physical interface the HCI logical interface is represented as physical packets transferred over this physical interface
Logical link Control and Adaptation Protocol(L2CAP)
Generic Access profile (GAP)
The generic access protocol (GAP) layer directly interfaces with the application and/or profiles, to handle device discovery and connection-related services
for the device. GAP handles the initiation of security features
The GAP layer of the Bluetooth low energy protocol stack is responsible for connection functionality. This layer handles the access modes and procedures of the device including device discovery, link establishment, link termination, initiation of security features, and device configuration
Based on the role for which the device is configured, The following describes these states.
? Standby: The device is in the initial idle state upon reset.
? Advertiser: The device is advertising with specific data letting any initiating devices know that it is a connectable device (this advertisement contains the device address and can contain some additional data such as the device name).
? Scanner: When receiving the advertisement, the scanning device sends a scan request to the
advertiser. The advertiser responds with a scan response. This process is called device discovery. The scanning device is aware of the advertising device and can initiate a connection with it.
? Initiator: When initiating, the initiator must specify a peer device address to which to connect. If an advertisement is received matching that address of the peer device, the initiating device then sends
out a request to establish a connection (link) with the advertising device with the connection
领英推荐
? Slave/Master: When a connection is formed, the device functions as a slave if the advertiser and a master if the initiator.
Security Manager Layer
The security manager (SM) layer
Attribute Protocol
The attribute protocol (ATT) layer protocol allows a device to expose certain pieces of data or attributes, to another device. Or ho the server exposes its data to a client.
An attribute is a generic name for any piece of data exposed by the server This piece of data is labelled and addressable An attribute is made up o a handle, type, a value and permissions.
Generic Attribute Profile (GATT)
The generic attribute protocol (GATT) layer is a service framework that defines the sub-procedures for using ATT. Data communications that occur between two devices in a Bluetooth low
energy connection are handled through GATT sub-procedures. The application and/or profiles will directly
use GATT.
Just as the GAP layer handles most connection-related functionality, the GATT layer of the Bluetooth low energy protocol stack is used by the application for data communication between two connected devices.
Data is passed and stored in the form of characteristics which are stored in memory on the Bluetooth low
energy device. From a GATT standpoint, when two devices are connected they are each in one of two roles.
? The GATT server is the device containing the characteristic database that is being read or written by a GATT client.
? The GATT client is the device that is reading or writing data from or to the GATT server.
Application
The BLE protocol stack layers interact with applications and profiles as desired. Application interoperability in the Bluetooth system is accomplished by Bluetooth profiles.
??The profile defines the vertical interactions between the layers as well as the peer-to-peer interactions of specific layers between devices.
??A profile composed of one or more services to address particular use case. A service consists of characteristics or references to other services.
??Any profiles/applications run on top of GAP/GATT layers of BLE protocol stack. It handles device discovery and connection related services for the BLE device.
Linux Kernel Engineer & Linux Bluetooth Subsystem Maintainer
2 年'An attribute is a generic name for any piece of data exposed by the server This piece of data is labelled and addressable An attribute is made up o a handle, type, a value and permissions.' This is not quite right, the access permissions handling is implementation specific in the server, at runtime, what is specified is the so called Characteristic Properties (see BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 3, Part G page 1486), so at the protocol level an attribute is just handle, type (UUID), value and in case of characteristic there is also a properties.