Peerfinder 中 AlternateIdentities 的可能键 [英] Possible keys for AlternateIdentities in Peerfinder

查看:16
本文介绍了Peerfinder 中 AlternateIdentities 的可能键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Windows 8/Windows Phone 8 中的 PeerFinder 类来控制特定设备.

I'm trying to get a hold on specific devices by using the PeerFinder class in Windows 8 / Windows Phone 8.

按照构建演示中所示的示例进行操作:http://channel9.msdn.com/Events/Build/2012/3-047

Following the example as shown in the Build presentation: http://channel9.msdn.com/Events/Build/2012/3-047

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

I got the paired bluetooth devices by using these lines:

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

var devices = await PeerFinder.FindAllPeersAsync();

但现在我想获取通过蓝牙或什至其他设备连接的设备列表:

But now I would like to get a list of devices that are connected via bluetooth or maybe even other devices by using a different key in the:

PeerFinder.AlternateIdentities[KEY] = "";

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

line of code. The MSDN documentation isn't helpful in this case.

推荐答案

Windows Phone 8 蓝牙 API 实际上只能以几种方式使用(这些方式由 AlternateIdentities 驱动):

Windows Phone 8 bluetooth APIs can really only be used in a few ways (and those are driven by AlternateIdentities):

1) 应用到设备/WP8 到设备.这仅适用于配对设备.WP8 蓝牙 API 无法与未与其配对的蓝牙设备进行通信.正如您发现的那样,AlternateIdentities["Bluetooth:Paired"]="" 适合用于此用例.

1) app-to-device / WP8-to-device. This will only work for paired devices. WP8 bluetooth APIs cannot communicate with bluetooth devices that aren't paired to it. As you've discovered AlternateIdentities["Bluetooth:Paired"]="" is the right thing to use for this usecase.

2) 应用到应用/WP8 到 WP8.这允许 WP8 应用程序与不同手机上的相同应用程序进行通信.您特别需要避免设置 AlternateIdentities 以使应用到应用工作.

2) app-to-app / WP8-to-WP8. This allows WP8 apps to communicate with the same app on different phones. You specifically need to avoid setting AlternateIdentities for app-to-app to work.

3) 应用到应用/WP8 到 Win8.在两端使用特定的 AlternativeIdentities 还可以让应用程序到应用程序为 WP8-to-Win8 工作.您需要将 Win8 上的 PeerFinder.AlternateIdentities["WindowsPhone"] 设置为 WP8 应用程序 GUID,并且您需要添加 PeerFinder.AlternateIdentities.Add("Windows",GUID) 到 Win8 应用程序 GUID.

3) app-to-app / WP8-to-Win8. Using specific AlternativeIdentities on both ends it's also possible to get app-to-app to work for WP8-to-Win8. You'll need to set PeerFinder.AlternateIdentities["WindowsPhone"] on Win8 to the WP8 app GUID, and you'll need to add PeerFinder.AlternateIdentities.Add("Windows",GUID) on WP8 to the Win8 app GUID.

我们还没有公开分享其他 AlternateIdentities 格式,因为它们不适用于 3rd 方开发者.在考虑 WP8 上的蓝牙用例时,重点关注应用到应用和应用到设备.

There are other AlternateIdentities formats we haven't shared publicly since they don't apply to 3rd party developers. When thinking about usecases for Bluetooth on WP8 focus on app-to-app and app-to-device.

这篇关于Peerfinder 中 AlternateIdentities 的可能键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆