User guide

Silicon Labs Page of 9 21
3.2 Defining Services
3.2.1 <service>: Service Definition element
The XML element is used to define a service.
<service>
The attributes are described in more detail in the table below.
Attribute Description
uuid
Universally Unique IDentifier. The UUID uniquely identifies a service. 16-bit values are used for
the services defined by the and 128-bit UUIDs are used for manufacturer specific
Bluetooth SIG
implementations.
Options:
0000 to 16-bit UUIDs are reserved for the services standardized by the and FFFF:
Bluetooth SIG
must not be used for vendor specific implementations.
00000000-0000-0000-0000-000000000000 to FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF:
128-bit UUIDs are reserved for vendor specific implementations.
id
The ID is used to identify a service within the service database and can be used as a reference
from other services (include statement below). This ID is not stored in the GATT database and a t
the moment it does not have other practical uses in BLE products. In BT121 this ID is also used
to generate an handle (and a constant revealed in the file) to be used with the new constants
. The ID can be used in the application code
dumo_cmd_gatt_server_set_service_status
(BGScript) to manage the service instead of using its handle number. Every service must use a
unique ID.
Value:
Any UTF-8 string
type
The type field defines whether the service is a or a service. Typically this primary secondary
does not need to be used.
If not defined, the value of this attribute will default to
type="primary"
advertise
This option can be used to include the service UUID in the advertisement packet payload.
Up to eight 16-bit UUIDs or one 128-bit UUID will fit into the advertisement data of BLE firmware.
Up to thirteen 16-bit UUIDs or one 128-bit UUID will fit into the advertisement data of BT121
firmware.
Note: you can use custom advertisements with the dedicated BGAPI/BGScript configuration
commands, in which case this option will not be valid.
Options:
true : UUID is included in advertisement data
false : UUID is not included in advertisement data (default)
NOTE! Service with attribute set to must be placed in one of the 8 first services
advertise "true"
of the gatt.xml tree.