【问题标题】:How to discover Bluetooth Low Energy Device(BLE) from Windows Phone 8.1如何从 Windows Phone 8.1 发现蓝牙低功耗设备 (BLE)
【发布时间】:2014-07-24 08:06:30
【问题描述】:

我正在编写 Silverlight Windows Phone 8.1 应用程序,我正在尝试从 Windows Phone 8.1 连接蓝牙低功耗 (BLE) 设备,该设备是“心率”,但我没有得到结果。请参阅下面的代码。

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

   }
}

我还在 appmanifest 文件中添加了功能。

<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>

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

【问题讨论】:

    标签: c# bluetooth-lowenergy windows-phone-8.1


    【解决方案1】:

    必须先在手机的“设置->蓝牙”中配对心率传感器。

    【讨论】:

    • user3224741,是否可以在不配对的情况下获取 BLE 设备数据,例如 MAC 地址和名称等?感谢您的回复。
    • 它可能在广告数据中可见。
    猜你喜欢
    • 2015-01-16
    • 2021-04-09
    • 1970-01-01
    • 2015-05-05
    • 2016-06-14
    • 2021-04-06
    • 1970-01-01
    • 1970-01-01
    • 2013-11-17
    相关资源
    最近更新 更多