<!-- Please describe your changes on the following line: --> Add support for event listeners in webbluetooth. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 2c05bf3c427fd6f14c1eae22de0241a4c4ac7769
31 lines
1.3 KiB
Plaintext
31 lines
1.3 KiB
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattcharacteristic
|
|
|
|
[Pref="dom.bluetooth.enabled"]
|
|
interface BluetoothRemoteGATTCharacteristic : EventTarget {
|
|
readonly attribute BluetoothRemoteGATTService service;
|
|
readonly attribute DOMString uuid;
|
|
readonly attribute BluetoothCharacteristicProperties properties;
|
|
readonly attribute ByteString? value;
|
|
Promise<BluetoothRemoteGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor);
|
|
Promise<sequence<BluetoothRemoteGATTDescriptor>>
|
|
getDescriptors(optional BluetoothDescriptorUUID descriptor);
|
|
Promise<ByteString> readValue();
|
|
//Promise<DataView> readValue();
|
|
Promise<void> writeValue(sequence<octet> value);
|
|
//Promise<void> writeValue(BufferSource value);
|
|
Promise<BluetoothRemoteGATTCharacteristic> startNotifications();
|
|
Promise<BluetoothRemoteGATTCharacteristic> stopNotifications();
|
|
};
|
|
|
|
[NoInterfaceObject]
|
|
interface CharacteristicEventHandlers {
|
|
attribute EventHandler oncharacteristicvaluechanged;
|
|
};
|
|
|
|
// BluetoothRemoteGATTCharacteristic implements EventTarget;
|
|
BluetoothRemoteGATTCharacteristic implements CharacteristicEventHandlers;
|