1
votes

How to read heart rate data from polar h7 heart rate monitor device? I'm using evothings phonegap plugin for android. I am able to read service data which include a list of characteristics, handle values. But how to read heart rate value?

// ..
{
    "type": 0,
    "uuid": "0000180d-0000-1000-8000-00805f9b34fb",
    "handle": 3,
    "characteristics": [
      {
        "permissions": 0,
        "writeType": 2,
        "properties": 16,
        "uuid": "00002a37-0000-1000-8000-00805f9b34fb",
        "handle": 13,
        "descriptors": [
          {
            "permissions": 0,
            "uuid": "00002902-0000-1000-8000-00805f9b34fb",
            "handle": 24
          }
        ]
      },
      {
        "permissions": 0,
        "writeType": 2,
        "properties": 2,
        "uuid": "00002a38-0000-1000-8000-00805f9b34fb",
        "handle": 14,
        "descriptors": [

        ]
      }
    ]
  }, // ...

Calling evothings.ble.enableNotification(1, 13, ..) is giving null.

1

1 Answers

2
votes

Looks like the Polar H7 follows the Heart Rate Profile specification. Of interest is the heart_rate_measurement characteristic, which has UUID 2a37 and can be seen in your list.

Calling evothings.ble.enableNotification is only half of what you need to do. You must also call evothings.ble.writeDescriptor(1, 24, new Uint8Array([1,0]), ...) to actually start the notification.

If notification fails, you can use readDescriptor() to poll.