Skip to content

Commit

Permalink
feat: add advisory port locking
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdragun committed Jul 16, 2024
1 parent 19305a8 commit faa88a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion esp_rfc2217_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def main():
logging.getLogger("rfc2217").setLevel(level)

# connect to serial port
ser = serial.serial_for_url(args.SERIALPORT, do_not_open=True)
ser = serial.serial_for_url(args.SERIALPORT, do_not_open=True, exclusive=True)
ser.timeout = 3 # required so that the reader thread can exit
# reset control line as no _remote_ "terminal" has been connected yet
ser.dtr = False
Expand Down
2 changes: 1 addition & 1 deletion esptool/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD, trace_enabled=False):

if isinstance(port, str):
try:
self._port = serial.serial_for_url(port)
self._port = serial.serial_for_url(port, exclusive=True)
except serial.serialutil.SerialException as e:
port_issues = [
[ # does not exist error
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def find_version(*file_paths):
"bitstring>=3.1.6",
"cryptography>=2.1.4",
"ecdsa>=0.16.0",
"pyserial>=3.0",
"pyserial>=3.3",
"reedsolo>=1.5.3,<1.8",
"PyYAML>=5.1",
"intelhex",
Expand Down

0 comments on commit faa88a7

Please sign in to comment.