Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 1.58 KB

gattcharacteristicnotificationtrigger_gattcharacteristicnotificationtrigger_507705716.md

File metadata and controls

32 lines (21 loc) · 1.58 KB
-api-id -api-type
M:Windows.ApplicationModel.Background.GattCharacteristicNotificationTrigger.#ctor(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic)
winrt method

Windows.ApplicationModel.Background.GattCharacteristicNotificationTrigger.GattCharacteristicNotificationTrigger

-description

Initializes a new instance of the GattCharacteristicNotificationTrigger class.

-parameters

-param characteristic

The GATT characteristic for which value change notifications are desired.

-remarks

To register for notifications when the value of a GATT characteristic changes, an app does the following:

  1. Create an instance of the GattCharacteristicNotificationTrigger object.

  2. Create an instance of the BackgroundTaskBuilder object, and call SetTrigger to attach the GattCharacteristicNotificationTrigger.

  3. Call Register on the BackgroundTaskBuilder object.

Note that this can only be done for Bluetooth LE devices, and only for characteristics for which the device is willing to generate notifications or indications. The system will attempt to keep the specified Bluetooth LE device in a connected state as long as at least one of the notification triggers is outstanding.

-examples

-see-also