aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/bluetooth.rs13
-rw-r--r--components/script/dom/bluetoothdevice.rs58
-rw-r--r--components/script/dom/webidls/BluetoothDevice.webidl12
3 files changed, 5 insertions, 78 deletions
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs
index 1e1ae3b147d..94e4ac5b146 100644
--- a/components/script/dom/bluetooth.rs
+++ b/components/script/dom/bluetooth.rs
@@ -6,7 +6,6 @@ use core::clone::Clone;
use dom::bindings::codegen::Bindings::BluetoothBinding;
use dom::bindings::codegen::Bindings::BluetoothBinding::RequestDeviceOptions;
use dom::bindings::codegen::Bindings::BluetoothBinding::{BluetoothScanFilter, BluetoothMethods};
-use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::VendorIDSource;
use dom::bindings::error::Error::Type;
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
@@ -142,20 +141,10 @@ impl BluetoothMethods for Bluetooth {
device.appearance,
device.tx_power,
device.rssi);
- let vendor_id_source = device.vendor_id_source.map(|vid| match vid.as_str() {
- "bluetooth" => VendorIDSource::Bluetooth,
- "usb" => VendorIDSource::Usb,
- _ => VendorIDSource::Unknown,
- });
Ok(BluetoothDevice::new(self.global().r(),
DOMString::from(device.id),
device.name.map(DOMString::from),
- &ad_data,
- device.device_class,
- vendor_id_source,
- device.vendor_id,
- device.product_id,
- device.product_version))
+ &ad_data))
},
Err(error) => {
Err(Type(error))
diff --git a/components/script/dom/bluetoothdevice.rs b/components/script/dom/bluetoothdevice.rs
index 8330ca4604a..9d26905261e 100644
--- a/components/script/dom/bluetoothdevice.rs
+++ b/components/script/dom/bluetoothdevice.rs
@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::BluetoothDeviceBinding;
-use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::{BluetoothDeviceMethods, VendorIDSource};
+use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root, MutHeap, MutNullableHeap};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
@@ -18,34 +18,19 @@ pub struct BluetoothDevice {
id: DOMString,
name: Option<DOMString>,
adData: MutHeap<JS<BluetoothAdvertisingData>>,
- deviceClass: Option<u32>,
- vendorIDSource: Option<VendorIDSource>,
- vendorID: Option<u32>,
- productID: Option<u32>,
- productVersion: Option<u32>,
gatt: MutNullableHeap<JS<BluetoothRemoteGATTServer>>,
}
impl BluetoothDevice {
pub fn new_inherited(id: DOMString,
name: Option<DOMString>,
- adData: &BluetoothAdvertisingData,
- deviceClass: Option<u32>,
- vendorIDSource: Option<VendorIDSource>,
- vendorID: Option<u32>,
- productID: Option<u32>,
- productVersion: Option<u32>)
+ adData: &BluetoothAdvertisingData)
-> BluetoothDevice {
BluetoothDevice {
reflector_: Reflector::new(),
id: id,
name: name,
adData: MutHeap::new(adData),
- deviceClass: deviceClass,
- vendorIDSource: vendorIDSource,
- vendorID: vendorID,
- productID: productID,
- productVersion: productVersion,
gatt: Default::default(),
}
}
@@ -53,21 +38,11 @@ impl BluetoothDevice {
pub fn new(global: GlobalRef,
id: DOMString,
name: Option<DOMString>,
- adData: &BluetoothAdvertisingData,
- deviceClass: Option<u32>,
- vendorIDSource: Option<VendorIDSource>,
- vendorID: Option<u32>,
- productID: Option<u32>,
- productVersion: Option<u32>)
+ adData: &BluetoothAdvertisingData)
-> Root<BluetoothDevice> {
reflect_dom_object(box BluetoothDevice::new_inherited(id,
name,
- adData,
- deviceClass,
- vendorIDSource,
- vendorID,
- productID,
- productVersion),
+ adData),
global,
BluetoothDeviceBinding::Wrap)
}
@@ -90,31 +65,6 @@ impl BluetoothDeviceMethods for BluetoothDevice {
self.adData.get()
}
- // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-deviceclass
- fn GetDeviceClass(&self) -> Option<u32> {
- self.deviceClass
- }
-
- // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-vendoridsource
- fn GetVendorIDSource(&self) -> Option<VendorIDSource> {
- self.vendorIDSource
- }
-
- // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-vendorid
- fn GetVendorID(&self) -> Option<u32> {
- self.vendorID
- }
-
- // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-productid
- fn GetProductID(&self) -> Option<u32> {
- self.productID
- }
-
- // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-productversion
- fn GetProductVersion(&self) -> Option<u32> {
- self.productVersion
- }
-
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt
fn Gatt(&self) -> Root<BluetoothRemoteGATTServer> {
self.gatt.or_init(|| BluetoothRemoteGATTServer::new(self.global().r(), self))
diff --git a/components/script/dom/webidls/BluetoothDevice.webidl b/components/script/dom/webidls/BluetoothDevice.webidl
index e8851e6240c..65bfb9c1a4e 100644
--- a/components/script/dom/webidls/BluetoothDevice.webidl
+++ b/components/script/dom/webidls/BluetoothDevice.webidl
@@ -4,23 +4,11 @@
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothdevice
-// Allocation authorities for Vendor IDs:
-enum VendorIDSource {
- "bluetooth",
- "usb",
- "unknown"
-};
-
[Pref="dom.bluetooth.enabled"]
interface BluetoothDevice {
readonly attribute DOMString id;
readonly attribute DOMString? name;
readonly attribute BluetoothAdvertisingData adData;
- readonly attribute unsigned long? deviceClass;
- readonly attribute VendorIDSource? vendorIDSource;
- readonly attribute unsigned long? vendorID;
- readonly attribute unsigned long? productID;
- readonly attribute unsigned long? productVersion;
readonly attribute BluetoothRemoteGATTServer gatt;
// readonly attribute FrozenArray[] uuids;
};