- From: François Beaufort via GitHub <sysbot+gh@w3.org>
- Date: Mon, 15 Apr 2019 06:57:50 +0000
- To: public-web-bluetooth-log@w3.org
We could also decide to add two new methods `writeValueWithResponse` and `writeValueWithoutResponse`.
```js
// Write value to a BLE characteristic. Client trusts UA to know which type to send.
try {
await myCharacteristic.writeValue(someData);
} catch(error) {
// Error is thrown if BLE characteristic does NOT support any write operation.
}
// [NEW] Write value with response to a BLE characteristic.
try {
await myCharacteristic.writeValueWithResponse(someData);
} catch(error) {
// Error is thrown if BLE characteristic does NOT support writeWithResponse.
}
// [NEW] Write value without response to a BLE characteristic.
try {
await myCharacteristic.writeValueWithoutResponse(someData);
} catch(error) {
// Error is thrown if BLE characteristic does NOT support writeWithoutResponse.
}
```
--
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/238#issuecomment-483130653 using your GitHub account
Received on Monday, 15 April 2019 06:57:51 UTC