1的蓝牙低功耗设备

1的蓝牙低功耗设备

本文介绍了如何从发现的Windows Phone 8.1的蓝牙低功耗设备(BLE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个Silverlight的Windows Phone 8.1的应用程序,我想用蓝牙低功耗(BLE)设备连接从Windows 8.1手机,该设备为心率,但我没有得到的结果。请参阅下面我的代码。

I am writing a Silverlight Windows Phone 8.1 application, I am trying to connect with Bluetooth Low Energy(BLE) device from Windows Phone 8.1, the device is "HEART RATE", but I'm not getting the result. See my code below.

protected async override void OnNavigatedTo(NavigationEventArgs e)
{
var devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid
                           (GattServiceUuids.HeartRate));
   if (devices.Count > 0)
   {

   }
}

我还增加了能力在appmanifest文件

I have also added capability in appmanifest file.

<Capabilities>
 <Capability Name="internetClient"/>
    <m2:DeviceCapability Name="bluetooth.genericAttributeProfile">
      <m2:Device Id="any">
      <m2:Function Type="name:heartRate" />
       <m2:Function Type="serviceId:0000180d-0000-1000-8000-00805f9b34fb" />
     </m2:Device>
</m2:DeviceCapability>



似乎一切都很好,但我没有得到的输出。这是怎么回事了?

Everything seems fine, but I don't get the output. What's going wrong?

推荐答案

的心脏速率传感器必须在手机上先在设置 - >蓝牙配对。

The heart rate sensor has to be paired first in the "settings->Bluetooth" on your phone.

这篇关于如何从发现的Windows Phone 8.1的蓝牙低功耗设备(BLE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 12:55