2016 Microchip Technology Inc.
DS50002547A-page 31
5.
PC,BF3FBD80063F11E59E690002A5D5C504,10,02
to declare a two-byte
characteristic with notify property enabled. This characteristic stores the value of
the ADC channel used for the RN4870 internal temperature sensor.
6.
PC,BF3FBD80063F11E59E690002A5D5C505,10,02
to declare a two-byte
characteristic with notify property enabled. This characteristic stores the value of
the ADC channel used for the RN4870 internal battery voltage sensor.
7. Command
R,1
to reboot the RN4870 module
8. Command
$$$
to enter Command mode
9. Command
+
to enable local echo
10. Command
LS
(list services) to display Sensor Board GATT Service as shown in
FIGURE 4-2:
SENSOR BOARD GATT SERVICE DECLARED IN RN4870
illustrates that a custom GATT service has been created in the RN4870
module. A 16-bit handle is assigned to each characteristic where each characteristic
has a value in the handle and a property handle. The characteristic value and the prop-
erties are accessed by a short and more efficient 16-bit handle instead of the 128-bit
UUID value. For example, two handles 0072 and 0073 are associated with the GATT
characteristic
BF3FBD80063F11E59E690002A5D5C501
. A GATT client, such as a
smartphone App, uses 0072 to read/write characteristic values, while 0073 is used to
enable/disable the notify property.
The next step is to transfer the sensor values from the peripheral IO into the GATT
characteristics. This is done with the RN4870 scripting feature as described in
Section 4.4 “Transferring Sensor Data into GATT Service Using Scripting”