2016 Microchip Technology Inc. DS50002466A-page 43
2.9 CHARACTERISTIC ACCESS COMMANDS
The main function of BTLE is to expose information which can be accessed by a remote
device. This information is defined by GATT Service, where the service owns a set of
data values called Characteristics.
RN4870/71 provides a group of commands to define and access GATT services and
characteristics.
2.9.1
Definition of Characteristic Access Commands
RN4870 supports GAP server and client roles at the same time, per Bluetooth Core
Specification version 4.1. When performing dual roles as both server and client, two
sets of services and characteristics are known to RN4870.
When the RN4870 acts as a server, all service characteristics are stored locally. This
is called Server Services. Services where RN4870 acts as a client are called Client Ser-
vices. In this case all data and configurations of characteristics are stored remotely in
a peer device. To address server services, the first letter of characteristic access com-
mands is S; to address client services, the first letter of characteristic access com-
mands is C.
Bluetooth SIG adopted a group of public services specifications serving as the basis of
interoperability between devices. A 16-bit short UUID has been assigned to all services
and characteristics in the public service. Any -defined private services and its associ-
ated characteristics have 128-bit long UUIDs. In order to optimize the handling of a
128-bit characteristic UUIDs, Bluetooth provides the method of using 16-bit handles.
The handles are generated by the GATT server. The GATT client reads the handle val-
ues as part of the service discovery process when connecting to the GATT server. The
RN4870 provides commands to read and write both server and client attribute values
by using these handles. To address a characteristic by its handle, the second letter of
the characteristic access commands must be H.
To read a characteristic, the third letter of characteristic access commands is R; to write
a characteristic, the third letter of characteristic access commands is W.
Before addressing the characteristics, it is useful to know the accessible characteris-
tics. List commands group provides two commands, LC and LS, to list the client ser-
vices and the server services, respectively.
Tabl e 2-1 4 illustrates the three character formats of the GATT access command. Each
column represents a character of the GATT access command.
The GATT access command types are described in details below.
TABLE 2-14: FORMAT OF GATT ACCESS COMMANDS
1
GATT Role
2
Access Type
3
Operation
C - client
H - access by handle
R- read
S - server W- write