B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(replace any by sequence<DOMString> in attr event)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Overview ==
== Overview ==
'''BluetoothAttributeEvent''' is carried as the parameter of attribute chagned event handlers, including [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#onattributechanged|adapter.onattributechanged]] and [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#onattributechanged|device.onattributechanged]]. Applications can get information about the changed attribute and its updated value.
'''BluetoothAttributeEvent''' is carried as the parameter of attribute chagned event handlers, including [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onattributechanged|manager.onattributechanged]], [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#onattributechanged|adapter.onattributechanged]], and [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#onattributechanged|device.onattributechanged]]. Applications can get information about the changed attributes to query the updated values.


== Interface ==
== Interface ==
  [Func="Navigator::HasBluetoothSupport"]
  [CheckPermissions="bluetooth"]
  interface BluetoothAttributeEvent : Event
  interface BluetoothAttributeEvent : Event
  {
  {
   readonly attribute unsigned short [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent#attr|attr]];
   [Cached, Constant] readonly attribute sequence<DOMString> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent#attrs|attrs]];
  readonly attribute any            [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent#value|value]];
  // We don't support sequences in unions yet ([https://bugzilla.mozilla.org/show_bug.cgi?id=767924 Bug 767924]).
  // readonly attribute ([[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#BluetoothAdapter|BluetoothAdapter]] or [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#BluetoothAdapterState|BluetoothAdapterState]] or
                          [[B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice#Interface|BluetoothClassOfDevice]] or boolean or
                          DOMString or sequence<DOMString>) value;
  };
  };


== Properties ==
== Properties ==
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent#attr|BluetoothAttributeEvent.attr]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent#attrs|BluetoothAttributeEvent.attrs]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent#value|BluetoothAttributeEvent.value]]


=== attr ===
=== attrs ===
; Description
; Description
: The changed attribute's enumeration value. The enumeration is either [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#BluetoothManagerAttribute|BluetoothManagerAttribute]], [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#BluetoothAdapterAttribute|BluetoothAdapterAttribute]], or [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#BluetoothDeviceAttribute|BluetoothDeviceAttribute]].
: The array of changed attribute's enumeration value. The enumeration values are either [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#BluetoothManagerAttribute|BluetoothManagerAttribute]], [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#BluetoothAdapterAttribute|BluetoothAdapterAttribute]], or [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#BluetoothDeviceAttribute|BluetoothDeviceAttribute]].


; Value type
; Value type
: unsigned short
: sequence<DOMString>
 
=== value ===
; Description
: The updated value of the changed attribute. Its type depends on [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAttributeEvent#attribute|attr]]'s type.
 
; Value type
: any

Latest revision as of 06:34, 24 April 2015

Overview

BluetoothAttributeEvent is carried as the parameter of attribute chagned event handlers, including manager.onattributechanged, adapter.onattributechanged, and device.onattributechanged. Applications can get information about the changed attributes to query the updated values.

Interface

[CheckPermissions="bluetooth"]
interface BluetoothAttributeEvent : Event
{
  [Cached, Constant] readonly attribute sequence<DOMString> attrs;
};

Properties

attrs

Description
The array of changed attribute's enumeration value. The enumeration values are either BluetoothManagerAttribute, BluetoothAdapterAttribute, or BluetoothDeviceAttribute.
Value type
sequence<DOMString>