Hardware Reference
In-Depth Information
Service and Characteristic Discovery
As mentioned elsewhere in this chapter, the client has no knowledge about the attributes
that might be present in a GATT server when it first connects to it. It is therefore essential
for the client to begin by performing a series of packet exchanges to determine the
amount, location, and nature of all the attributes that might be of interest. As discussed
in “Attribute Caching” on page 66 , procedures in this category can, in some cases, sub‐
sequently be skipped.
For primary service discovery , GATT offers the two following options:
Discover all primary services
Using this feature, clients can retrieve a full list of all primary services (regardless
of service UUIDs) from the remote server. This is commonly used when the client
supports more than one service and therefore wants to find out about the full service
support on the server side. Because the client can specify a handle range when
issuing the required request, it must set 0x0001-0xFFFF as the handle range to
implement this feature, covering the full attribute range of the server.
Discover primary service by service UUID
Whenever the client knows which service it is looking for (usually because it sup‐
ports only that single service itself ), it can simply look for all instances of a particular
service using this feature, also with the requirement of setting the handle range to
0x0001-0xFFFF .
Each of these procedures yield handle ranges that refer to the attributes that belong to
a single service. The discover all primary services feature also obtains the individual
service UUIDs.
When the client has already found services on the server, it can proceed to perform
relationship discovery (the discovery of any included services) with the following feature:
Find included services
This allows a client to query the server about any included services within a service.
The handle range provided in such a query refers to the boundaries of an existing
service, previously obtained using service discovery. As with service discovery, the
client also receives a set of handle ranges, along with UUIDs when applicable.
In terms of characteristic discovery , GATT offers the following options:
Discover all characteristics of a service
Once a client has obtained the handle range for a service it might be interested in,
it can then proceed to retrieve a full list of its characteristics. The only input is the
handle range, and in exchange, the server returns both the handle and the value of
all characteristic declaration attributes enclosed within that service (see “Charac‐
teristic declaration attribute” on page 59 ).
Search WWH ::




Custom Search