Dela via


GattCharacteristicNotificationTrigger Constructors

Definition

Overloads

GattCharacteristicNotificationTrigger(GattCharacteristic)

Initializes a new instance of the GattCharacteristicNotificationTrigger class.

GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode)

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

GattCharacteristicNotificationTrigger(GattCharacteristic)

Initializes a new instance of the GattCharacteristicNotificationTrigger class.

public:
 GattCharacteristicNotificationTrigger(GattCharacteristic ^ characteristic);
 GattCharacteristicNotificationTrigger(GattCharacteristic const& characteristic);
public GattCharacteristicNotificationTrigger(GattCharacteristic characteristic);
function GattCharacteristicNotificationTrigger(characteristic)
Public Sub New (characteristic As GattCharacteristic)

Parameters

characteristic
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.

Applies to

GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode)

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

public:
 GattCharacteristicNotificationTrigger(GattCharacteristic ^ characteristic, BluetoothEventTriggeringMode eventTriggeringMode);
 GattCharacteristicNotificationTrigger(GattCharacteristic const& characteristic, BluetoothEventTriggeringMode const& eventTriggeringMode);
public GattCharacteristicNotificationTrigger(GattCharacteristic characteristic, BluetoothEventTriggeringMode eventTriggeringMode);
function GattCharacteristicNotificationTrigger(characteristic, eventTriggeringMode)
Public Sub New (characteristic As GattCharacteristic, eventTriggeringMode As BluetoothEventTriggeringMode)

Parameters

characteristic
GattCharacteristic

The GATT characteristic that you want value change notifications for.

eventTriggeringMode
BluetoothEventTriggeringMode

Specifies when the trigger is activated.

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v4.0)

Applies to