pyserial API reference
87 public APIs from pyserial (pyserial/pyserial) — 20 classes, 3 functions, 64 methods. Signatures extracted by static analysis of the actual source.
Repository: pyserial/pyserial
| Kind | Count |
|---|---|
| Classes | 20 |
| Functions | 3 |
| Methods | 64 |
API list
class
serial.rfc2217.PortManagerThis class manages the state of Telnet and RFC 2217.
method
serial.rfc2217.PortManager.filter(data)Handle a bunch of incoming bytes.
method
serial.rfc2217.PortManager.telnet_send_option(action, option)Send DO, DONT, WILL, WONT.
class
serial.rfc2217.SerialSerial port implementation for RFC 2217 remote serial ports.
method
serial.rfc2217.Serial.cd()Read terminal status line: Carrier Detect.
method
serial.rfc2217.Serial.close()Close port
method
serial.rfc2217.Serial.cts()Read terminal status line: Clear To Send.
method
serial.rfc2217.Serial.dsr()Read terminal status line: Data Set Ready.
method
serial.rfc2217.Serial.get_modem_state()get last modem state (cached value.
method
serial.rfc2217.Serial.open()Open port with current settings.
method
serial.rfc2217.Serial.read(size=1)Read size bytes from the serial port.
method
serial.rfc2217.Serial.rfc2217_send_purge(value)Send purge request to the remote.
method
serial.rfc2217.Serial.rfc2217_send_subnegotiation(option, value=b'')Subnegotiation of RFC2217 parameters.
method
serial.rfc2217.Serial.ri()Read terminal status line: Ring Indicator.
method
serial.rfc2217.Serial.telnet_send_option(action, option)Send DO, DONT, WILL, WONT.
method
serial.rfc2217.Serial.timeout()Get the current timeout setting.
class
serial.rfc2217.TelnetOptionManage a single telnet option, keeps track of DO/DONT WILL/WONT.
class
serial.rfc2217.TelnetSubnegotiationA object to handle subnegotiation of options.
method
serial.rfc2217.TelnetSubnegotiation.set(value)Request a change of the value.
class
serial.serialposix.PosixPollSerialPoll based read implementation.
class
serial.serialposix.SerialSerial port class POSIX implementation.
method
serial.serialposix.Serial.cd()Read terminal status line: Carrier Detect
method
serial.serialposix.Serial.close()Close port
method
serial.serialposix.Serial.cts()Read terminal status line: Clear To Send
method
serial.serialposix.Serial.dsr()Read terminal status line: Data Set Ready
method
serial.serialposix.Serial.flush()Flush of file like objects.
method
serial.serialposix.Serial.nonblocking()DEPRECATED - has no use
method
serial.serialposix.Serial.open()Open port with current settings.
method
serial.serialposix.Serial.read(size=1)Read size bytes from the serial port.
method
serial.serialposix.Serial.ri()Read terminal status line: Ring Indicator
method
serial.serialposix.Serial.send_break(duration=0.25)Send break condition.
class
serial.serialutil.PortNotOpenErrorPort is not open
class
serial.serialutil.SerialBaseSerial port base class.
method
serial.serialutil.SerialBase.baudrate()Get the current baud rate setting.
method
serial.serialutil.SerialBase.bytesize()Get the current byte size setting.
method
serial.serialutil.SerialBase.parity()Get the current parity setting.
method
serial.serialutil.SerialBase.port()Get the current port setting.
method
serial.serialutil.SerialBase.send_break(duration=0.25)Send break condition.
method
serial.serialutil.SerialBase.stopbits()Get the current stop bits setting.
method
serial.serialutil.SerialBase.timeout()Get the current timeout setting.
method
serial.serialutil.SerialBase.write_timeout()Get the current timeout setting.
method
serial.serialutil.SerialBase.xonxoff()Get the current XON/XOFF setting.
class
serial.serialutil.SerialExceptionBase class for serial port related exceptions.
class
serial.serialutil.SerialTimeoutExceptionWrite timeouts give an exception
class
serial.serialutil.TimeoutAbstraction for timeout operations.
method
serial.serialutil.Timeout.expired() -> boolReturn a boolean, telling if the timeout has expired.
method
serial.serialutil.Timeout.restart(duration:int | float) -> NoneRestart a timeout.
method
serial.serialutil.Timeout.time_left() -> float | NoneCalculate how many seconds are left until the timeout expires.
func
serial.serialutil.to_bytes(seq)convert a sequence to a bytes type
class
serial.serialwin32.SerialSerial port implementation for Win32 based on ctypes.
method
serial.serialwin32.Serial.cd()Read terminal status line: Carrier Detect
method
serial.serialwin32.Serial.close()Close port
method
serial.serialwin32.Serial.cts()Read terminal status line: Clear To Send
method
serial.serialwin32.Serial.dsr()Read terminal status line: Data Set Ready
method
serial.serialwin32.Serial.exclusive(exclusive)Change the exclusive access setting.
method
serial.serialwin32.Serial.flush()Flush of file like objects.
method
serial.serialwin32.Serial.open()Open port with current settings.
method
serial.serialwin32.Serial.read(size=1)Read size bytes from the serial port.
method
serial.serialwin32.Serial.ri()Read terminal status line: Ring Indicator
class
serial.threaded.FramedPacketRead binary packets.
method
serial.threaded.FramedPacket.connection_lost(exc)Forget transport
method
serial.threaded.FramedPacket.connection_made(transport)Store transport
class
serial.threaded.LineReaderRead and write (Unicode) lines from/to serial port.
method
serial.threaded.LineReader.flush()Flush the underlying transport
method
serial.threaded.LineReader.write_line(text)Write text to the transport.
class
serial.threaded.PacketizerRead binary packets from serial port.
method
serial.threaded.Packetizer.connection_lost(exc)Forget transport
method
serial.threaded.Packetizer.connection_made(transport)Store transport
class
serial.threaded.ProtocolProtocol as used by the ReaderThread.
method
serial.urlhandler.protocol_loop.Serial.open()Open port with current settings.
class
serial.urlhandler.protocol_socket.SerialSerial port implementation for plain sockets.
method
serial.urlhandler.protocol_socket.Serial.close()Close port
method
serial.urlhandler.protocol_socket.Serial.open()Open port with current settings.
method
serial.urlhandler.protocol_socket.Serial.send_break(duration=0.25)Send break condition.
class
serial.urlhandler.protocol_spy.FormatLogWrite data to logging module.
method
serial.urlhandler.protocol_spy.FormatLog.control(name, value)show control calls
method
serial.urlhandler.protocol_spy.FormatLog.rx(data)show received data
method
serial.urlhandler.protocol_spy.FormatLog.tx(data)show transmitted data
class
serial.urlhandler.protocol_spy.FormatLogHexWrite data to logging module.
method
serial.urlhandler.protocol_spy.FormatLogHex.rx(data)show received data
method
serial.urlhandler.protocol_spy.FormatLogHex.tx(data)show transmitted data
class
serial.urlhandler.protocol_spy.FormatRawForward only RX and TX data to output.
method
serial.urlhandler.protocol_spy.FormatRaw.control(name, value)(do not) show control calls
method
serial.urlhandler.protocol_spy.FormatRaw.rx(data)show received data
method
serial.urlhandler.protocol_spy.FormatRaw.tx(data)show transmitted data
func
serial.urlhandler.protocol_spy.hexdump(data)yield lines with hexdump of data
func
serial.win32.is_64bit()Returns true when running on a 64 bit system
About this data
These signatures were extracted from the public source of pyserial/pyserial
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.