kopia lustrzana https://github.com/jacklinquan/usbserial4a
rodzic
7cddcc1765
commit
c0f45b73f2
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup
|
|||
|
||||
setup(
|
||||
name="usbserial4a",
|
||||
version="0.1.5",
|
||||
version="0.1.6",
|
||||
description="Python package for Kivy Android USB serial port.",
|
||||
long_description="https://github.com/jacklinquan/usbserial4a",
|
||||
long_description_content_type="text/markdown",
|
||||
|
|
|
@ -9,4 +9,4 @@ Requires: kivy, pyjnius, pyserial, usb4a
|
|||
'''
|
||||
|
||||
# Project version
|
||||
__version__ = '0.1.5'
|
||||
__version__ = '0.1.6'
|
||||
|
|
|
@ -37,7 +37,7 @@ class CdcAcmSerial(SerialBase):
|
|||
DEFAULT_READ_BUFFER_SIZE = 1024
|
||||
DEFAULT_WRITE_BUFFER_SIZE = 16 * 1024
|
||||
|
||||
USB_READ_TIMEOUT_MILLIS = 1
|
||||
USB_READ_TIMEOUT_MILLIS = 50
|
||||
USB_WRITE_TIMEOUT_MILLIS = 5000
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -176,10 +176,12 @@ class CdcAcmSerial(SerialBase):
|
|||
read = bytearray()
|
||||
timeout = Timeout(self.timeout)
|
||||
|
||||
# Keep reading until there is enough data or timeout.
|
||||
while self.in_waiting < size:
|
||||
if timeout.expired():
|
||||
break
|
||||
# If there is enough data in the buffer, do not bother to read.
|
||||
if len(self._read_buffer) < size:
|
||||
# Keep reading until there is enough data or timeout.
|
||||
while self.in_waiting < size:
|
||||
if timeout.expired():
|
||||
break
|
||||
|
||||
# Get data from read buffer.
|
||||
read = self._read_buffer[:size]
|
||||
|
|
|
@ -185,10 +185,12 @@ class FtdiSerial(SerialBase):
|
|||
read = bytearray()
|
||||
timeout = Timeout(self.timeout)
|
||||
|
||||
# Keep reading until there is enough data or timeout.
|
||||
while self.in_waiting < size:
|
||||
if timeout.expired():
|
||||
break
|
||||
# If there is enough data in the buffer, do not bother to read.
|
||||
if len(self._read_buffer) < size:
|
||||
# Keep reading until there is enough data or timeout.
|
||||
while self.in_waiting < size:
|
||||
if timeout.expired():
|
||||
break
|
||||
|
||||
# Get data from read buffer.
|
||||
read = self._read_buffer[:size]
|
||||
|
|
Ładowanie…
Reference in New Issue