diff options
author | Chris Liechti <cliechti@gmx.net> | 2017-03-18 23:51:42 +0100 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2017-03-18 23:51:42 +0100 |
commit | cc4f5b446bacff8f413729081412ce99a9677154 (patch) | |
tree | 5b8c2e84ad2c0c49121add13ef4c61b685cb8c51 /documentation | |
parent | 1ef8648ff3c4b4aeaeb3962ea8d1076a1e90ae74 (diff) | |
download | pyserial-git-cc4f5b446bacff8f413729081412ce99a9677154.tar.gz |
docs: mention include_links parameter for serial.tools.list_ports.comports
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/tools.rst | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/documentation/tools.rst b/documentation/tools.rst index 437a884..0613075 100644 --- a/documentation/tools.rst +++ b/documentation/tools.rst @@ -12,8 +12,10 @@ This module can be executed to get a list of ports (``python -m serial.tools.list_ports``). It also contains the following functions. -.. function:: comports() +.. function:: comports(include_links=False) + :param bool include_links: include symlinks under ``/dev`` when they point + to a serial port :return: a list containing :class:`ListPortInfo` objects. The function returns a list of :obj:`ListPortInfo` objects. @@ -26,15 +28,26 @@ serial.tools.list_ports``). It also contains the following functions. systems description and hardware ID will not be available (``None``). + Under Linux, OSX and Windows, extended information will be available for + USB devices (e.g. `VID:PID`, `SER` (serial number), `LOCATION` (hierarchy). + + If ``include_links`` is true, all devices under ``/dev`` are inspected and + tested if they are a link to a known serial port device. These entries + will include ``LINK`` in their description (hwid). This implies that the + same device is listed twice, once under its original name and once under + the linked name. + :platform: Posix (/dev files) :platform: Linux (/dev files, sysfs) :platform: OSX (iokit) :platform: Windows (setupapi, registry) -.. function:: grep(regexp) +.. function:: grep(regexp, include_links=False) :param regexp: regular expression (see stdlib :mod:`re`) + :param bool include_links: include symlinks under ``/dev`` when they point + to a serial port :return: an iterable that yields :class:`ListPortInfo` objects, see also :func:`comports`. |