Version: Smart Feature Phone 3.0

BluetoothGattAttributeEvent

Description#

The BluetoothGattAttributeEvent interface of the Bluetooth API provides access to an updated BluetoothGattCharacteristic object as the parameter of the BluetoothGattServer.onattributereadreq or BluetoothGattServer.onattributereadreq, handler, when the event is fired.

Interface overview#

[Exposed=Window]
interface BluetoothGattAttributeEvent : Event
{
readonly attribute DOMString address;
readonly attribute long requestId;
readonly attribute BluetoothGattCharacteristic? characteristic;
readonly attribute BluetoothGattDescriptor? descriptor;
[Throws]
readonly attribute ArrayBuffer? value;
readonly attribute boolean needResponse;
};

Properties#

Returns a representing the characteristic that has been updated as a result of a remote notification event.

  • BluetoothGattAttributeEvent.address read-only A string representing the address of the device which want the GATT request.

  • BluetoothGattAttributeEvent.requestId read-only The ID of the request which can be used as parameter of BluetoothGattServer.sendResponse.

  • BluetoothGattAttributeEvent.characteristic read-only The target BluetoothGattCharacteristic of the GATT request. This property will return null if the request isn't made for characteristic.

  • BluetoothGattAttributeEvent.descriptor read-only The target BluetoothGattDescriptor of the GATT request. This property will return null if the request isn't made for descriptor.

  • BluetoothGattAttributeEvent.value read-only ArrayBuffer Returns an ArrayBuffer representing the value of the GATT write request. This property will return null if the request isn't made for write request.

  • BluetoothGattAttributeEvent.needResponse read-only A boolean indicating whether a response is needed for the GATT request.