Re: [web-bluetooth] Missing API for GATT Write w/o Response (#238)

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