Skip to content

Instantly share code, notes, and snippets.

@loginov-rocks
Created August 27, 2018 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loginov-rocks/d23a840d2c38b88ed3f55f2be62bf7ba to your computer and use it in GitHub Desktop.
Save loginov-rocks/d23a840d2c38b88ed3f55f2be62bf7ba to your computer and use it in GitHub Desktop.
How to make a web app for your own Bluetooth Low Energy device? Step 6
function requestBluetoothDevice() {
log('Requesting bluetooth device...');
return navigator.bluetooth.requestDevice({
filters: [{services: [0xFFE0]}],
}).
then(device => {
log('"' + device.name + '" bluetooth device selected');
deviceCache = device;
return deviceCache;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment