mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update the value of the Characteristic/Descriptor when calling writeValue.
This commit is contained in:
parent
0eeb56b549
commit
dd733f6994
4 changed files with 4 additions and 12 deletions
|
@ -188,10 +188,10 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
}
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.get_bluetooth_thread().send(
|
||||
BluetoothMethodMsg::WriteValue(self.get_instance_id(), value, sender)).unwrap();
|
||||
BluetoothMethodMsg::WriteValue(self.get_instance_id(), value.clone(), sender)).unwrap();
|
||||
let result = receiver.recv().unwrap();
|
||||
match result {
|
||||
Ok(_) => Ok(()),
|
||||
Ok(_) => Ok(*self.value.borrow_mut() = Some(ByteString::new(value))),
|
||||
Err(error) => {
|
||||
Err(Error::from(error))
|
||||
},
|
||||
|
|
|
@ -105,10 +105,10 @@ impl BluetoothRemoteGATTDescriptor {
|
|||
}
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.get_bluetooth_thread().send(
|
||||
BluetoothMethodMsg::WriteValue(self.get_instance_id(), value, sender)).unwrap();
|
||||
BluetoothMethodMsg::WriteValue(self.get_instance_id(), value.clone(), sender)).unwrap();
|
||||
let result = receiver.recv().unwrap();
|
||||
match result {
|
||||
Ok(_) => Ok(()),
|
||||
Ok(_) => Ok(*self.value.borrow_mut() = Some(ByteString::new(value))),
|
||||
Err(error) => {
|
||||
Err(Error::from(error))
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue