summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2014-08-01 02:34:22 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2014-08-01 02:34:22 +0000
commitc607127bf6ea66bd4ea3ec2386b3e967e07035f6 (patch)
treed263d4cfc7076379ee937c954d497d217d145591
parentc5ca0035ab7ead3199d63024afa3dd8786b1cc9c (diff)
downloadpyserial-c607127bf6ea66bd4ea3ec2386b3e967e07035f6.tar.gz
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
-rw-r--r--CHANGES.txt5
-rw-r--r--serial/serialjava.py6
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()