Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /proc/17567/root/usr/local/lib/python3.6/site-packages/serial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/17567/root/usr/local/lib/python3.6/site-packages/serial/__pycache__/serialcli.cpython-36.pyc
3

F�Kd�#�@sLddlmZddlZddlZddlTejejZdd�ZGdd�de	�Z
dS)�)�absolute_importN)�*cCstdd�|D��S)NcSsg|]}t|��qS�)�ord)�.0�xrr�4/tmp/pip-build-8nxjc3nm/pyserial/serial/serialcli.py�
<listcomp>sz!as_byte_array.<locals>.<listcomp>)�sab)�stringrrr�
as_byte_arraysrc@s�eZdZdZd3Zdd�Zdd�Zdd�Zedd��Z	d4dd�Z
dd�Zd d!�Zd"d#�Z
d$d%�Zd&d'�Zd(d)�Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zd2S)5�Serialz)Serial port implementation for .NET/Mono.�2�K�n�����,�X���`	��%�K������cCs�|jdkrtd��|jr td��ytjjj|j�|_Wn:t	k
rp}zd|_td|j|f��WYdd}~XnX|j
dkr�d|_
|jdkr�d|_|j�|jj
�d|_|js�|j�|js�|j�|j�dS)zx        Open port with current settings. This may throw a SerialException
        if the port cannot be opened.
        Nz.Port must be configured before it can be used.zPort is already open.zcould not open port %s: %sT)Z_port�SerialException�is_open�System�IO�Ports�
SerialPortZportstr�_port_handle�	Exception�
_rts_state�
_dtr_state�_reconfigure_portZOpenZ_dsrdtr�_update_dtr_state�_rtscts�_update_rts_state�reset_input_buffer)�self�msgrrr�opens*
$


zSerial.opencCs�|jstd��|jdkr*tjjjj|j_nt	|jd�|j_|j
dkrXtjjjj|j_nt	|j
d�|j_y|j|j_
Wn.tk
r�}ztt|���WYdd}~XnX|jtkr�d|j_nJ|jtkr�d|j_n6|jtkr�d|j_n"|jtkr�d|j_ntd|j��|jtk�r(ttjjjd	�|j_n�|jtk�rFtjjjj|j_nh|jtk�rdtjjjj|j_nJ|jtk�r�tjjjj |j_n,|jt!k�r�tjjjj"|j_ntd
|j��|j#t$k�r�tjjj%j&|j_%nJ|j#t'k�r�tjjj%j(|j_%n,|j#t)k�rtjjj%j*|j_%ntd|j#��|j+�r8|j,�r8tjjj-j.|j_-nH|j+�rRtjjj-j/|j_-n.|j,�rltjjj-j0|j_-nttjjj-d	�|j_-dS)z,Set communication parameters on opened port.z'Can only operate on a valid port handleNi�����z#Unsupported number of data bits: %r�NonezUnsupported parity mode: %rz#Unsupported number of stop bits: %r)1r%r�_timeoutr!r"r#r$ZInfiniteTimeout�ReadTimeout�intZ_write_timeoutZWriteTimeoutZ	_baudrateZBaudRate�IOError�
ValueError�strZ	_bytesizeZFIVEBITSZDataBitsZSIXBITSZ	SEVENBITSZ	EIGHTBITSZ_parityZPARITY_NONE�getattrZParityZPARITY_EVENZEvenZ
PARITY_ODDZOddZPARITY_MARKZMarkZPARITY_SPACEZSpaceZ	_stopbitsZSTOPBITS_ONEZStopBitsZOneZSTOPBITS_ONE_POINT_FIVEZOnePointFiveZSTOPBITS_TWOZTwor+Z_xonxoffZ	HandshakeZRequestToSendXOnXOffZ
RequestToSendZXOnXOff)r.�errrr)=s\









zSerial._reconfigure_portcCsF|jrB|jr<y|jj�Wntjjjk
r4YnXd|_d|_dS)z
Close portNF)r r%�Closer!r"r#ZInvalidOperationException)r.rrr�close�szSerial.closecCs|jst��|jjS)z>Return the number of characters currently in the input buffer.)r �PortNotOpenErrorr%ZBytesToRead)r.rrr�
in_waiting�szSerial.in_waiting�cCsZ|jst��t�}x>|rPy|j|jj��Wntjk
rDPYqX|d8}qWt|�S)z�        Read size bytes from the serial port. If a timeout is set it may
        return less characters as requested. With no timeout it will block
        until the requested number of bytes is read.
        rB)	r r@�	bytearray�appendr%ZReadByter!�TimeoutException�bytes)r.�size�datarrr�read�szSerial.readcCsP|jst��y|jjt|�dt|��Wntjk
rFtd��YnXt|�S)z-Output the given string over the serial port.rz
Write timeout)	r r@r%ZWriter�lenr!rEZSerialTimeoutException)r.rHrrr�write�szSerial.writecCs|jst��|jj�dS)z9Clear input buffer, discarding all that is in the buffer.N)r r@r%ZDiscardInBuffer)r.rrrr-�szSerial.reset_input_buffercCs|jst��|jj�dS)zs        Clear output buffer, aborting the current output and
        discarding all that is in the buffer.
        N)r r@r%ZDiscardOutBuffer)r.rrr�reset_output_buffer�szSerial.reset_output_buffercCs|jst��t|j�|j_dS)zT
        Set break: Controls TXD. When active, to transmitting is possible.
        N)r r@�boolZ_break_stater%Z
BreakState)r.rrr�_update_break_state�szSerial._update_break_statecCs|jst��t|j�|j_dS)z)Set terminal status line: Request To SendN)r r@rMr'r%Z	RtsEnable)r.rrrr,�szSerial._update_rts_statecCs|jst��t|j�|j_dS)z-Set terminal status line: Data Terminal ReadyN)r r@rMr(r%Z	DtrEnable)r.rrrr*�szSerial._update_dtr_statecCs|jst��|jjS)z(Read terminal status line: Clear To Send)r r@r%Z
CtsHolding)r.rrr�cts�sz
Serial.ctscCs|jst��|jjS)z)Read terminal status line: Data Set Ready)r r@r%Z
DsrHolding)r.rrr�dsr�sz
Serial.dsrcCs|jst��dS)z)Read terminal status line: Ring IndicatorF)r r@)r.rrr�ri�sz	Serial.ricCs|jst��|jjS)z)Read terminal status line: Carrier Detect)r r@r%Z	CDHolding)r.rrr�cd�sz	Serial.cdN)rrrrrrrrrrrrrrrrr)rB)�__name__�
__module__�__qualname__�__doc__Z	BAUDRATESr0r)r?�propertyrArIrKr-rLrNr,r*rOrPrQrRrrrrr
s$H
	r
)�
__future__rr!ZSystem.IO.PortsZserial.serialutil�ArrayZByter
rZ
SerialBaser
rrrr�<module>
s

haha - 2025