| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
fixes #570
|
|\
| |
| | |
docs: Fix misc. documentation and source comment typos
|
| |
| |
| | |
Found via `codespell -q 3 -L ba,ser,wont`
|
| | |
|
|\ \
| | |
| | | |
fix(serialposix): Add support for setting a custom baudrate on the MIPS platform
|
| | |
| | |
| | |
| | |
| | | |
Fixed the issue where a custom baudrate could not be set for the MIPS platform.
The hard coded values in the IOCTL call do differ in MIPS when compared to most other platforms.
|
|\ \ \
| | | |
| | | | |
fix: Redirect miniterm's port prompt to stderr instead of stdout, like all other messages
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In case there are any symlinks which name matches any of the previously
checked globs then list_ports(include_links=True) will report them twice.
For example if there's a symlink named /dev/ttyUSB_mylink then it would
appear twice.
The problem is fixed by storing the found paths in a set instead of a list.
Documentation at https://pythonhosted.org/pyserial/tools.html#module-serial.tools.list_ports
already states that "Items are returned in no particular order" so there's
no need to do extra sorting before returning the results.
|
| |/
|/| |
|
| | |
|
| | |
|
| |
| |
| |
| | |
fixes #468
|
|/ |
|
| |
|
| |
|
|\
| |
| | |
serialposix: Fix inconstent state after exception in open()
|
| |
| |
| |
| |
| |
| |
| | |
If an exception occured during _update_dtr_state(), the Serial object
was left in an inconsistant state: is_open=True, but close() fails.
This patch fixes this by not setting is_open to True and by cleaning
up the state if an exception occurs during open()
|
|\ \
| | |
| | | |
list_ports_osx: getting USB info on BigSur/AppleSilicon
|
| |/
| |
| |
| |
| | |
added call to get IOUSBHostDevice before falling back to
IOUSBDevice (which has been removed on Big Sur on Apple Silicon
|
|/
|
|
| |
hardcode 0 instead
|
| |
|
| |
|
|
|
|
| |
related to #466 #360
|
|\
| |
| | |
list_ports_linux: Correct "interface" property on Linux hosts
|
| |
| |
| |
| |
| |
| | |
The "interface" property should be read from the "usb_interface_path"
instead of the "device_path" as the later one is a directory (e.g.
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0/ttyUSB1).
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
the default exit key is sometimes difficult to type
providing a menu command to exit is easy enough
#524
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
due to a security related change on MacOS, find_library fails. which may
eventually be fixed with a Python update
but it also does not hurt to use the full paths
now, that should work on old and new systems.
related to #509 #518
|
| |
| |
| |
| | |
closes #408
|
| |
| |
| |
| | |
fixes #481
|
| |
| |
| |
| |
| |
| | |
use z for suspend instead
fixes #497
|
|\ \
| | |
| | | |
win32: Working CMD.exe terminal using Windows 10 ANSI support
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
posix: Fix custom baud rate to not temporarily set 38400 baud rates on linux
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When using a custom baud rate on Linux these lines of code caused it
to push a 38400 baud rate setting down into the serial driver (even
if temporarily). It would correct this moments later, but we can
simply set the BOTHER value at this point. If other platforms have
a different default value for ispeed and ospeed when using a custom baud
rate, they can define BOTHER as well.
|
|\ \ \
| | | |
| | | | |
posix: Don't catch the SerialException we just raised
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In Python3 we get double tracebacks for this error:
Traceback (most recent call last):
File "/home/chn/repo/pyserial/serial/serialposix.py", line 557, in read
raise SerialException(
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test/test_exceptions.py", line 26, in <module>
test_unexpected_eof()
File "/usr/lib/python3.8/unittest/mock.py", line 1348, in patched
return func(*newargs, **newkeywargs)
File "test/test_exceptions.py", line 21, in test_unexpected_eof
s.read()
File "/home/chn/repo/pyserial/serial/serialposix.py", line 566, in read
raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
The patch moves the checking for EOF to after the IO block, resulting
in a much nicer traceback. This is the test script (Python3-specific):
from unittest import mock
import serial
import select
import os
@mock.patch('select.select')
@mock.patch('os.read')
def test_unexpected_eof(mock_read, mock_select):
s = serial.Serial()
s.is_open = True
s.fd = 99
s.pipe_abort_read_r = 98
mock_select.return_value = ([99],[],[])
mock_read.return_value = b''
try:
s.read()
except serial.SerialException as e:
if e.__context__: raise
if __name__ == '__main__':
test_unexpected_eof()
|
|/ /
| |
| |
| |
| | |
related to #502
fixes #437
|
|\ \
| | |
| | | |
Add a backend for Silicon Labs CP2110/4 HID-to-UART bridge.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These two chips implement UART access via a HID protocol, which can be
implemented purely in user space. The protocol is documented by Silicon
Labs AN434:
https://www.silabs.com/documents/public/application-notes/AN434-CP2110-4-Interface-Specification.pdf
The backend is implemented based on cython-hidapi
(https://github.com/trezor/cython-hidapi), making it OS-independent, if a
bit awkward.
|
|\ \ \
| | | |
| | | | |
Don't open port if self.port is not set while entering context manager
|
| | | |
| | | |
| | | | |
Co-Authored-By: keelung-yang <csoapy@gmail.com>
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
Mac and bsd fix _update_break_state
|
| | | | |
|