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

@MikeTheDane, @bluetooth-mdw, @Emill, @poshaughnessy, @timmyhadwen, @martijnthe What do you think of this proposal?
If that looks good to you, I'll send a PR to update the spec for @reillyeon, @jyasskin and @g-ortuno to have a look.

```js
// Write value to a BLE characteristic. Client trusts UA to know which type to send.
try {
  await myCharacteristic.writeValue(someData, { response: 'auto' });
  // Same as our current `myCharacteristic.writeValue(data);`
} catch(error) {
  // Error is thrown if BLE characteristic does NOT support any write operation.
}

// Write value with response to a BLE characteristic.
try {
  await myCharacteristic.writeValue(someData, { response: 'with' });
} catch(error) {
  // [NEW] Error is thrown if BLE characteristic does NOT support writeWithResponse.
}

// Write value without response to a BLE characteristic.
try {
  await myCharacteristic.writeValue(someData, { response: 'without' });
} catch(error) {
  // [NEW] 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-482478904 using your GitHub account

Received on Friday, 12 April 2019 08:01:28 UTC