2016 Microchip Technology Inc. DS50002466A-page 45
2.9.4 CI
Command CI is used to start client operation on the RN4870/71.
RN4870/71 starts as a GATT server by default. If the user also prefers RN4870/71 to
act as a GATT client, command CI must be issued first.
Command CI performs essential service discovery process with the remote GATT
server and acquires supported public and private services and characteristics on the
remote GATT server. RN4870/71 supports up to five client public services and four cli-
ent private services. Each client service is able to define up to eight characteristics.
Since RN4870/71 needs to acquire the client service information over Bluetooth link, a
connection with the remote GATT server must be established before command CI is
used.
Since command CI retrieves critical client information from the remote GATT server, it
is a perquisite over any Client Service related commands, such as LC, CHR and CHW.
2.9.5
SHR
According to the command-interpolation method described in Section 2.9.1 “Definition
of Characteristic Access Commands”, command SHR reads the content of the server
service characteristic on the local device by addressing its handle.
Command SHR takes one parameter, the 16-bit hex value of the handle, which corre-
sponds to the server service characteristic. The user must be able to find match
between the handle and its characteristic UUID by using command LS.
This command is effective with or without an active connection. Reading the content of
a characteristic locally is always permitted regardless of the characteristic property.
Characteristic property is only used for remote access. The value returned is retrieved
from the local device and equals to what is written recently.
Example: CHW,001A,64 // Set value of characteristic with value handle
// 0x001A to be 100 on remote device
CHW,001B,0100 // Start notification on characteristic by writing
// 0x0001 to its configuration handle 0x001B
// on remote device
Response: AOK
ERR
// Success
// Syntax error, invalid parameter, not connected or
// characteristic not writable
Example: CI // Start client role on RN4870/71
Response: AOK
ERR
// Success
// Not connected
Example: SHR,001A // Read the local content of characteristic with
// handle 0x001A
Response: <Value read>
ERR
N/A
// Success
// Syntax error or invalid parameter
// Value has not been assigned