-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
startNotifications(): Allow simultaneous listeners #285
Comments
Interesting use case indeed. FYI, the spec. is here: https://webbluetoothcg.github.io/web-bluetooth/ I try to follow this (and the chrome implementation) as close as possible. In theory, you should be able to discover and connect to the individual devices simultaneously. The characteristic instance should then be unique to each device (even though it has the same ID). If you have trouble doing this with the library, see if it works in chrome. I'd be interested to know of any cases where chrome works and the library doesn't. |
Hey there, thank you for the quick reply and for linking the Web Bluetooth spec. Hugely appreciate that you keep this implementation in line with the chrome implementation of the web bluetooth spec (matter of fact, was the primary reason why I want to stick with this library... ha!) I quickly set up a test webpage and copied over my logic for connecting to the devices and establishing connections to the GATT servers and listening to notifications on their respective characteristics. For connecting to the devices, I followed this logic:
For every device connected, the deviceFound method is run (this is the equivalent of the I then establish a connection to the GATT servers like below:
I can then listen to the characteristics events:
Running this in the Chrome browser yields the exact result I was seeking with the library. Doing this same experiment with the library yields the original issue, where only a single device can be listened to. FYI I have created a public repo for my usecase utilising the library, so please feel free to observe the code there if you would like something more technical to review: https://github.com/SamuelMereau/evenjs Thank you again, appreciate your work with this. |
There's clearly a bug in the library, so thanks for uncovering it. |
Hi all,
A bit of a fascinating usecase... I am currently using this library to interface with external smart glasses which has integrated Bluetooth capability. The hardware device is set up to have two individual BLE devices (one for each side of the glasses), with a UART service bridging both of them. However, due to this, they both share the same characteristic UUID. This is a hinderance as the library only allows notifications to be listened to per characteristic, and forces only one device to be listened to at a time.
Is this an issue relating to the library, or a usecase that is not intended by the spec?
Many thanks,
The text was updated successfully, but these errors were encountered: