173 def __rawOff(self): |
173 def __rawOff(self): |
174 """ |
174 """ |
175 Private method to switch 'raw' mode off. |
175 Private method to switch 'raw' mode off. |
176 """ |
176 """ |
177 if self.__serial: |
177 if self.__serial: |
178 self.__serial.write(b"\x02") # send CTRL-B to cancel raw mode |
178 self.__serial.write(b"\x02") # send CTRL-B to cancel raw mode |
|
179 self.__serial.readUntil(b">>> ") # read until Python prompt |
|
180 self.__serial.readAll() # read all data and discard it |
179 |
181 |
180 def execute(self, commands): |
182 def execute(self, commands): |
181 """ |
183 """ |
182 Public method to send commands to the connected device and return the |
184 Public method to send commands to the connected device and return the |
183 result. |
185 result. |