Repository navigation
Bluetooth: log in to a REPL with a password before sending anything - #23
Merged
Merged
Conversation
A password-protected Bluetooth REPL takes the first line it's sent as the password, so the probe Workbench sent on connect counted as a wrong one and the board answered Access denied on every reconnect. Connecting now asks with an empty line, and if the board answers Password:, prompts for it and sends it first. Fixes #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connecting over Web Bluetooth to a board whose REPL has a password (
bledev.repl, like WebREPL) looped on "Access denied".The board takes the first line it receives as the password. Workbench's first write was its REPL probe (
\r), so every connection began with a wrong password. Now the transport sends an empty line first and waits up to 1.5 s for an answer. If the board answersPassword:, Workbench asks for the password (remembered for reconnects, as for WebREPL) and sends it before anything else. A board without a password, a busy one, or one still pairing goes on as before.test/suites/bluetooth_login.jsfakes the board at the GATT level: the password goes out before anything else, a wrong password is reported, a board without a password is never asked, and a silent board doesn't hold up the connection. Three of the four fail against the old transport. Tried in Chrome on Android against an ESP32-S3 board, with a password and with passkey pairing: both reach a working prompt.Fixes #22