語言

BluetoothGattServer.NotifyCharacteristicChanged 方法

定義

多載

NotifyCharacteristicChanged(BluetoothDevice, BluetoothGattCharacteristic, Boolean)

發送通知或提示當地特徵已更新。

[Android.Runtime.Register("notifyCharacteristicChanged", "(Landroid/bluetooth/BluetoothDevice;Landroid/bluetooth/BluetoothGattCharacteristic;Z)Z", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool NotifyCharacteristicChanged(Android.Bluetooth.BluetoothDevice? device, Android.Bluetooth.BluetoothGattCharacteristic? characteristic, bool confirm);
[<Android.Runtime.Register("notifyCharacteristicChanged", "(Landroid/bluetooth/BluetoothDevice;Landroid/bluetooth/BluetoothGattCharacteristic;Z)Z", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.NotifyCharacteristicChanged : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.BluetoothGattCharacteristic * bool -> bool

參數

device
BluetoothDevice

接收通知/指示的遠端裝置

characteristic
BluetoothGattCharacteristic

已更新的當地特徵

confirm
Boolean

True 表示向客戶端請求確認(指示),false 表示發送通知

傳回

true,若通知已成功觸發

屬性

例外狀況

備註

發送通知或提示當地特徵已更新。

會向遠端裝置發送通知或指示,以表示特徵已更新。 每個請求通知/指示的客戶端,應透過寫入該特徵的「客戶端配置」描述符來呼叫此函式。

此會員已被棄用。 因為 BluetoothGattServer#notifyCharacteristicChanged(BluetoothDevice, BluetoothGattCharacteristic, boolean, byte[]) 這不是記憶體安全。

Java 文件 android.bluetooth.BluetoothGattServer.notifyCharacteristicChanged(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothGattCharacteristic, boolean)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

NotifyCharacteristicChanged(BluetoothDevice, BluetoothGattCharacteristic, Boolean, Byte[])

發送通知或提示當地特徵已更新。

[Android.Runtime.Register("notifyCharacteristicChanged", "(Landroid/bluetooth/BluetoothDevice;Landroid/bluetooth/BluetoothGattCharacteristic;Z[B)I", "", ApiSince=33)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public int NotifyCharacteristicChanged(Android.Bluetooth.BluetoothDevice device, Android.Bluetooth.BluetoothGattCharacteristic characteristic, bool confirm, byte[] value);
[<Android.Runtime.Register("notifyCharacteristicChanged", "(Landroid/bluetooth/BluetoothDevice;Landroid/bluetooth/BluetoothGattCharacteristic;Z[B)I", "", ApiSince=33)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.NotifyCharacteristicChanged : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.BluetoothGattCharacteristic * bool * byte[] -> int

參數

device
BluetoothDevice

接收通知/指示的遠端裝置

characteristic
BluetoothGattCharacteristic

已更新的局部特徵

confirm
Boolean

true 向客戶端請求確認(指示)或 false 發送通知

value
Byte[]

特徵值

傳回

通知是否已成功觸發

屬性

備註

發送通知或提示當地特徵已更新。

會向遠端裝置發送通知或指示,以表示特徵已更新。 每個請求通知/指示的客戶端,應透過寫入該特徵的「客戶端配置」描述符來呼叫此函式。

Java 文件 android.bluetooth.BluetoothGattServer.notifyCharacteristicChanged(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothGattCharacteristic, boolean, byte[])。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於