787 command, mode=self._submitMode, timeout=15000 |
787 command, mode=self._submitMode, timeout=15000 |
788 ) |
788 ) |
789 if err: |
789 if err: |
790 return False, err |
790 return False, err |
791 |
791 |
|
792 while not out.startswith(b"{"): |
|
793 # discard output until next newline |
|
794 _, out = out.split(b"\r\n", 1) |
792 result = json.loads(out.decode("utf-8").strip()) |
795 result = json.loads(out.decode("utf-8").strip()) |
793 if result["connected"]: |
796 if result["connected"]: |
794 error = "" |
797 error = "" |
795 else: |
798 else: |
796 try: |
799 try: |