This is a fork of mbed-os-example-ble-HeartRate maintained for Sequana compatibility. This application transmits a heart rate value using the Bluetooth SIG Heart Rate Profile. The heart rate value is provided by the application itself, not by a sensor, so that you don't have to get a sensor just to run the example. The canonical source for this example lives at https://github.com/ARMmbed/mbed-os-example-ble/tree/master/BLE_HeartRate

Committer:
lru
Date:
Tue Feb 12 14:03:29 2019 +0000
Revision:
0:b283842072f8
Initial version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lru 0:b283842072f8 1 # BLE Heart Rate Monitor
lru 0:b283842072f8 2
lru 0:b283842072f8 3 This application transmits a heart rate value using the [Bluetooth SIG Heart Rate Profile](https://developer.bluetooth.org/TechnologyOverview/Pages/HRP.aspx). The heart rate value is provided by the application itself, not by a sensor, so that you don't have to get a sensor just to run the example.
lru 0:b283842072f8 4
lru 0:b283842072f8 5 Technical details are better presented [in the mbed Classic equivalent of this example](https://developer.mbed.org/teams/Bluetooth-Low-Energy/code/BLE_HeartRate/).
lru 0:b283842072f8 6
lru 0:b283842072f8 7 # Running the application
lru 0:b283842072f8 8
lru 0:b283842072f8 9 ## Requirements
lru 0:b283842072f8 10
lru 0:b283842072f8 11 To see the heart rate information on your phone, use a BLE scanner:
lru 0:b283842072f8 12
lru 0:b283842072f8 13 - [nRF Master Control Panel](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp) for Android.
lru 0:b283842072f8 14
lru 0:b283842072f8 15 - [LightBlue](https://itunes.apple.com/gb/app/lightblue-bluetooth-low-energy/id557428110?mt=8) for iPhone.
lru 0:b283842072f8 16
lru 0:b283842072f8 17 Hardware requirements are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
lru 0:b283842072f8 18
lru 0:b283842072f8 19 ## Building instructions
lru 0:b283842072f8 20
lru 0:b283842072f8 21 Building instructions for all samples are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
lru 0:b283842072f8 22
lru 0:b283842072f8 23 ## Checking for success
lru 0:b283842072f8 24
lru 0:b283842072f8 25 **Note:** Screens captures depicted below show what is expected from this example if the scanner used is *nRF Master Control Panel* version 4.0.5. If you encounter any difficulties consider trying another scanner or another version of nRF Master Control Panel. Alternative scanners may require reference to their manuals.
lru 0:b283842072f8 26
lru 0:b283842072f8 27 1. Build the application and install it on your board as explained in the building instructions.
lru 0:b283842072f8 28 1. Open the BLE scanner on your phone.
lru 0:b283842072f8 29 1. Start a scan.
lru 0:b283842072f8 30
lru 0:b283842072f8 31 ![](img/start_scan.png)
lru 0:b283842072f8 32
lru 0:b283842072f8 33 **figure 1** How to start scan using nRF Master Control Panel 4.0.5
lru 0:b283842072f8 34
lru 0:b283842072f8 35 1. Find your device; it should be named `HRM`.
lru 0:b283842072f8 36
lru 0:b283842072f8 37 ![](img/scan_result.png)
lru 0:b283842072f8 38
lru 0:b283842072f8 39 **figure 2** Scan results using nRF Master Control Panel 4.0.5
lru 0:b283842072f8 40
lru 0:b283842072f8 41 1. Establish a connection with your device.
lru 0:b283842072f8 42
lru 0:b283842072f8 43 ![](img/connection.png)
lru 0:b283842072f8 44
lru 0:b283842072f8 45 **figure 3** How to establish a connection using Master Control Panel 4.0.5
lru 0:b283842072f8 46
lru 0:b283842072f8 47 1. Discover the services and the characteristics on the device. The *Heart Rate* service has the UUID `0x180D` and includes the *Heart Rate Measurement* characteristic which has the UUID `0x2A37`.
lru 0:b283842072f8 48
lru 0:b283842072f8 49 ![](img/discovery.png)
lru 0:b283842072f8 50
lru 0:b283842072f8 51 **figure 4** Representation of the Heart Rate service using Master Control Panel 4.0.5
lru 0:b283842072f8 52
lru 0:b283842072f8 53 1. Register for the notifications sent by the *Heart Rate Measurement* characteristic.
lru 0:b283842072f8 54
lru 0:b283842072f8 55 ![](img/register_to_notifications.png)
lru 0:b283842072f8 56
lru 0:b283842072f8 57 **figure 5** How to register to notifications using Master Control Panel 4.0.5
lru 0:b283842072f8 58
lru 0:b283842072f8 59
lru 0:b283842072f8 60 1. You should see the heart rate value change every half second. It begins at 100, goes up to 175 (in steps of 1), resets to 100 and so on.
lru 0:b283842072f8 61
lru 0:b283842072f8 62 ![](img/notifications.png)
lru 0:b283842072f8 63
lru 0:b283842072f8 64 **figure 6** Notifications view using Master Control Panel 4.0.5