Possible keys for AlternateIdentities in Peerfinder

前端 未结 1 1521
小蘑菇
小蘑菇 2021-01-14 01:35

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

Following the example as shown in the Build presentation:

相关标签:
1条回答
  • 2021-01-14 02:17

    Windows Phone 8 bluetooth APIs can really only be used in a few ways (and those are driven by 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) 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) 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.

    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.

    0 讨论(0)
提交回复
热议问题