Hardware Reference
In-Depth Information
different situations. This section briefly describes how the service-related AD Types can
be useful for a wide range of applications.
Services and service UUIDs are used to encapsulate data into logic groups in BLE (see
Chapter 4 for more details). The Bluetooth SIG defines a number of official services, all
of which have a unique UUID associated with them, and you are free to create your own
custom services with their own dedicated UUID. Services are what make device inter‐
operability possible. For example, any device that implements the Battery Service must
do so based on the same data contract defined by the Bluetooth SIG, using the same
UUIDs and data format.
An advertising packet can include complete or incomplete lists of service UUIDs under
the Service UUID AD Type to let other devices know which services are exposed by the
peripheral without having to establish a connection with it. Connections are expensive,
and limiting the occasions where connections are necessary can help extend battery life.
By letting the world know that the device exposes a certain set of services as a GATT
server, you can more quickly determine if that device is relevant to you without con‐
necting to every device that comes within range.
Conversely, service solicitation allows the central receiving the advertising packets to
find out which services the peripheral can access when it is acting as a GATT client. In
certain cases, if the central is not exposing any of these services at all as a GATT server,
it might not even bother to connect to it, knowing that interaction would be extremely
limited.
While services are normally used only after a connection is established, the advertising
packet includes a mechanism to offer service data right in the advertising payload: the
Service Data. The key benefit of using the Service Data field is that it allows you to
broadcast the data contained inside your GATT services to any number of listening
devices, bypassing the need to a dedicated connection between two devices to read
service data.
Finally, the Manufacturer Specific Data AD Type is a generic catch-all field that can
include an arbitrary chunk of data in your advertising payload. For example, Apple's
iBeacon ( “iBeacon” on page 132 ) uses this AD type to push data out to other devices,
inserting a 128-bit UUID that identifies the location and two 16-bit values to distinguish
individual nodes in the same family. This field provides a lot of flexibility to product
designers who want to broadcast short chunks of custom data, and you're generally free
to change to contents of the field from one advertising event to the next.
Please note that the Bluetooth SIG might release further updates to the Core Specifica‐
tion Supplement at the Specification Adopted Documents page whenever new AD Types
are available for public consumption.
Search WWH ::




Custom Search