在Peerfinder AlternateIdentities可能的密钥 [英] Possible keys for AlternateIdentities in Peerfinder

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

问题描述

我想通过在Windows中使用PeerFinder类来获取特定设备上的保持8 / Windows Phone的8。

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

以下所示的生成presentation的例子:的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] = "";

code线。 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 [蓝牙:配对] =的是用于该用例正确的事情。

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对Win8的工作。你需要设置Win8中的 PeerFinder.AlternateIdentities [的WindowsPhone] 的到WP8应用程序GUID,您将需要添加的 PeerFinder.AlternateIdentities.Add(窗口,GUID )的WP8上对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格式。当考虑用例的蓝牙WP8专注于应用程序到应用程序和app到设备。

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天全站免登陆