3
M]W @ s d Z ddlZddlZddlZddlmZ ejj Zedd dkrRddl m
Z
n4edd dkrrddlm
Z
ned krd
d Z
n edd d
krdd Z
nedd dksedd dkrdd Z
nedd dkrdd Z
nedd dkrdd Z
nedd dkrdd Z
nledd dkr6dd Z
nPedd dkrRdd Z
n4ddlZej
jdjejejej ed jejed!krx,ee
D ]\ZZZed"jeee qW dS )#a The ``comports`` function is expected to return an iterable that yields tuples
of 3 strings: port name, human readable description and a hardware ID.
As currently no method is known to get the second two strings easily, they are
currently just identical to the port name.
N)list_ports_common linux)comports darwincygwinc C s t j d} dd | D S )Nz
/dev/ttyS*c S s g | ]}t j|qS )r ListPortInfo).0dr r &/usr/lib/python3.6/list_ports_posix.py
' s zcomports..)glob)devicesr r r
r % s
r Zopenbsdc C s t j d} dd | D S )Nz /dev/cua*c S s g | ]}t j|qS r )r r
)r r r r r
r , s zcomports..)r )r r r r
r * s
ZbsdZfreebsdc C s t j d} dd | D S )Nz/dev/cua*[!.init][!.lock]c S s g | ]}t j|qS r )r r
)r r r r r
r 1 s zcomports..)r )r r r r
r / s
Znetbsdc C s t j d} dd | D S )z8scan for available ports. return a list of device names.z /dev/dty*c S s g | ]}t j|qS r )r r
)r r r r r
r 7 s zcomports..)r )r r r r
r 4 s
irixc C s t j d} dd | D S )z8scan for available ports. return a list of device names.z
/dev/ttyf*c S s g | ]}t j|qS r )r r
)r r r r r
r = s zcomports..)r )r r r r
r : s
Zhpc C s t j d} dd | D S )z8scan for available ports. return a list of device names.z/dev/tty*p0c S s g | ]}t j|qS r )r r
)r r r r r
r C s zcomports..)r )r r r r
r @ s
sunosc C s t j d} dd | D S )z8scan for available ports. return a list of device names.z
/dev/tty*cc S s g | ]}t j|qS r )r r
)r r r r r
r I s zcomports..)r )r r r r
r F s
aixc C s t j d} dd | D S )z8scan for available ports. return a list of device names.z /dev/tty*c S s g | ]}t j|qS r )r r
)r r r r r
r O s zcomports..)r )r r r r
r L s
a4 don't know how to enumerate ttys on this system.
! I you know how the serial ports are named send this information to
! the author of this module:
sys.platform = {!r}
os.name = {!r}
pySerial version = {}
also add the naming scheme of the serial ports and with a bit luck you can get
this module running...
z;Sorry: no implementation for your platform ('{}') available__main__z{}: {} [{}])__doc__r sysosZserial.toolsr platformlowerZplatZserial.tools.list_ports_linuxr Zserial.tools.list_ports_osxserialstderrwriteformatnameVERSIONImportError__name__sortedZportZdescZhwidprintr r r r
s@