RN4870/71 PICtail™/PICtail Plus Daughter Board User’s Guide
DS50002547A-page 30
2016 Microchip Technology Inc.
2. Configure Module Features
a) Enter
S-,RN4870
to serialize Bluetooth name
b) Enter
SS,80
to enable Device Information Profile
c) Enter
SR,4040
to enable scripting start on PWR_ON event and disable
command prompt.
d) Enter
SW,01,00
for ADC input port 01 used by the light sensor
e) Enter
SW,02,00
for ADC input port 02 used by the potentiometer
f)
Enter
SW,03,00
to configure digital IO port connected to the LED
g) Enter
SW,04,09
to configure digital IO trigger connected to the
Push
button
h) Enter
R,1
to reboot the module
i)
Type
$$$
to re-enter Command mode
j)
Enter
+
to turn on local echo
k) Enter command
D
to display settings as show in
. Command
GW
is
used to return to the current IO configuration.
FIGURE 4-1:
RN4870 MODULE SETTINGS CONFIGURATION
4.3
SENSOR BOARD GATT SERVICE
The data from the RN4870 peripheral IO are stored in the characteristics of a custom
GATT service accessed by the Sensor Board BLE Client App. To create the Sensor
Board GATT Service, enter the following commands while in Command mode:
1.
PS,AD11CF40063F11E5BE3E0002A5D5C51B
to create a 128-bit UUID to
identify the GATT Service.
2.
PC,BF3FBD80063F11E59E690002A5D5C501,10,02
to declare a two-byte
characteristic with notify property enabled. This characteristic stores the value of
the ADC channel used for light sensor.
3.
PC,BF3FBD80063F11E59E690002A5D5C502,10,02
to declare a two-byte
characteristic with notify property enabled. This characteristic stores the value of
ADC channel used for potentiometer.
4.
PC,BF3FBD80063F11E59E690002A5D5C503,18,14
to declare a 20-byte
value used to manage both the
Push
button state (virtual LED in App) and the
LED blink rate on the Sensor board. Both notify and write properties are enabled
for this characteristic.