diff options
-rw-r--r-- | rfGen.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -26,7 +26,12 @@ class rfGenLMX2487: def sendSerialCmd(self, cmd): self.connection.write(bytes(cmd+'\r','ascii')) - resp = self.connection.read_until(terminator=b'> ') + if "3.4" == serial.__version__: + # older version style + resp = self.connection.read_until(terminator=b'> ') + else: + # new style after 20180616 + resp = self.connection.read_until(expected=b'> ') resp = resp.decode('utf-8') self.add2log(resp) return resp |