W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > May 2016

[web-bluetooth] FR: Remove startNotifications/stopNotifications methods

From: François Beaufort via GitHub <sysbot+gh@w3.org>
Date: Wed, 04 May 2016 08:25:15 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issues.opened-152955552-1462350314-sysbot+gh@w3.org>
beaufortfrancois has just created a new issue for 
https://github.com/WebBluetoothCG/web-bluetooth:

== FR: Remove startNotifications/stopNotifications methods ==
I wonder if we could get rid of 
`startNotifications`/`stopNotifications` methods and only keep the 
add/remove EventListener on `characteristicvaluechanged`.

 `startNotifications`/`stopNotifications` methods are usually combined
 with the event listeners and I think it would make developers life 
easier to only have to take care of event listeners.

```js
navigator.bluetooth.requestDevice({filters: [{ services: 
['heart_rate'] }]})
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement')
.then(characteristic => {
  characteristic.addEventListener('characteristicvaluechanged', 
onHeartRateChanged);
});

Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/236 using your 
GitHub account
Received on Wednesday, 4 May 2016 08:25:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 4 May 2016 08:25:18 UTC