diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-03 17:17:39 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-03 17:17:39 -0400 |
commit | 0ec2b4208c1da0d36c9a4b16dda7a4d06d76ffc6 (patch) | |
tree | b003732df6e5444df3ce78a6b1ee5809269a5eec | |
parent | bb924c9086273609eaff326a062c1e8643b3d8f8 (diff) | |
download | pyExpControl-0ec2b4208c1da0d36c9a4b16dda7a4d06d76ffc6.tar.gz pyExpControl-0ec2b4208c1da0d36c9a4b16dda7a4d06d76ffc6.zip |
make scrypt version agnostic
-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 |