Peerfinder中AlternateIdentities的可能键

时间:2012-11-21 09:42:35

标签: bluetooth windows-phone-8 proximity

我正试图通过在Windows 8 / Windows Phone 8中使用PeerFinder类来控制特定设备。

按照构建演示文稿中显示的示例:http://channel9.msdn.com/Events/Build/2012/3-047

我使用这些线路获得配对的蓝牙设备:

PeerFinder.AlternateIdentities["Bluetooth:PAIRED"] = "";

var devices = await PeerFinder.FindAllPeersAsync();

但现在我想获得一个通过蓝牙甚至其他设备连接的设备列表:

PeerFinder.AlternateIdentities[KEY] = "";

代码行。在这种情况下,MSDN文档没有帮助。

1 个答案:

答案 0 :(得分:3)

Windows Phone 8蓝牙API实际上只能在几个方面使用(而这些是由AlternateIdentities驱动的):

1) app-to-device / WP8-to-device 。这仅适用于配对设备。 WP8蓝牙API无法与未配对的蓝牙设备通信。正如您所发现的那样 AlternateIdentities [“Bluetooth:Paired”] =“”是用于此用例的正确选择。

2) app-to-app / WP8-to-WP8 。这允许WP8应用程序与不同手机上的同一个应用程序进行通信。您特别需要避免为应用程序到应用程序设置AlternateIdentities

3) app-to-app / WP8-to-Win8 。在两端使用特定的AlternativeIdentities,也可以让app-to-app适用于WP8-to-Win8。您需要将Win8上的 PeerFinder.AlternateIdentities [“WindowsPhone”] 设置为WP8应用程序GUID,并且您需要添加 PeerFinder.AlternateIdentities.Add(“Windows”,GUID )在WP8上运行到Win8应用程序GUID。

我们尚未公开分享其他AlternateIdentities格式,因为它们不适用于第三方开发者。当考虑在WP8上使用蓝牙的用户时,重点关注应用程序到应用程序和应用程序到设备。