Update the value of the Characteristic/Descriptor when calling writeValue.

This commit is contained in:
zakorgyula 2016-10-07 14:17:51 +02:00
parent 0eeb56b549
commit dd733f6994
4 changed files with 4 additions and 12 deletions

View file

@ -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))
},

View file

@ -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))
},

View file

@ -1,4 +0,0 @@
[write-updates-value.html]
type: testharness
[A regular write request to a writable characteristic should update value.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[write-updates-value.html]
type: testharness
[A regular write request to a writable descriptor should update value.]
expected: FAIL