简体   繁体   中英

Windows Phone 8.1 connecting to Bluetooth Smart Heart Rate Monitor

I'm having issues trying to find my Bluetooth Smart heart rate monitor in a Windows Phone app I'm creating. To start I'm using the sample app from MSDN that demonstrates use of the Bluetooth Generic Attribute Profile (Gatt) Windows Runtime API. This is a new API available for WP 8.1.

The following snippet is where the heart rate monitor discovery takes place:

        var devices = await DeviceInformation.FindAllAsync(
            GattDeviceService.GetDeviceSelectorFromUuid(GattServiceUuids.HeartRate),
            new string[] { "System.Devices.ContainerId" });

After debugging on my phone the devices found is always zero. After some research I believe this is because the DeviceInformation.FindAllAsync method only returns devices that has been already paired on the phone using the system settings. I am unable to pair my heart rate monitor in the Bluetooth system settings as it cannot find it. I've tested it on my PC and it can find the heart rate monitor however it always fails when I try to pair it.

One thing to note is that I am able to use my heart rate monitor with the Adidas miCoach app (which does not require pairing through the system settings). The discovery and connection takes place directly in the app. Does any know how this works?

My hardware:

  • Wahoo Tickr heart rate monitor
  • Lumia 925 (OS version: 8.10.12397.895)

Resources:

UPDATE 2014-07-23: I'm running the Lumia Cyan update and the Tickr heart rate monitor now shows up in the Bluetooth system settings, however I am unable to pair it. I get the error message "couldn't connect". This is the same behaviour as on a PC. Interestingly I can no longer connect the Tickr heart rate monitor to the miCoach app. It seems like they updated the app and the page for configuring a heart rate monitor has changed.

You'll need Windows Phone 8.1 with Nokia Cyan update, otherwise you won't be able to pair your HRM. For testing, you could get an HTC phone, or a 630, that comes with Cyan.

The phone itself supports BLE heart rate monitor obviously, but the API to access the monitor is private. That's why micoach / Sports Tracker can access it, but your app (which uses the official 8.1 API) cannot until Cyan.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM