File: //usr/lib/python3.6/site-packages/serial/urlhandler/__pycache__/protocol_loop.cpython-36.pyc
3
M�]W�% � @ s" d dl Z d dlZd dlZyd dlZW n ek
rB d dljZY nX yd dlZW n ek
rl d dlZY nX d dl m
Z
mZmZm
Z
mZmZ e je je je jd�ZG dd� de
�Zedk�rd dlZed�Zejjdje�� ejjd � ejd
� ej� ejjdjejd��� ej� dS )
� N)�
SerialBase�SerialException�to_bytes� iterbytes�writeTimeoutError�portNotOpenError)�debug�infoZwarning�errorc s� e Zd ZdZd6Z� fdd�Zdd� Z� fdd�Zdd� Zdd� Z e
dd� �Zd7d d!�Zd"d#� Z
d$d%� Zd&d'� Zd(d)� Zd*d+� Zd,d-� Ze
d.d/� �Ze
d0d1� �Ze
d2d3� �Ze
d4d5� �Z� ZS )8�SerialzSSerial port implementation that simulates a loop back connection in plain software.�2 �K �n � � �� �, �X � � �` � �% � K � � � � � � c s( t t| �j||� d| _d | _d | _d S )Ni )�superr �__init__�buffer_size�queue�logger)�self�args�kwargs)� __class__� �#/usr/lib/python3.6/protocol_loop.pyr - s zSerial.__init__c C s~ | j rtd��d| _tj| j�| _| jdkr4td��| j| j� | j � d| _ | j
s\| j� | jsj| j
� | j� | j� dS )zx Open port with current settings. This may throw a SerialException
if the port cannot be opened.
zPort is already open.Nz.Port must be configured before it can be used.T)�is_openr r! r �Queuer Z_port�from_urlZport�_reconfigure_portZ_dsrdtr�_update_dtr_stateZ_rtscts�_update_rts_state�reset_input_buffer�reset_output_buffer)r"