Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteValue should return undefined #14393

Merged
merged 1 commit into from Nov 29, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

WriteValue should return undefined

  • Loading branch information
dati91 committed Nov 28, 2016
commit 50a5639a8b817a9686bd7b90f77197ca823749b9
@@ -300,9 +300,8 @@ impl AsyncBluetoothListener for BluetoothRemoteGATTCharacteristic {
promise.resolve_native(promise_cx, &value);
},
BluetoothResponse::WriteValue(result) => {
let value = ByteString::new(result);
*self.value.borrow_mut() = Some(value.clone());
promise.resolve_native(promise_cx, &value);
*self.value.borrow_mut() = Some(ByteString::new(result));
promise.resolve_native(promise_cx, &());
},
BluetoothResponse::EnableNotification(_result) => {
promise.resolve_native(promise_cx, self);
@@ -137,9 +137,8 @@ impl AsyncBluetoothListener for BluetoothRemoteGATTDescriptor {
promise.resolve_native(promise_cx, &value);
},
BluetoothResponse::WriteValue(result) => {
let value = ByteString::new(result);
*self.value.borrow_mut() = Some(value.clone());
promise.resolve_native(promise_cx, &value);
*self.value.borrow_mut() = Some(ByteString::new(result));
promise.resolve_native(promise_cx, &());
},
_ => promise.reject_error(promise_cx, Error::Type("Something went wrong...".to_owned())),
}
@@ -13,6 +13,7 @@
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(generic_access.name))
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => characteristic.writeValue(new Uint8Array(1)));
.then(characteristic => characteristic.writeValue(new Uint8Array(1)))
.then(result => assert_equals(result, undefined));
}, 'A regular write request to a writable characteristic should succeed.');
</script>
@@ -14,6 +14,7 @@
.then(gattServer => gattServer.getPrimaryService(generic_access.name))
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => characteristic.getDescriptor(number_of_digitals.name))
.then(descriptor => descriptor.writeValue(new Uint8Array(1)));
.then(descriptor => descriptor.writeValue(new Uint8Array(1)))
.then(result => assert_equals(result, undefined));
}, 'A regular write request to a writable descriptor should succeed.');
</script>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.