Extract connect_esp command for scripting purposes (ESPTOOL-1318)#1163
Open
nebkat wants to merge 2 commits into
Open
Extract connect_esp command for scripting purposes (ESPTOOL-1318)#1163nebkat wants to merge 2 commits into
connect_esp command for scripting purposes (ESPTOOL-1318)#1163nebkat wants to merge 2 commits into
Conversation
f01a554 to
b6d0fdc
Compare
connect_esp command for scripting purposesconnect_esp command for scripting purposes (ESPTOOL-1318)
Move get_port_list, _get_port_list, and parse_port_filters out of cli_util.py (which is the Click-types layer) into a new port_util.py.
Creates a new exported connect_esp command that provides the same functionality as the main CLI - detecting ports, retry logic, etc.
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.
This change extracts the connection logic in the
esptool(CLI/Click) specificprepare_esp_object(ctx)function into a reusableconnect_espcommand.This greatly simplifies the creation of user facing scripts vs.
detect_chip(PORT).Before
To achieve "auto" connections:
... and no support for
open_port_attemptsand others...and missing dependencies
After
I have tested this change with the following hardware & software combinations:
ESP32-S3, custom board
Tests added for command.
I have run the esptool automated integration tests with this change and the above hardware:
pytest test_esptool.py --port /dev/cu.usbmodem101 --chip esp32s3 --baud 115200