mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Check if the BluetoothDevice is connected, when calling getGATT functions.
This commit is contained in:
parent
11dbb7120f
commit
b72dcf326b
15 changed files with 28 additions and 50 deletions
|
@ -87,6 +87,9 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
if uuid_is_blacklisted(uuid.as_ref(), Blacklist::All) {
|
||||
return Err(Security)
|
||||
}
|
||||
if !self.Service().Device().Gatt().Connected() {
|
||||
return Err(Network)
|
||||
}
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.get_bluetooth_thread().send(
|
||||
BluetoothMethodMsg::GetDescriptor(self.get_instance_id(), uuid, sender)).unwrap();
|
||||
|
@ -117,6 +120,9 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
}
|
||||
}
|
||||
};
|
||||
if !self.Service().Device().Gatt().Connected() {
|
||||
return Err(Network)
|
||||
}
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.get_bluetooth_thread().send(
|
||||
BluetoothMethodMsg::GetDescriptors(self.get_instance_id(), uuid, sender)).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue