【发布时间】: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