Skip to content

Commit 6a8e14a

Browse files
author
Paul Sokolovsky
committed
webrepl_cli.py: Update "get file" protocol.
"Get" protocol now requires receiving a lead byte from client before transferring each new packet with file contents. This makes it naturally non-blocking (while webrepl waits to receive this byte, MicroPython can execute other tasks).
1 parent 35eec07 commit 6a8e14a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

webrepl_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def get_file(ws, local_file, remote_file):
130130
with open(local_file, "wb") as f:
131131
cnt = 0
132132
while True:
133+
ws.write(b"\0")
133134
(sz,) = struct.unpack("<H", ws.read(2))
134135
if sz == 0:
135136
break

0 commit comments

Comments
 (0)