From 0ec2b4208c1da0d36c9a4b16dda7a4d06d76ffc6 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 3 Jun 2021 17:17:39 -0400 Subject: make scrypt version agnostic --- rfGen.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3