And use the ">" as the end
try:
self.send_command("atz") # initialize
+ time.sleep(1)
except serial.SerialException:
self.State = 0
return None
def get_result(self):
"""Internal use only: not a public interface"""
- time.sleep(0.1)
+ time.sleep(0.01)
repeat_count = 0
if self.port is not None:
buffer = ""
repeat_count = repeat_count + 1
continue
- if c == '\r' and len(buffer) > 0:
- break
-
+ if c == '\r':
+ continue
+
+ if c == ">":
+ break;
+
if buffer != "" or c != ">": #if something is in buffer, add everything
buffer = buffer + c