I would like to know what is the difference between attributes and service in GATT in BLE specification. and where we can find attributes, are they in service, caracteristics or in descriptors. thanks
问题:
回答1:
In summary ... services, characteristics and descriptors ... are attributes :-)
The BLE standard provides the ATT protocol that defines the concept of attributes. All attributes are defined inside a table and they have an handle, a type (with an UUID), a value (and permissions). On top of ATT protocol in the BLE stack you have GATT and GAP. The GATT protocol defines services, characteristics and descriptors and each of them is an attribute. For example, a characteristic is an attribute with an handle, a type (an UUID that tells us that the attribute is a characteristic) and a value (the characteristic properties with handle to the attribute value and so on). Inside the characteristic you have an attribute that is the value of the characteristic and one or more decriptors that are attributes themselves.
You can see the attribute concept as the abstract type you can define concrete types like service, characteristic and descriptors.
I can suggest to see the following video (intro on BLE) by Nordic :
https://www.youtube.com/watch?v=BZwOrQ6zkzE
Paolo.