2016 Microchip Technology Inc.
DS50002547A-page 35
FIGURE 4-7:
BLE DATA FLOW FROM SENSOR BOARD PERIPHERAL IO
TO BLESENSORAPP
illustrates the data flow from the RN4870 Sensor Peripheral IO to the smart-
phone app. The data streaming from the Sensor board to the App is performed by
GATT Notifications. The script polls the sensor values, such as Switch, Light Meter, and
writes the values into the appropriate GATT Characteristic. If the values change, a
GATT Notification is sent to the BLESensorApp where the App updates the Graphical
User Interface (GUI).
BLE data can also be transferred from the BLESensorApp to the RN4870 module, and
later processed by the script to write a received value into the Peripheral output chan-
nel. In the Sensor board demo, slider control is used on the App to select a blink rate
value. The value is written to the GATT characteristic in the RN4870. The sensor script
monitors the Characteristic for incoming data then extracts the value which is subse-
quently written to the Pulse-With Modulation (PWM) output peripheral to control LED
blink rate.
For more information on the BLE GATT data transfers, refer to
C. “Bluetooth Low Energy Primer”
.