WebPBrick
WebPBrick copied to clipboard
Disconnect before trying to connect again after a failed serial connection attempt
Describe the bug
Need to disconnect before trying to connect again after a failed serial connection attempt.
To Reproduce
Steps to reproduce the behavior:
- Switch RCX off or put out of line of sight from the IR tower.
- Press the "Serial Connect" button
- See the error message "Connected to serial device (baudrate: 2400). ❌️ No communication with RCX possible. RCX needs to be switched on and placed close to and in line of sight of the IR tower."
- Need to press "Serial Disconnect" and then "Serial Connect" again after having switched the RCX on or in line of sight.
Expected behavior
The IDE knows when a connection attempt has failed and could
- Close the serial connection.
- Re-label the connection button to "Serial Connect" without requiring the user to press the button twice.
Even better would be to leave the serial connection open (the serial device will be the same) and re-attempt the communication ping with the RCX.
Screenshots
Operating system & webbrowser:
Considered irrelevant.
RCX hardware & firmware:
Considered irrelevant.
Additional context
Only involves changing JavaScript code and no deep insights into how the serial communication between IR tower and RCX works.