Bluetooth: Central Heart Rate Monitor with Coded PHY
The Central Heart Rate Monitor with Coded PHY offers similar functionality to the Bluetooth: Central / Heart-rate Monitor sample from Zephyr. However, this sample specifically looks for heart rate monitors using LE Coded PHY.
The sample supports the following development kits:
If you use nRF5340 DK, the additional configuration of the network core will be taken from the
For more details, see Image-specific variables.
The sample also requires a device running a Heart Rate Server with LE Coded PHY support to connect to. For example, another development kit running the Bluetooth: Peripheral Heart Rate Monitor with Coded PHY sample.
The sample demonstrates a Bluetooth® LE Central role functionality by scanning for other Bluetooth LE devices that run a Heart Rate Server with LE Coded PHY support, which is not available in Zephyr Bluetooth LE Controller. See Bluetooth LE Controller for more information. It then establishes a connection to the first Peripheral device in range. You can use it together with the Bluetooth: Peripheral Heart Rate Monitor with Coded PHY sample.
This sample can be found under
samples/bluetooth/central_hr_coded in the nRF Connect SDK folder structure.
To build the sample with Visual Studio Code, follow the steps listed on the How to build an application page in the nRF Connect for VS Code extension documentation. See Configuring and building an application for other building scenarios, Programming an application for programming steps, and Testing for general information about testing and debugging in the nRF Connect SDK.
After programming the sample to your development kit, you can test it by connecting to another development kit that runs the Bluetooth: Peripheral Heart Rate Monitor with Coded PHY.
Connect to the kit that runs this sample with a terminal emulator (for example, nRF Connect Serial Terminal). See Testing and optimization for the required settings and steps.
Reset the kit.
Program the other kit with the Bluetooth: Peripheral Heart Rate Monitor with Coded PHY sample.
Wait until the Coded advertiser is detected by the Central. In the terminal window, check for information similar to the following:
Filters matched. Address: xx.xx.xx.xx.xx.xx (random) connectable: yes Connection pending Connected: xx.xx.xx.xx.xx.xx (random), tx_phy 4, rx_phy 4 The discovery procedure succeeded
Observe that the received notifications are output in the terminal window:
[SUBSCRIBED] Heart Rate Measurement notification received: Heart Rate Measurement Value Format: 8 - bit Sensor Contact detected: 1 Sensor Contact supported: 1 Energy Expended present: 0 RR-Intervals present: 0 Heart Rate Measurement Value: 113 bpm
This sample uses the following nRF Connect SDK libraries:
In addition, it uses the following Zephyr libraries: