nRF5 SDK v17.0.0
ANT and BLE Heart Rate Monitor Relay Application
This example requires one of the following SoftDevices: S312, S332, S340

Important: Before you run this example, make sure to program the SoftDevice.

The ANT and BLE Heart Rate Monitor Relay Application shows the concurrent use of ANT and BLE protocols. It implements the Heart Rate profile using the hardware delivered in the nRF5 Development Kit. In addition, it implements the ANT Heart Rate Profile Receiver. The aggregated data received from ANT is relayed and sent as BLE notifications.

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

When notification of the 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 when new data is received from the ANT connection.

This example is based on the BLE Heart Rate Application (ble_app_hrs). 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. Press Button 1 to restart advertising.

Setup

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\multiprotocol\ble_ant_app_hrm

Button assignments:

Testing

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

You can also test the application with nRF Connect for Desktop by performing the following steps:

  1. Compile and program the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  2. Connect to the device from nRF Connect (the device is advertising as 'Nordic_HRM'). Observe that the BSP_INDICATE_CONNECTED state is indicated.
  3. Observe that the services are shown in the connected device and that you can start receiving values for the Heart Rate Service by clicking the Play button. 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. You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ant\ant_plus\ant_hrm\hrm_tx . 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 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 values received in the Heart Rate notifications change according to the button presses.

Documentation feedback | Developer Zone | Subscribe | Updated