Bluetooth Advertising Data

Viewed 658

I was trying to understand basics of Bluetooth. I have few queries regarding the scanning and advertising of classic and low energy Bluetooth.

  1. Is EIR data (classic Bluetooth extended inquiry response) and AD data (Bluetooth low energy scan response) read from GAP profile. Where is data from GAP profile stored? Is it on host or controller?

  2. Is there a different GAP profile for classic and different GAP profile for LE ?

  3. When we enable advertising (low energy) using hcitool cmd or enable discoverable mode (classic Bluetooth), how does controller get all the advertisement information (scan response/ extended inquiry response)? Is it stored on controller?

  4. As mentioned in Bluetooth Specification 4.2 section 7.8.8 LE Set Scan Response Data command can be used to provide data for scanning packets. Is this different than GAP ?

  5. Is Gatt Server running before connection is formed ? If not, then how is GAP profile (used for advertising) relevant before connection ?

  6. Can same fields (e.g. device name) from EIR data and AD data be different ?

1 Answers
  1. Yes, both EIR and AD elements are defined by the GAP profile. This is managed in the host.

  2. No, the same GAP profile is applicable to both classic and BLE. However, a device can support either one or both. What I mean by this is that if you have a Classic-only device, then the qualification will be against the classic GAP profile, while if you have and LE-only device, then the qualification will be against an LE-only GAP profile. In other words, in terms of Bluetooth qualification both the GAP profiles appear to be separate, but on the device itself it is one GAP profile.

  3. Theoretically, GAP-related information is managed on the host layer, and this is then passed to/from the lower layers (see figure from Bluetooth Core Specification below). The controller then takes the information and sends it out in the packet format specified for EIR/AD data by the Bluetooth specification.

enter image description here

  1. This depends on what you mean by GAP? To avoid confusion, GAP can be a service sitting in your GATT table, but this is not exactly the same as the GAP profile. The GAP service that sits in the GATT table is a subset of the GAP profile in that it contains some information about the GAP profile but is not a 1:1 direct reflection. The Scan Response data itself is defined by the GAP profile, but it is usually not included in the GAP service. Below is a list of all of the mandatory/optional fields for the Scan Response Data (SRD). You can find this and more information in the Supplement to the Core Specification.

enter image description here

  1. Yes, the GATT server (also known as GATT table) should be formed before a connection is made. However, the GATT table can be updated when a connection has already been made. Again in this case I believe you are referring to the GAP service which is slightly different from the GAP profile.

  2. No, fields that are the same in the EIR/AD data should have the same value. This is reflected in the description of the device name in Core Bluetooth Specification v5.3, Vol 3, Part C, Section 3.2.2.1.1:-

A BR/EDR/LE device type shall have a single Bluetooth Device Name which shall be identical irrespective of the physical channel used to perform the name discovery procedure.

If you haven't done so already, I highly recommend reading the Bluetooth Core Specification v5.3, Vol 3, Part C (page 1230) - GENERIC ACCESS PROFILE, as it will have answers to all of these questions and more.

Below are some additional useful resources:-

Related