- From: ketile via GitHub <sysbot+gh@w3.org>
- Date: Fri, 11 Dec 2015 08:43:55 +0000
- To: public-web-bluetooth-log@w3.org
Thank you for your replies.
@g-ortuno
I've been using the Polymer platinum-bluetooth element. The code was
from a codelab that seems to have been removed from code-labs.io. The
only Web Bluetooth related codelab that is left is the PLAYBULB.
The function for the connect button:
```javascript
button.addEventListener('click', function() {
console.log('Requesting a bluetooth device advertising custom
128-bit UUID service...');
BLEDevice.request().then(function(device) {
console.log('A bluetooth device has been found!');
console.log('Device Name: ' + device.name);
// Necessary to avoid delay on first button press (Chromebook
only)
var characteristicData =
BLEDevice.querySelector('platinum-bluetooth-characteristic');
return characteristicData.read().then(function(value) {
var data = new DataView(value);
console.log('Custom characteristic value is ' +
data.getUint8(0) );
});
})
.catch(function(error) {
console.error('Argh! ', error);
});
});
```
@jyasskin
I will hold back on reporting this in case it is my code that is
causing the issue.
--
GitHub Notification of comment by ketile
Please view or discuss this issue at
https://github.com/WebBluetoothCG/web-bluetooth/issues/192#issuecomment-163876269
using your GitHub account
Received on Friday, 11 December 2015 08:43:58 UTC