Hardware Reference
In-Depth Information
Attributes
Attributes are the smallest data entity defined by GATT (and ATT). They are address‐
able pieces of information that can contain relevant user data (or metadata ) about the
structure and grouping of the different attributes contained within the server. Both
GATT and ATT can work only with attributes, so for clients and servers to interact, all
information must be organized in this form.
Conceptually, attributes are always located on the server and accessed (and potentially
modified) by the client. The specification defines attributes only conceptually, and it
does not force the ATT and GATT implementations to use a particular internal storage
format or mechanism. Because attributes contain both static definitions of invariable
nature and also actual user (often sensor) data that is bound to change rapidly with time
(as discussed in “Attribute and Data Hierarchy” on page 56 ), attributes are usually stored
in a mixture of nonvolatile memory and RAM.
Each and every attribute contains information about the attribute itself and then the
actual data, in the fields described in the following sections.
Handle
The attribute handle is a unique 16-bit identifier for each attribute on a particular GATT
server. It is the part of each attribute that makes it addressable, and it is guaranteed not
to change (with the caveats described in “Attribute Caching” on page 66 ) between trans‐
actions or, for bonded devices, even across connections. Because value 0x0000 denotes
an invalid handle, the amount of handles available to every GATT server is 0xFFFE
(65535) , although in practice, the number of attributes in a server is typically closer to
a few dozen.
Whenever used in the context of attribute handles, the term handle
range refers to all attributes with handles contained between two given
boundaries. For example, handle range 0x0100-0x010A would refer
to any attribute with a handle between 0x0100 and 0x010A .
Within a GATT server, the growing values of handles determine the ordered sequence
of attributes that a client can access. But gaps between handles are allowed, so a client
cannot rely on a contiguous sequence to guess the location of the next attribute. Instead,
the client must use the discovery feature ( “Service and Characteristic Discovery” on
page 69 ) to obtain the handles of the attributes it is interested in.
Search WWH ::




Custom Search