Bluetooth Low Energy Series Part 2

Published By

In this series, Nick Powers will take you through the basics of Bluetooth Low Energy (BLE) and some of the solutions offered in the space. Here is the first part of the series.

8. Attribute

In bluetooth low energy, the data is stored in a database or matrix and each line of the database is an attribute. So the attribute is the basic element to store information. It is composed of three values: the attribute handle, that is like the line of the matrix, the attribute type and the attribute value. The attribute handle is 2 bytes, the attribute type is 2 or 16 bytes and the attribute value is between 0 and 512 bytes. The attribute length can be must longer than a data packet, that's why segmentation was introduced in the L2CAP layer. The attribute type specifies what the attribute represents and is designed by a UUID (Universally Unique IDentifier) and must be 128 bits long. but in BLE, the UUID can be defined as a 2-byte or a 16-byte UUID.

 

9. Attribute Protocol

The attribute protocol has a default maximum transmission unit (MTU) of 23 bytes. Indeed, when we explained the constraints of the oscillator on the physical layer, the maximum number of bytes was 47 bytes. Removing overhead due to preamble, data access address, header, length and CRC, 37 bytes are left for the payload. During advertising, in the payload, 6 bytes are mandatory for the advertising device address. For simplification, and hence power saving, it was decided to have the same useful payload in advertising and data packet that is 37 minus 6 equal 31 bytes. But during encryption, 4 bytes are necessary for an MIC. these left 27 bytes. As the L2CAP layer has an overhead of 4 bytes, 23 bytes are left for the attribute protocol. On the version 4.2, the MTU is must larger as the PDU of a link layer packet may be up to 257 bytes versus 39 bytes for the version 4.1. By default, the MTU is 23 bytes and must be supported by all the devices and all the version, but if an higher MTU is desired, it must be negotiated between all the devices and the lowest supported value must be used.

  

10. GATT

In this video, we present the GATT (Generic Attribute Profile) stack of Bluetooth Low Energy. The GATT define standard ways that services, characteristic and their descriptors can be discovered and then used. The service, as the name implies, performs a service to client, will be useful information for the client. For instance, a battery service will give the energy level of a battery. A temperature service will give the temperature of the application. You can define your own service if not already defines by the SIG. On the bluetooth web site, the list of adopted services is published...battery service, blood pressure, cycling power, indoor positioning, transmission power are examples of services that are adopted. An attribute has 3 elements: the handle value, the type of attribute and the value of the attribute. For a primary service, the type of attribute is equal to the UUID 0x2800. So when a client discover the available services, he needs to check which lines of the matrix have the type of attribute equal to 0x2800. Then the value explains what kind of attribute it is. For instance, for a battery service, the assigned number is 0x180F. In bluetooth specifications, GATT and GAP layers must have their own service. The GAP service is equal to 0x1800 and the GATT service is equal to 0x1801. As you can see, on the handle value 0x0001, the GATT service is declared and on the handle 0x0005, the GAP service is declared.

11. Generic Access Profile

The final layer of BLE is the GAP layer that stands for Generic Access Profile. It defines how devices can discover and connect with one another and how they bond. if not connected, they define how to be a broadcaster or an observer. It also defines the different types of addresses can be used to allow private and resolvable addresses. In the video about the link layer, we explain packet structure of the BLE and how information and data are communicated.

 

12. Security

Security is a very large topic that would require hours to cover. In this video, we give a simple overview of security management in bluetooth low energy.

 

Featured Products

See related product

NRF52832-QFAA-R7

Nordic Semiconductor Bluetooth View

See related product

BLUENRG-MSQTR

STMicroelectronics Bluetooth View

See related product

BLE112-A-V1

Silicon Labs Bluetooth View


Look for more videos from this Bluetooth Low Energy (BLE) series. If you want to learn more, subscribe to our newsletter to get the latest news.

Subscribe

 

Related news articles

Latest News

Sorry, your filter selection returned no results.

We've updated our privacy policy. Please take a moment to review these changes. By clicking I Agree to Arrow Electronics Terms Of Use  and have read and understand the Privacy Policy and Cookie Policy.

Our website places cookies on your device to improve your experience and to improve our site. Read more about the cookies we use and how to disable them here. Cookies and tracking technologies may be used for marketing purposes.
By clicking “Accept”, you are consenting to placement of cookies on your device and to our use of tracking technologies. Click “Read More” below for more information and instructions on how to disable cookies and tracking technologies. While acceptance of cookies and tracking technologies is voluntary, disabling them may result in the website not working properly, and certain advertisements may be less relevant to you.
We respect your privacy. Read our privacy policy here