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

@ -103,16 +103,16 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
#[allow(unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservice
fn GetPrimaryService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
// TODO: Step 1: Implement the Permission API and the allowedServices BluetoothDevice internal slot.
// Step 1. is in get_gatt_children
// Step 2.
get_gatt_children(self, true, BluetoothUUID::service, Some(service), String::from(self.Device().Id()),
self.Device().Gatt().Connected(), GATTType::PrimaryService)
self.Device().get_gatt().Connected(), GATTType::PrimaryService)
}
#[allow(unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservices
fn GetPrimaryServices(&self, service: Option<BluetoothServiceUUID>) -> Rc<Promise> {
// TODO: Step 1: Implement the Permission API and the allowedServices BluetoothDevice internal slot.
// Step 1. is in get_gatt_children
// Step 2.
get_gatt_children(self, false, BluetoothUUID::service, service, String::from(self.Device().Id()),
self.Connected(), GATTType::PrimaryService)