B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent

From MozillaWiki
Jump to navigation Jump to search

Overview

BluetoothAttributeEvent is carried as the parameter of attribute chagned event handlers, including adapter.onattributechanged and device.onattributechanged. Applications can get information about the changed attribute and its updated value.

Interface

[Func="Navigator::HasBluetoothSupport"]
interface BluetoothAttributeEvent : Event
{
  readonly attribute unsigned short attr;
  readonly attribute any            value;
  // We don't support sequences in unions yet (Bug 767924).
  // readonly attribute (BluetoothAdapter or BluetoothAdapterState or
                         BluetoothClassOfDevice or boolean or
                         DOMString or sequence<DOMString>) value;
};

Properties

attr

Description
The changed attribute's enumeration value. The enumeration is either BluetoothManagerAttribute, BluetoothAdapterAttribute, or BluetoothDeviceAttribute.
Value type
unsigned short

value

Description
The updated value of the changed attribute. Its type depends on attr's type.
Value type
any