Created
August 27, 2018 00:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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