HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/internet/__pycache__/serialport.cpython-310.pyc
o

�b��@s�dZgd�ZddlZddlmZmZmZmZmZmZm	Z	m
Z
mZddlm
Z
Gdd�d�Ze
��r9ddlmZdSddlmZdS)	z
Serial Port Protocol
)�serial�
PARITY_ODD�PARITY_EVEN�PARITY_NONE�STOPBITS_TWO�STOPBITS_ONE�FIVEBITS�	EIGHTBITS�	SEVENBITS�SIXBITS�
SerialPort�N)	rrrrrr	r
rr)�platformc@sreZdZdZejZdd�Zdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zddd�Zddd�ZdS)�BaseSerialPortaV
    Base class for Windows and POSIX serial ports.

    @ivar _serialFactory: a pyserial C{serial.Serial} factory, used to create
        the instance stored in C{self._serial}. Overrideable to enable easier
        testing.

    @ivar _serial: a pyserial C{serial.Serial} instance used to manage the
        options on the serial port.
    cCs,t|jd�r|j�|�dS|j�|�dS)N�setBaudrate)�hasattr�_serialr�setBaudRate)�self�baudrate�r�=/usr/lib/python3/dist-packages/twisted/internet/serialport.pyr;szBaseSerialPort.setBaudRatecC�
|j��S�N)r�	inWaiting�rrrrrA�
zBaseSerialPort.inWaitingcC�|j��dSr)r�
flushInputrrrrrD�zBaseSerialPort.flushInputcCrr)r�flushOutputrrrrrGrzBaseSerialPort.flushOutputcCrr)r�	sendBreakrrrrr JrzBaseSerialPort.sendBreakcCrr)r�getDSRrrrrr!MrzBaseSerialPort.getDSRcCrr)r�getCDrrrrr"PrzBaseSerialPort.getCDcCrr)r�getRIrrrrr#SrzBaseSerialPort.getRIcCrr)r�getCTSrrrrr$VrzBaseSerialPort.getCTS�cC�|j�|�dSr)r�setDTR�r�onrrrr'Y�zBaseSerialPort.setDTRcCr&r)r�setRTSr(rrrr+\r*zBaseSerialPort.setRTSN)r%)�__name__�
__module__�__qualname__�__doc__r�Serial�_serialFactoryrrrrr r!r"r#r$r'r+rrrrr-s
r)r)r/�__all__rrrrrrr	r
rr�twisted.python.runtimer
r�	isWindows�!twisted.internet._win32serialportr�!twisted.internet._posixserialportrrrr�<module>s,4