Bluetooth Permission API integration

This commit is contained in:
Zakor Gyula 2017-01-30 11:30:06 +01:00 committed by Attila Dusnoki
parent f3ddee5dbc
commit 5287cd3bea
17 changed files with 550 additions and 45 deletions

View file

@ -7,7 +7,6 @@ use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted};
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::
BluetoothCharacteristicPropertiesMethods;
use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::
BluetoothRemoteGATTCharacteristicMethods;
@ -104,7 +103,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-getdescriptor
fn GetDescriptor(&self, descriptor: BluetoothDescriptorUUID) -> Rc<Promise> {
get_gatt_children(self, true, BluetoothUUID::descriptor, Some(descriptor), self.get_instance_id(),
self.Service().Device().Gatt().Connected(), GATTType::Descriptor)
self.Service().Device().get_gatt().Connected(), GATTType::Descriptor)
}
#[allow(unrooted_must_root)]
@ -113,7 +112,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
descriptor: Option<BluetoothDescriptorUUID>)
-> Rc<Promise> {
get_gatt_children(self, false, BluetoothUUID::descriptor, descriptor, self.get_instance_id(),
self.Service().Device().Gatt().Connected(), GATTType::Descriptor)
self.Service().Device().get_gatt().Connected(), GATTType::Descriptor)
}
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-value
@ -134,7 +133,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
}
// Step 2.
if !self.Service().Device().Gatt().Connected() {
if !self.Service().Device().get_gatt().Connected() {
p.reject_error(p_cx, Network);
return p;
}
@ -174,7 +173,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
}
// Step 4.
if !self.Service().Device().Gatt().Connected() {
if !self.Service().Device().get_gatt().Connected() {
p.reject_error(p_cx, Network);
return p;
}
@ -210,7 +209,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
}
// Step 2.
if !self.Service().Device().Gatt().Connected() {
if !self.Service().Device().get_gatt().Connected() {
p.reject_error(p_cx, Network);
return p;
}