HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/twisted/internet/__pycache__/_posixserialport.cpython-310.pyc
o

�b!�@sTdZddlmZddlmZmZddlmZmZddlm	Z	Gdd�de	ej
�ZdS)	z
Serial Port Protocol
�)�PARITY_NONE)�	EIGHTBITS�STOPBITS_ONE)�abstract�fdesc)�BaseSerialPortc@sLeZdZdZdZdeeedddfdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)�
SerialPortz>
    A select()able serial device, acting as a transport.
    �i�%rc
Cs^tj�||�|j|||||||	|
d�|_||_|��|��||_|j�	|�|�
�dS)N)�baudrate�bytesize�parity�stopbits�timeout�xonxoff�rtscts)r�FileDescriptor�__init__�_serialFactory�_serial�reactor�
flushInput�flushOutput�protocol�makeConnection�startReading)�selfr�deviceNameOrPortNumberrr
rrr
rrr�r�C/usr/lib/python3/dist-packages/twisted/internet/_posixserialport.pyrs"
�
zSerialPort.__init__cCs|jjS)N)r�fd�rrrr�fileno9szSerialPort.filenocCst�|��|�S)z7
        Write some data to the serial device.
        )r�	writeToFDr!)r�datarrr�
writeSomeData<szSerialPort.writeSomeDatacCst�|��|jj�S)z:
        Some data's readable from serial device.
        )r�
readFromFDr!r�dataReceivedr rrr�doReadBszSerialPort.doReadcCs(tj�||�|j��|j�|�dS)z�
        Called when the serial port disconnects.

        Will call C{connectionLost} on the protocol that is handling the
        serial data.
        N)rr�connectionLostr�closer)r�reasonrrrr(Hs
zSerialPort.connectionLostN)
�__name__�
__module__�__qualname__�__doc__�	connectedrrrrr!r$r'r(rrrrrs
�rN)r.�serialrrr�twisted.internetrr�twisted.internet.serialportrrrrrrr�<module>s