Confirmed users
891
edits
Line 191: | Line 191: | ||
==== BluetoothDevice.webidl ==== | ==== BluetoothDevice.webidl ==== | ||
[CheckPermissions="bluetooth"] | |||
interface BluetoothDevice : EventTarget | interface BluetoothDevice : EventTarget | ||
{ | { | ||
readonly attribute DOMString | readonly attribute DOMString address; | ||
readonly attribute | readonly attribute BluetoothClassOfDevice cod; | ||
readonly attribute DOMString | readonly attribute DOMString name; | ||
readonly attribute boolean paired; | |||
readonly attribute boolean | |||
[Cached, Pure] | |||
readonly attribute sequence<DOMString> uuids; | |||
readonly attribute | |||
// | attribute EventHandler onattributechanged; | ||
[Throws] | |||
/** | |||
* 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" | |||
}; | }; | ||