BluetoothGatt.SetCharacteristicNotification Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Activez ou désactivez les notifications/indications pour une caractéristique donnée.
[Android.Runtime.Register("setCharacteristicNotification", "(Landroid/bluetooth/BluetoothGattCharacteristic;Z)Z", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool SetCharacteristicNotification(Android.Bluetooth.BluetoothGattCharacteristic? characteristic, bool enable);
[<Android.Runtime.Register("setCharacteristicNotification", "(Landroid/bluetooth/BluetoothGattCharacteristic;Z)Z", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.SetCharacteristicNotification : Android.Bluetooth.BluetoothGattCharacteristic * bool -> bool
Paramètres
- characteristic
- BluetoothGattCharacteristic
Caractéristique pour laquelle activer les notifications
- enable
- Boolean
Défini sur true pour activer les notifications/indications
Retours
true, si l’état de notification demandé a été défini avec succès
- Attributs
Remarques
Activez ou désactivez les notifications/indications pour une caractéristique donnée.
Une fois les notifications activées pour une caractéristique, un BluetoothGattCallback#onCharacteristicChanged(BluetoothGatt, BluetoothGattCharacteristic, byte[]) rappel est déclenché si l’appareil distant indique que la caractéristique donnée a changé.
Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.