WebAPI/WebBluetooth: Difference between revisions

Line 191: Line 191:
==== BluetoothDevice.webidl ====
==== BluetoothDevice.webidl ====


[CheckPermissions="bluetooth"]
  interface BluetoothDevice : EventTarget
  interface BluetoothDevice : EventTarget
  {
  {
   readonly attribute DOMString     address;
   readonly attribute DOMString             address;
   readonly attribute DOMString      name;
   readonly attribute BluetoothClassOfDevice cod;
   readonly attribute DOMString     icon;
   readonly attribute DOMString             name;
  readonly attribute boolean        connected;
   readonly attribute boolean               paired;
   readonly attribute boolean       paired;
  readonly attribute unsigned long  class;
   
   
   // array of type DOMString[]
   [Cached, Pure]
  [Throws]
   readonly attribute sequence<DOMString>    uuids;
   readonly attribute any            uuids;
   
   
   // array of type DOMString[]
            attribute EventHandler          onattributechanged;
   [Throws]
   readonly attribute any            services;
   /**
    * Fetch the up-to-date UUID list of each bluetooth service that the device
    * provides and refresh the cache value of attribute uuids if it is updated.
    *
    * If the operation succeeds, the promise will be resolved with up-to-date
    * UUID list which is identical to attribute uuids.
    */
   [NewObject, Throws]
   Promise<sequence<DOMString>>              fetchUuids();
};
 
/*
  * Set of attributes that might be changed and reported by attributechanged
  * event.
  * Address is not included since it should not be changed once BluetoothDevice
  * is created.
  */
enum BluetoothDeviceAttribute
{
  "unknown",
  "cod",
  "name",
  "paired",
  "uuids"
  };
  };


Confirmed users
891

edits