mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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();
|
let (sender, receiver) = ipc::channel().unwrap();
|
||||||
self.get_bluetooth_thread().send(
|
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();
|
let result = receiver.recv().unwrap();
|
||||||
match result {
|
match result {
|
||||||
Ok(_) => Ok(()),
|
Ok(_) => Ok(*self.value.borrow_mut() = Some(ByteString::new(value))),
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
Err(Error::from(error))
|
Err(Error::from(error))
|
||||||
},
|
},
|
||||||
|
|
|
@ -105,10 +105,10 @@ impl BluetoothRemoteGATTDescriptor {
|
||||||
}
|
}
|
||||||
let (sender, receiver) = ipc::channel().unwrap();
|
let (sender, receiver) = ipc::channel().unwrap();
|
||||||
self.get_bluetooth_thread().send(
|
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();
|
let result = receiver.recv().unwrap();
|
||||||
match result {
|
match result {
|
||||||
Ok(_) => Ok(()),
|
Ok(_) => Ok(*self.value.borrow_mut() = Some(ByteString::new(value))),
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
Err(Error::from(error))
|
Err(Error::from(error))
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[write-updates-value.html]
|
|
||||||
type: testharness
|
|
||||||
[A regular write request to a writable characteristic should update value.]
|
|
||||||
expected: FAIL
|
|
|
@ -1,4 +0,0 @@
|
||||||
[write-updates-value.html]
|
|
||||||
type: testharness
|
|
||||||
[A regular write request to a writable descriptor should update value.]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue