vshymanskyy / miband-js

MiBand 2 JS library for Node.JS and HTML5 (WebBluetooth)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow device selection when using in Node.js

viktornord opened this issue · comments

Currently filter should be specified to select some bluetooth peripheral device.
Is there a way to select a certain device out of discovered ones when using this lib in node.js? It is important when I don't know beforehand which device should be connected and user interaction is needed.
For example I want to connect Mi Band 2 and there are several Mi Band 2 devices nearby but I don't know exactly which one should be connected.

@viktornord You can use webbluetooth module API and implement any device selector you want: https://thegecko.github.io/webbluetooth/docs/index.html
There's even an example: https://github.com/thegecko/webbluetooth/blob/master/examples/selector.js