共用方式為


GattCharacteristicNotificationTrigger 建構函式

定義

多載

GattCharacteristicNotificationTrigger(GattCharacteristic)

初始化 GattCharacteristicNotificationTrigger 類別的新實例。

GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode)

使用指定的特性和觸發模式,初始化 GattCharacteristicNotificationTrigger 類別的新實例。

GattCharacteristicNotificationTrigger(GattCharacteristic)

初始化 GattCharacteristicNotificationTrigger 類別的新實例。

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

參數

characteristic
GattCharacteristic

需要值變更通知的 GATT 特性。

備註

若要在 GATT 特性的值變更時註冊通知,應用程式會執行下列動作:

  1. 建立 GattCharacteristicNotificationTrigger 物件的實例。

  2. 建立 BackgroundTaskBuilder 物件的實例,並呼叫 SetTrigger 附加 GattCharacteristicNotificationTrigger。

  3. 在 BackgroundTaskBuilder 物件上呼叫 Register

請注意,這只能在藍牙 LE 裝置上完成,而且僅適用于裝置願意產生通知或指示的特性。 只要至少有一個通知觸發程式未完成,系統就會嘗試讓指定的藍牙 LE 裝置保持線上狀態。

適用於

GattCharacteristicNotificationTrigger(GattCharacteristic, BluetoothEventTriggeringMode)

使用指定的特性和觸發模式,初始化 GattCharacteristicNotificationTrigger 類別的新實例。

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)

參數

characteristic
GattCharacteristic

您想要值變更通知的 GATT 特性。

eventTriggeringMode
BluetoothEventTriggeringMode

指定何時啟動觸發程式。

Windows 需求

裝置系列
Windows 10 Creators Update (已於 10.0.15063.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v4.0 引進)

適用於