-
Notifications
You must be signed in to change notification settings - Fork 1
Add deviceSelectionMode to MicrobitWebUSBConnectionOptions #60
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
Conversation
Deploying microbit-connection with
|
Latest commit: |
909da96
|
Status: | ✅ Deploy successful! |
Preview URL: | https://220f96b2.microbit-connection.pages.dev |
Branch Preview URL: | https://device-connect-mode.microbit-connection.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments.
What are/should be the consequences for the bluetooth connection?
to use locals and only assign to connection and device fields if connection is successful in attemptConnectAllowedDevices
Thanks for the comments.
I assume no consequence for bluetooth connection since we are only changing the WebUSB device fallback behaviour. For radio connection, if the MicrobitWebUSBConnection is configured as Not sure if I have missed something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments and a final suggestion re name, but happy to discuss. I think it's worth the effort for something others might use.
Yeah I guess I was pondering whether it should have similar logic as there's a similar notion of already having permitted access to a device. But I think fine to leave for now. |
Added a new configuration (
deviceSelectionMode
) for how a device should be selected.DeviceSelectionMode.AlwaysAsk
- Attempts to connect to known device, otherwise asks which device to connect with.DeviceSelectionMode.UseAnyAllowed
- Attempts to connect to known device, otherwise attempts to connect with any allowed devices. If that fails, asks which device to connect with.