加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

蓝牙 – Peerfinder中AlternateIdentities的可能键

发布时间:2020-12-14 05:25:34 所属栏目:Windows 来源:网络整理
导读:我试图通过使用 Windows 8 / Windows Phone 8中的PeerFinder类来控制特定设备. 按照Build演示文稿中显示的示例:http://channel9.msdn.com/Events/Build/2012/3-047 我使用这些线路获得配对的蓝牙设备: PeerFinder.AlternateIdentities["Bluetooth:PAIRED"]
我试图通过使用 Windows 8 / Windows Phone 8中的PeerFinder类来控制特定设备.

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

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

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

var devices = await PeerFinder.FindAllPeersAsync();

但现在我想获得一个通过蓝牙或甚至其他设备连接的设备列表,使用不同的密钥:

PeerFinder.AlternateIdentities[KEY] = "";

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

解决方法

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,并且您需要将WP8上的PeerFinder.AlternateIdentities.Add(“Windows”,GUID)添加到Win8应用程序GUID.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读