Declaring the Right Device Capability

You declare a device capability for a Bluetooth Smart device the same way as shown in the previous section. In this case, however, the protocol (the Name value for the m2:DeviceCapability element) must be set to bluetooth.genericAttributeProfile. A different set of friendly service names are supported for well-known GATT services:

battery

bloodPressure

cyclingSpeedAndCadence

genericAccess

genericAttribute

glucose

healthThermometer

heartRate

runningSpeedAndCadence

These names are used with the m2:Function element, so here’s an example of declaring a capability for using any Bluetooth Smart blood pressure device:

<m2:DeviceCapability Name="bluetooth.genericAttributeProfile ...

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.