object
Parameters: |
|
---|---|
Returns: | Serial object. |
Return type: | |
Raises: |
|
read
(length, timeout=None)[source]¶Parameters: |
|
---|---|
Returns: | data read. |
Return type: | bytes |
Raises: | SerialError – if an I/O or OS error occurs. |
write
(data)[source]¶Parameters: | data (bytes, bytearray, list) – a byte array or list of 8-bit integers to write. |
---|---|
Returns: | number of bytes written. |
Return type: | int |
Raises: |
|
poll
(timeout=None)[source]¶Parameters: | timeout (int, float, None) – timeout duration in seconds. |
---|---|
Returns: | True if data is available for reading from the serial port, False if not. |
Return type: | bool |
flush
()[source]¶Raises: | SerialError – if an I/O or OS error occurs. |
---|
input_waiting
()[source]¶Returns: | number of bytes waiting to be read. |
---|---|
Return type: | int |
Raises: | SerialError – if an I/O or OS error occurs. |
output_waiting
()[source]¶Returns: | number of bytes waiting to be written. |
---|---|
Return type: | int |
Raises: | SerialError – if an I/O or OS error occurs. |
close
()[source]¶Raises: | SerialError – if an I/O or OS error occurs. |
---|
fd
¶Type: | int |
---|
devpath
¶Type: | str |
---|
baudrate
¶Raises: |
|
---|---|
Type: | int |
databits
¶Raises: |
|
---|---|
Type: | int |
parity
¶Raises: |
|
---|---|
Type: | str |
stopbits
¶Raises: |
|
---|---|
Type: | int |
xonxoff
¶Raises: |
|
---|---|
Type: | bool |
rtscts
¶Raises: |
|
---|---|
Type: | bool |
vmin
¶Raises: |
|
---|---|
Type: | int |
vtime
¶Raises: |
|
---|---|
Type: | float |
miniterm.exe
.rfc2217_server.exe
./tty/USB0...8
. This is done every 5 seconds usingos.path.exists
._serial_port._tcp
./dev/ttyUSB0
is reachable at <host>:7000
.poll_modem
option in the URL whenusing a pySerial client.)port_publisher.py
to /usr/local/bin
.port_publisher.sh
to /etc/init.d
.update-rc.dport_publisher.shdefaults99
invoke-rc.dport_publisher.shstart
as root.test
.loop://
unless a different devicename or URL is given on the command line (sys.argv[1]
). e.g. to run thetest on an attached USB-serial converter hwgrep://USB
could be used orthe actual name such as /dev/ttyUSB0
or COM1
(depending on platform).test*
files and run them. By default, theloop://
device is used.readline
.io
library. Only available for Python 2.6 andnewer.