TI CC2540 Bluetooth low energy Sample Applications Guide v1.4.1 SWRU297 Version 1.4.1
Page 11 of 36
Copyright © 2011-2015 Texas Instruments, Inc
3.2.7 Thermometer Measurement Format
Temperature
Measurement Value
Temperature Type
(if present)
Based on bit 0 of Flags
field
4 Heart Rate Sensor
This sample project implements the Heart Rate and Battery profiles in a BLE peripheral device to
provide an example heart rate sensor using simulated measurement data. The application
implements the "Sensor" role of the Heart Rate profile and the "Battery Reporter" role of the
Battery profile. The project is based on adopted profile and service specifications for Health Rate
([6] and [7]). The project also includes the Device Information Service ([12]).
The project can be opened with the following IAR workspace file:
C:\Texas Instruments\BLE-CC254x-1.4.1\Projects\ble\HeartRate\CC2540DB\heartrate.eww
4.1 Project Overview
The project structure is very similar to that of the SimpleBLEPeripheral project. The APP directory
contains the application source code and header files. The project contains one configuration,
CC2540DK-MINI Keyfob Slave, using the keyfob hardware platform.
4.1.1 User Interface
When not connected, the keyfob's right button is used to toggle advertising on and off. When in a
connection, the keyfob's left button cycles through different heart rate sensor data formats and the
right button sends a battery level-state notification.
4.1.2 Basic Operation
Power up the device and press the right button to enable advertising. From a heart rate collector
peer device, initiate a device discovery and connection procedure to discover and connect to the
heart rate sensor. The peer device should discover the heart rate service and configure it to
enable notifications of the heart rate measurement. The peer device may also discover and
configure the battery service for battery level-state notifications.
Once heart rate measurement notifications have been enabled the application will begin sending
data to the peer containing simulated measurement values. Pressing the left button cycles
through different data formats as follows:
Sensor contact not supported.
Sensor contact not detected.
Sensor contact and energy expended set.
Sensor contact and R-R Interval set.
Sensor contact, energy expended, and R-R Interval set.
Sensor contact, energy expended, R-R Interval, and UINT16 heart rate set.
Nothing set.
If the peer device initiates pairing then the devices will pair. Only "just works" pairing is supported
by the application (pairing without a passcode).
The application advertises using either a fast interval or a slow interval. When advertising is
initiated by a button press or when a connection is terminated due to link loss, the application will
start advertising at the fast interval for 30 seconds followed by the slow interval. When a
connection is terminated for any other reason the application will start advertising at the slow
interval. The advertising intervals and durations are configurable in file heartrate.c.
4.2 Software Description