flterm.py: use serial_for_url
authorJoe Britton <joe.britton@gmail.com>
Fri, 26 Jun 2015 09:40:18 +0000 (11:40 +0200)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Fri, 26 Jun 2015 09:40:33 +0000 (11:40 +0200)
tools/flterm.py

index 84b385ed8db46ac3706d469ec195f3c1055b7758..912509af8e6953d1c3381c0f01da3de8a7e2366f 100644 (file)
@@ -117,7 +117,14 @@ class Flterm:
 
     def open(self, port, speed):
         port = port if not port.isdigit() else int(port)
-        self.serial = serial.Serial(port, speed, timeout=0.25)
+        self.serial = serial.serial_for_url(
+            port,
+            baudrate=speed,
+            bytesize=8,
+            parity="N",
+            stopbits=1,
+            xonxoff=0,
+            timeout=0.25)
         self.serial.flushOutput()
         self.serial.flushInput()
         self.serial.close()  # in case port was not correctly closed