Comments (20)
Is there any updates on this request? I am hoping this feature will be available soon as I want to scan and connect to multiple BLE devices and get notified from them.
from web-bluetooth.
I'm also looking for that feature to be able to request and connect to multiple devices in one shot. Can it?
from web-bluetooth.
Using the Permissions API would make this trivial. See https://lists.w3.org/Archives/Public/public-web-bluetooth/2015Dec/0007.html
permissions.request({ name: 'bluetooth', filters: [{ name: 'Jugglow' }], multiple: true })
.then(result => {
if (result.state != 'granted') {
return;
}
// Let's try to connect to all devices...
return Promise.all(result.devices.map(device => connectDevice));
});
function connectDevice(device) {
return device.connectGATT()
.then(...)
}
from web-bluetooth.
(gentle ping)
I've been playing with BLE juggling balls from juggglow and requesting several devices at the same time would definitely improve the overall UX.
I guess I could simply call requestDevice
again for the second, the third one and so on.
But I'm not sure we distinguish the ones that are already "paired/connected" to the website in the chooser UI.
from web-bluetooth.
As you can see below, it's impossible to detect which ball to select next. I see two improvements there we could make from a UX perspective:
- Since current connected BT device is always displayed, we should at least highlight it:
https://example.com wants to pair with: | |
---|---|
Jugglow | Connected |
Jugglow | |
Jugglow |
- If several devices have the same name, we could also add the device address next to it:
https://example.com wants to pair with: | |
---|---|
Jugglow | 12:34:56:78:90:12 |
Jugglow | 34:56:78:90:12:34 |
Jugglow | 56:78:90:12:34:56 |
from web-bluetooth.
No near term work planned to allow multiple device selection. Though some progress has been made for Scanning https://www.chromestatus.com/feature/5346724402954240 over the last year. There is also persisting bluetooth permissions work underway, which would help reduce the hassle of selecting multiple devices every time.
from web-bluetooth.
Chromium bluetooth implementation contributions continue, mostly from Google, though this specifically isn't planned 2023. We do notice comments here, thanks for sharing the use case details - that can help as an input to priorities.
from web-bluetooth.
I definitely think we should support this eventually, just like <input type="file" multiple>
.
I'm not sure exactly what shape the API should have.
- A separate
requestMultipleDevices
function that accepts multiple selections and returnsPromise<sequence<BluetoothDevice>>
? - Extend RequestDeviceOptions with
{multiple:true}
?
I lean toward the first, since the second would require any call to requestDevice()
to handle a sequence return value. On the other hand, the second is more consistent with <input type="file">
.
from web-bluetooth.
I would also tend to lean towards 1. Overloading the return type of requestDevice()
's promise will probably be annoying for devs (as they would need to type check what they got back).
from web-bluetooth.
Agree with you @jyasskin and @marcoscaceres, I prefer 1.
from web-bluetooth.
I'm not likely to get to this soon, but I'll gladly take a pull request adding the requestMultipleDevices
function.
from web-bluetooth.
Most controllers don't support making multiple concurrent connection attempts to devices, instead you have to serialize them, waiting until the connection to one device is complete before you attempt the next.
I'm not sure this is an argument for requestMultipleDevices
(handle the serialization for you) or against (request them one at a time like you're supposed to).
from web-bluetooth.
Thanks @keybuk. https://developer.chrome.com/apps/bluetoothLowEnergy#method-connect doesn't mention a need for developers to serialize their connection attempts, so I'm assuming the Chrome API handles the serialization for developers? I think I prefer that, since it's one less thing for web developers to get wrong.
from web-bluetooth.
Actually we have a pretty big bug that we don't handle that case ;-)
from web-bluetooth.
Thanks for the use case! I think this is still lower priority than getting the rest of the basic functionality working, but that helps motivate it when we get to spec'ing it. Until then, yeah, you'll need to call requestDevice()
multiple times, and unless each ball has a different name, it may be hard to figure out which ball to select next. :-/
from web-bluetooth.
For info, the Permissions API just added navigator.permissions.requestAll()
.
Instead of overloading navigator.permissions.request(), .requestAll()
is a clearer name and will not confuse the authors with two different
return types.
Source: https://codereview.chromium.org/1426563003
from web-bluetooth.
Hi, any updates? We want to read multiple wearables for sensor fusion purposes. @beaufortfrancois can you help me with any demos? Thank you.
from web-bluetooth.
Hello! Any updates? We are working on a project with BLE controlled LED strips. We would love to be able to connect to multiple LED strips at once to control them from a web app. How should I go about it?
from web-bluetooth.
I have no updates on supporting multiple device selection however Chromium has published an intent to ship for the getDevices() and watchAdvertisements() methods, which will allow your project to reconnect to previously selected devices when the user returns to your app. We hope that this will mitigate the largest pain point when it comes to selecting multiple devices (that you have to do it every single time) as we consider future improvements to the device selection UI itself.
from web-bluetooth.
Hi! I'm working on an indoor location project involving ultra wideband ("UWB") transceivers ("Ts") - like indoor GPS navigation. Although the initial triangulation of the fixed, 'satellite', Ts (and the eventual triangulation of the moving Ts) is performed by UWB, the initial configuration is performed via Bluetooth. This can involve as many as 200 fixed Ts, although usually far less, so, multiple pairing would be a massive boon: any update on the ETA?
from web-bluetooth.
Related Issues (20)
- No need for a [[BackingMap]] in Bluetooth{Manufacturer,Service}DataMap anymore
- BluetoothAdvertisingEventInit.{manufacturer,service}Data's type is unclear HOT 1
- Web Bluetooth Manufacturer Specific Data Map empty HOT 7
- requestDevice filters to exclude devices. HOT 1
- Would be nice to enable the Discussions on this repo, not everything is an issue HOT 1
- [watchAdvertisements] Support Extended Advertising HOT 8
- can't access services list on some devices HOT 2
- Kerem
- Services not found (Primary detected as Secondary?) HOT 3
- Using Bluetooth from WebExtension HOT 1
- Permissions API Extension HOT 3
- Not working with MacOS Sonoma + Intel HOT 1
- Add requestDevice User Prompt BiDi Extension Section to Bluetooth Spec
- p2p connection options HOT 3
- Filter on or prefer paired devices HOT 1
- Spec vs Chromium implementation. HOT 4
- Proposal does not reflect Chromium's dynamic device selection HOT 1
- Proposal: active scanning with scan response HOT 7
- navigator.bluetooth.requestDevice (opt) same filter but ios browser bluefy doesn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-bluetooth.