RN4870/71 Bluetooth
®
Low Energy Module User’s Guide
DS50002466A-page 44 2016 Microchip Technology Inc.
2.9.2 CHR
According to the command-interpolation method described in in
Section 2.9.1 “Definition of Characteristic Access Commands”, command CHR reads
the content of the client service characteristic from the remote device by addressing its
handle.
Command CHR takes one parameter, the 16-bit hex value of the handle, which corre-
sponds to the characteristic of the client service. The user must be able to find match
between the handle and its characteristic UUID by using command LC.
This command is effective under the following conditions:
• An active connection with peer exists
• Client operation has started by command CI
• The handle parameter is valid and the corresponding characteristic is readable
according to its property.
The value returned is retrieved from the remote peer device.
2.9.3
CHW
According to the command-interpolation method described in Section 2.9.1 “Definition
of Characteristic Access Commands”, command CHW writes the content of the client
service characteristic from the remote device by addressing its handle.
This command takes two parameters. The first parameter is the 16-bit hex value of the
handle corresponding to the characteristic of the client service. The user must be able
to find match between the handle and its characteristic UUID by using command LC.
The second parameter is the content to be written to the characteristic. The format of
public characteristics are defined in the Bluetooth SIG specifications. The user defines
the format of each private characteristic.
This command is effective under the following conditions:
• An active connection with a peer device exists
• Client operation is started by command CI
• The handle parameter is valid and the corresponding characteristic is writable
according to its property.
The content value is written to the remote peer device. The writing method depends on
the property of the characteristic.
When writing to a configuration handle to the remote device, Bluetooth specification
defines the format to be 0x0000, 0x0001 or 0x0002. Value 0x0001 (01 00 over the
air in little Endian) starts the notification, value 0x0002 (02 00 over the air in little
Endian) starts the indication and value 0x0000 stops both. To start notification or indi-
cation depends on service specification as well as on the property of the characteristic.
Refer to Tab le A- 1 in Appendix A. “Bluetooth Low Energy Fundamentals” and
Figure 2-2 for details.
Example: CHR,001A // Read the content of characteristic with
// handle 0x001A from remote device
Response: <Value read>
ERR
%ERR_READ%
// Success
// Syntax error, invalid parameter, not connected or
// characteristic not readable
// Status string