nRF51 SDK - S310 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ANT and BLE Heart Rate Monitor Relay Application

The Heart Rate Application is an example that implements the Heart Rate profile using the hardware delivered in the nRF51 Development Kit. It also implements the ANT Heart Rate Profile receiver. The aggregated data received from ANT is relayed and sent as BLE notifications.

The application includes the two BLE services in the Heart Rate profile:

When notification of Heart Rate Measurement characteristic is enabled, the Heart Rate Measurement, containing the current value for all the components of the Heart Rate Measurement characteristic, is notified each time there is new data received from the ANT connection.

This example is based on the S110 BLE Heart Rate application (ble_app_hrs_s110_pca10028). See that example for additional documentation.

Note
This application is not power optimized!
The application will stop advertising after 3 minutes and go to system-off mode. Push the button 1 restart advertising.

Setup

The name of the example is ble_ant_app_hrm_pca10028. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder: <InstallFolder>\Nordic\nrf51\examples\multiprotocol\ble_ant_app_hrm

LED assignments:

  • LED 0: Advertising
  • LED 1: Connected
  • LED 7: Asserted (an assert check in the application has failed)

Button assignments:

  • Button 1: Wake up from system-off and restart advertising.
  • Button 2: Wake up, erase all bonds, and restart advertising.

Testing

Test the Heart Rate Relay Application with the nRF Toolbox app, which is available on both iOS (Apple Store) and Android (Google Play).

You can also test the application with the Master Control Panel by performing the following steps:

  1. Compile and program the application. Observe that the Advertising LED is lit.
  2. Connect to the device from Master Control Panel (the device will be advertising as 'Nordic_HRM'), then perform service discovery. Observe that the Connected LED is lit, and the Advertising LED is off.
  3. Click the 'Enable services' button on the Master Control Panel. Observe that Heart Rate notifications are received every second.
  4. Compile and program the ANT Heart Rate Monitor (HRM) transmitter example on the second board as a peer ANT device. The name of the example for PCA10028 is ant_hrm_tx_buttons_pca10028, and for PCA10031 it is ant_hrm_tx_buttons_pca10031. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder: <InstallFolder>\Nordic\nrf51\examples\ant\ant_hrm\hrm_tx_buttons Alternatively, you can connect to an ANT heart rate belt if you change ANT_HRMRX_NETWORK_KEY to the ANT+ Network Key.
    Note
    The ANT+ Network Key is available for ANT+ Adopters. See http://thisisant.com for information about how to become an ANT+ Adopter and access the key.
  5. Press the buttons on the board to increase or decrease the transmitted heart rate.
  6. Observe that the value recieved in the Heart Rate notifications change according to the button presses.