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

Re: [web-bluetooth] writevalue should not update value

From: François Beaufort via GitHub <sysbot+gh@w3.org>
Date: Wed, 31 Aug 2016 11:34:48 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issue_comment.created-243737424-1472643287-sysbot+gh@w3.org>
Can you confirm I'll have to update 
https://googlechrome.github.io/samples/web-bluetooth/link-loss.html to
 something like this?

```diff

function onWriteButtonClick() {
  if (!alertLevelCharacteristic) {
    return;
  }
  log('Setting Alert Level...');
  let value = document.querySelector('#alertLevelValue').value;
  alertLevelCharacteristic.writeValue(new Uint8Array([value]))
  .then(_ => {
    log('> Alert Level changed to: ' +
-        getAlertLevel(alertLevelCharacteristic.value));
+        getAlertLevel(value));
  })
  .catch(error => {
    log('Argh! ' + error);
  });
}


-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/277#issuecomment-243737424
 using your GitHub account
Received on Wednesday, 31 August 2016 11:34:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 31 August 2016 11:34:56 UTC