aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rfGen.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/rfGen.py b/rfGen.py
index 0fbca7b..19ae017 100644
--- a/rfGen.py
+++ b/rfGen.py
@@ -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