GattCharacteristicNotificationTrigger GattCharacteristicNotificationTrigger GattCharacteristicNotificationTrigger GattCharacteristicNotificationTrigger Class

Definition

Represents a trigger that launches a background task when an incoming change notification is received for a Bluetooth LE GATT characteristic.

public : sealed class GattCharacteristicNotificationTrigger : IBackgroundTrigger, IGattCharacteristicNotificationTrigger, IGattCharacteristicNotificationTrigger2
public sealed class GattCharacteristicNotificationTrigger : IBackgroundTrigger, IGattCharacteristicNotificationTrigger, IGattCharacteristicNotificationTrigger2
Public NotInheritable Class GattCharacteristicNotificationTrigger Implements IBackgroundTrigger, IGattCharacteristicNotificationTrigger, IGattCharacteristicNotificationTrigger2
var gattCharacteristicNotificationTrigger = new gattCharacteristicNotificationTrigger(characteristic);
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

GattCharacteristicNotificationTrigger(GattCharacteristic) GattCharacteristicNotificationTrigger(GattCharacteristic) GattCharacteristicNotificationTrigger(GattCharacteristic) GattCharacteristicNotificationTrigger(GattCharacteristic)

Initializes a new instance of the GattCharacteristicNotificationTrigger class.

public : GattCharacteristicNotificationTrigger(GattCharacteristic characteristic)
public GattCharacteristicNotificationTrigger(GattCharacteristic characteristic)
Public Sub New(characteristic As GattCharacteristic)
var gattCharacteristicNotificationTrigger = new gattCharacteristicNotificationTrigger(characteristic);
Parameters
characteristic
GattCharacteristic GattCharacteristic GattCharacteristic GattCharacteristic

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.

GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode) GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode) GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode) GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode)

Initializes a new instance of the GattCharacteristicNotificationTrigger class with the specified characteristic and triggering mode.

public : GattCharacteristicNotificationTrigger(GattCharacteristic characteristic, BluetoothEventTriggeringMode eventTriggeringMode)
public GattCharacteristicNotificationTrigger(GattCharacteristic characteristic, BluetoothEventTriggeringMode eventTriggeringMode)
Public Sub New(characteristic As GattCharacteristic, eventTriggeringMode As BluetoothEventTriggeringMode)
var gattCharacteristicNotificationTrigger = new gattCharacteristicNotificationTrigger(characteristic, eventTriggeringMode);
Parameters
characteristic
GattCharacteristic GattCharacteristic GattCharacteristic GattCharacteristic

The GATT characteristic that you want value change notifications for.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Properties

Characteristic Characteristic Characteristic Characteristic

Gets the GATT characteristic for which value change notifications are desired.

public : GattCharacteristic Characteristic { get; }
public GattCharacteristic Characteristic { get; }
Public ReadOnly Property Characteristic As GattCharacteristic
var gattCharacteristic = gattCharacteristicNotificationTrigger.characteristic;
Value
GattCharacteristic GattCharacteristic GattCharacteristic GattCharacteristic

The GATT characteristic for which value change notifications are desired.

EventTriggeringMode EventTriggeringMode EventTriggeringMode EventTriggeringMode

Gets the mode for the trigger. The mode specifies when the trigger is activated.

public : BluetoothEventTriggeringMode EventTriggeringMode { get; }
public BluetoothEventTriggeringMode EventTriggeringMode { get; }
Public ReadOnly Property EventTriggeringMode As BluetoothEventTriggeringMode
var bluetoothEventTriggeringMode = gattCharacteristicNotificationTrigger.eventTriggeringMode;
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)
See Also