summaryrefslogtreecommitdiff
path: root/serial
Commit message (Collapse)AuthorAgeFilesLines
* feat(miniterm): handle SIGINT on POSIXChris Liechti2021-10-021-11/+21
| | | | fixes #570
* Merge pull request #584 from luzpaz/typoszsquareplusc2021-10-025-6/+6
|\ | | | | docs: Fix misc. documentation and source comment typos
| * Fix misc. documentation and source comment typosluz paz2021-05-145-6/+6
| | | | | | Found via `codespell -q 3 -L ba,ser,wont`
* | feat(list_ports): add gadget serial ports ttyGS*Chris Liechti2021-10-021-0/+2
| |
* | Merge pull request #496 from ckielstra/masterzsquareplusc2021-10-021-3/+10
|\ \ | | | | | | fix(serialposix): Add support for setting a custom baudrate on the MIPS platform
| * | Add support for setting a custom baudrate on the MIPS platformckielstra2021-02-251-3/+10
| | | | | | | | | | | | | | | 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.
* | | Merge pull request #587 from Finwood/masterzsquareplusc2021-10-011-1/+2
|\ \ \ | | | | | | | | fix: Redirect miniterm's port prompt to stderr instead of stdout, like all other messages
| * | | Redirect Minicom's Port Prompt to stderrLasse Fröhner2021-06-101-1/+2
| | | |
* | | | Fix duplicate comports listed with list_ports(include_links=True)Madis Martin Lutter2021-09-032-24/+25
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | spy: option to write to log instead of file/stdoutChris Liechti2021-05-231-0/+47
| |/ |/|
* | miniterm: make integration easier, add serial_instance argumentChris Liechti2021-05-141-3/+3
| |
* | miniterm: fix escapes, F'keys on win32Chris Liechti2021-05-141-10/+10
| |
* | docs: remove backslash in docsChris Liechti2021-05-141-1/+1
| | | | | | | | fixes #468
* | docs: fix typosPierre Grimaud2021-04-191-1/+1
|/
* chore: release 3.5v3.5Chris Liechti2020-11-231-1/+1
|
* spy: ensure bytes in write()Chris Liechti2020-11-231-0/+2
|
* Merge pull request #540 from henzef/patch-1zsquareplusc2020-11-191-21/+43
|\ | | | | serialposix: Fix inconstent state after exception in open()
| * serialposix: Fix inconstent state after exception in open()Fabian Henze2020-11-041-21/+43
| | | | | | | | | | | | | | 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()
* | Merge pull request #546 from chairman888/545-osx-use-iousbhostdevice-insteadzsquareplusc2020-11-191-1/+5
|\ \ | | | | | | list_ports_osx: getting USB info on BigSur/AppleSilicon
| * | implement patch from oskayByron Han2020-11-171-1/+5
| |/ | | | | | | | | added call to get IOUSBHostDevice before falling back to IOUSBDevice (which has been removed on Big Sur on Apple Silicon
* | fix issue 509 - kIOMasterPortDefault no longer exported on Big Sur, but can ↵Byron Han2020-11-131-1/+2
|/ | | | hardcode 0 instead
* Fix exception for composite serial number search on WindowsJeff Rowberg2020-09-301-7/+16
|
* chore: beta release 3.5b0v3.5b0Chris Liechti2020-09-211-1/+1
|
* setup: change entry points, update classifiersChris Liechti2020-09-211-0/+3
| | | | related to #466 #360
* Merge pull request #495 from johannesacco/masterzsquareplusc2020-09-211-1/+1
|\ | | | | list_ports_linux: Correct "interface" property on Linux hosts
| * Correct "interface" property on Linux hostsJohannes Carlsson2020-03-301-1/+1
| | | | | | | | | | | | 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).
* | list_ports_linux: change debug code in mainChris Liechti2020-09-211-2/+2
| |
* | docs: update copyright, notes, changelogChris Liechti2020-09-216-6/+6
| |
* | miniterm: add CTRL+T Q as alternative to exitChris Liechti2020-09-161-2/+4
| | | | | | | | | | | | | | the default exit key is sometimes difficult to type providing a menu command to exit is easy enough #524
* | list_ports: use hardcoded path to library on osxChris Liechti2020-09-161-3/+2
| | | | | | | | | | | | | | | | | | 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
* | loop: add out_waitingChris Liechti2020-09-141-0/+11
| | | | | | | | closes #408
* | win32: extend RS485 error messagesChris Liechti2020-09-141-5/+5
| | | | | | | | fixes #481
* | miniterm: fix double use of CTRL-T + sChris Liechti2020-09-141-1/+1
| | | | | | | | | | | | use z for suspend instead fixes #497
* | Merge pull request #351 from cefn/masterzsquareplusc2020-09-141-2/+54
|\ \ | | | | | | win32: Working CMD.exe terminal using Windows 10 ANSI support
| * | Manually wrap comment. Add note of Windows 10 compatibility.Cefn Hoile2018-06-081-1/+2
| | |
| * | Remove spurious newlineCefn Hoile2018-06-081-1/+0
| | |
| * | Added extra codes from miniterm_mpy.py and finalised setconsolemode shenanigans.Cefn Hoile2018-06-081-14/+40
| | |
| * | First proven version with minimal nav keysCefn Hoile2018-06-081-1/+27
| | |
* | | Merge pull request #519 from tim-nordell-nimbelink/masterzsquareplusc2020-09-141-2/+9
|\ \ \ | | | | | | | | posix: Fix custom baud rate to not temporarily set 38400 baud rates on linux
| * | | linux: Fix custom baud rate to not temporarily set 38400 baud ratesTim Nordell2020-08-211-2/+9
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #494 from kalvdans/dont-catch-our-own-exceptionzsquareplusc2020-09-141-10/+12
|\ \ \ | | | | | | | | posix: Don't catch the SerialException we just raised
| * | | Don't catch the SerialException we just raisedChristian Häggström2020-03-301-10/+12
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()
* | | refactor: raise new instances for PortNotOpenError and SerialTimeoutExceptionChris Liechti2020-09-149-100/+102
|/ / | | | | | | | | related to #502 fixes #437
* | Merge pull request #411 from Flameeyes/masterzsquareplusc2019-08-131-0/+258
|\ \ | | | | | | Add a backend for Silicon Labs CP2110/4 HID-to-UART bridge.
| * | Add a backend for Silicon Labs CP2110/4 HID-to-UART bridge.Diego Elio Pettenò2019-02-081-0/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #371 from keelung-yang/masterzsquareplusc2019-08-131-1/+1
|\ \ \ | | | | | | | | Don't open port if self.port is not set while entering context manager
| * | | Use self._port to determine port instancezsquareplusc2019-02-111-1/+1
| | | | | | | | | | | | Co-Authored-By: keelung-yang <csoapy@gmail.com>
| * | | Don't open port if self.port is not set while entering context managerKeelung Yang2018-07-261-1/+1
| |/ /
* | | Merge pull request #367 from klanmiko/mac_break_ioctlzsquareplusc2019-08-132-10/+35
|\ \ \ | | | | | | | | Mac and bsd fix _update_break_state
| * | | move _update_break_state to platform specific baseKaelan Mikowicz2018-07-161-9/+9
| | | |