mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Replace AdvertisingData with AdvertisingEvent
This commit is contained in:
parent
a2391162a1
commit
748b78a6bf
12 changed files with 237 additions and 99 deletions
|
@ -2,21 +2,32 @@
|
|||
* 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/#bluetoothadvertisingdata
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#advertising-events
|
||||
|
||||
/*interface BluetoothManufacturerDataMap {
|
||||
readonly maplike<unsigned short, DataView>;
|
||||
};
|
||||
|
||||
interface BluetoothServiceDataMap {
|
||||
readonly maplike<UUID, DataView>;
|
||||
};*/
|
||||
|
||||
[Pref="dom.bluetooth.enabled"]
|
||||
interface BluetoothAdvertisingData {
|
||||
[Pref="dom.bluetooth.enabled", Constructor(DOMString type, BluetoothAdvertisingEventInit init)]
|
||||
interface BluetoothAdvertisingEvent : Event {
|
||||
readonly attribute BluetoothDevice device;
|
||||
// readonly attribute FrozenArray<UUID> uuids;
|
||||
readonly attribute DOMString? name;
|
||||
readonly attribute unsigned short? appearance;
|
||||
readonly attribute byte? txPower;
|
||||
readonly attribute byte? rssi;
|
||||
// readonly attribute BluetoothManufacturerDataMap manufacturerData;
|
||||
// readonly attribute BluetoothServiceDataMap serviceData;
|
||||
};
|
||||
dictionary BluetoothAdvertisingEventInit : EventInit {
|
||||
required BluetoothDevice device;
|
||||
// sequence<(DOMString or unsigned long)> uuids;
|
||||
DOMString name;
|
||||
unsigned short appearance;
|
||||
byte txPower;
|
||||
byte rssi;
|
||||
// Map manufacturerData;
|
||||
// Map serviceData;
|
||||
};
|
|
@ -8,13 +8,11 @@
|
|||
interface BluetoothDevice : EventTarget {
|
||||
readonly attribute DOMString id;
|
||||
readonly attribute DOMString? name;
|
||||
// TODO: remove this after BluetoothAdvertisingEvent implemented.
|
||||
readonly attribute BluetoothAdvertisingData adData;
|
||||
readonly attribute BluetoothRemoteGATTServer gatt;
|
||||
|
||||
// Promise<void> watchAdvertisements();
|
||||
// void unwatchAdvertisements();
|
||||
// readonly attribute boolean watchingAdvertisements;
|
||||
Promise<void> watchAdvertisements();
|
||||
void unwatchAdvertisements();
|
||||
readonly attribute boolean watchingAdvertisements;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue