Pārlūkot izejas kodu

Send ^D when a connection is made

This removes any garbage that the Sink may have in its buffer, e.g.
partially entered commands or nonsense that appeared when moving the
device to/from a VM.
Clara Hobbs 7 gadus atpakaļ
vecāks
revīzija
a6c566691a
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5
    0
      pdbuddy/__init__.py

+ 5
- 0
pdbuddy/__init__.py Parādīt failu

@@ -29,6 +29,11 @@ class Sink:
29 29
         except ValueError:
30 30
             self._port = serial.Serial(sp.device, baudrate=115200)
31 31
 
32
+        # Put communications in a known state, cancelling any partially-entered
33
+        # command that may be sitting in the buffer.
34
+        self._port.write("\x04".encode("utf-8"))
35
+        self._port.flush()
36
+
32 37
     def __enter__(self):
33 38
         return self
34 39
 

Notiek ielāde…
Atcelt
Saglabāt