Declaring the Right Device Capability

To use a custom device, regardless of protocol, you must specify an appropriate device capability in your package manifest. The one exception to this is Wi-Fi Direct, covered at the end of this chapter. Specifying the capability must be done directly in the XML as follows, due to lack of support in Visual Studio’s package manifest designer:

<Capabilities>   <m2:DeviceCapability Name="protocol"> <m2:Device Id="device">       <m2:Function Type="functionType"/>     </m2:Device>   </m2:DeviceCapability>   ... </Capabilities>

Unlike the DeviceCapability element used with pointOfService, this one must be prefixed with the m2 prefix that corresponds to the Windows 8.1 XML namespace. ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.