I'm not sure requestDevice should return namePrefix (or services?) - it'd be worth taking a look at what's done in the puck.js library: https://github.com/espruino/espruino.github.io/blob/master/js/puck.js#L162
namePrefix
I think even the following would work fine:
navigator.bluetooth.requestDevice({ filters:[ { namePrefix: 'Puck.js' }, ]}).then(function(device) { return device.gatt.connect(); }).then(function(server) {
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm not sure requestDevice should return
namePrefix
(or services?) - it'd be worth taking a look at what's done in the puck.js library: https://github.com/espruino/espruino.github.io/blob/master/js/puck.js#L162I think even the following would work fine: