From c607127bf6ea66bd4ea3ec2386b3e967e07035f6 Mon Sep 17 00:00:00 2001 From: cliechti Date: Fri, 1 Aug 2014 02:34:22 +0000 Subject: Java: fix 2 bugs (stop bits if/else and non-integer timeouts) (Torsten Roemer) git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@500 f19166aa-fa4f-0410-85c2-fa1106f25c8a --- CHANGES.txt | 5 ++++- serial/serialjava.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d31c6d2..1443975 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -480,7 +480,10 @@ Version 2.8 2014-xx-xx --------------------------- - [FTR pyserial:37] Support fileno() function in the socket protocol - Posix: [Patch pyserial:31] Mark/space parity on Linux -- Linux: [Patch pyserial:32] Module list_ports for linux should include the product information as description. +- Linux: [Patch pyserial:32] Module list_ports for linux should include the + product information as description. +- Java: fix 2 bugs (stop bits if/else and non-integer timeouts) (Torsten + Roemer) Bugfixes: diff --git a/serial/serialjava.py b/serial/serialjava.py index 46a78f8..ac538e3 100644 --- a/serial/serialjava.py +++ b/serial/serialjava.py @@ -93,8 +93,8 @@ class JavaSerial(SerialBase): if self._stopbits == STOPBITS_ONE: jstopbits = comm.SerialPort.STOPBITS_1 - elif stopbits == STOPBITS_ONE_POINT_FIVE: - self._jstopbits = comm.SerialPort.STOPBITS_1_5 + elif self._stopbits == STOPBITS_ONE_POINT_FIVE: + jstopbits = comm.SerialPort.STOPBITS_1_5 elif self._stopbits == STOPBITS_TWO: jstopbits = comm.SerialPort.STOPBITS_2 else: @@ -125,7 +125,7 @@ class JavaSerial(SerialBase): self.sPort.setFlowControlMode(jflowin | jflowout) if self._timeout >= 0: - self.sPort.enableReceiveTimeout(self._timeout*1000) + self.sPort.enableReceiveTimeout(int(self._timeout*1000)) else: self.sPort.disableReceiveTimeout() -- cgit v1.2.1