aboutsummaryrefslogtreecommitdiff
path: root/rfGen.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-03 17:17:39 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-03 17:17:39 -0400
commit0ec2b4208c1da0d36c9a4b16dda7a4d06d76ffc6 (patch)
treeb003732df6e5444df3ce78a6b1ee5809269a5eec /rfGen.py
parentbb924c9086273609eaff326a062c1e8643b3d8f8 (diff)
downloadqolab-0ec2b4208c1da0d36c9a4b16dda7a4d06d76ffc6.tar.gz
qolab-0ec2b4208c1da0d36c9a4b16dda7a4d06d76ffc6.zip
make scrypt version agnostic
Diffstat (limited to 'rfGen.py')
-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