+
    K-i                        ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt ^ RIt ^ RIt^ RIt^ RIHtHtHtHtHtHt R]P*                  R]P,                  R]P.                  R]P0                  /tRtR	tR
tRtRtRtRt Rt!Rt"Rt#Rt$Rt%Rt&Rt'Rt(Rt)Rt*Rt+Rt,Rt-Rt.Rt/Rt0Rt1Rt2Rt3R t4R!t5R"t6R#t7R$t8R%t9R&t:R't;R(t<R)t=R*t>R+t?R,t@R-tAR.tBR/tCR0tDR1tER2tF]/];]0]<]1]=]2]>]3]?]4]@]5]A]6]B]7]C]8]D]9]E]:]F/tGRtHRtIRtJRtKRtLRtMR tNR!tOR"tPR#tQR$tRR%tSR&tTR3tUR4tVR5tWR6tXR7tYR8tZR9t[^t\^@t]^ t^^t_^t`^ta^tb^tc^td^@te^ tf^tg^th^ti^tj^tkRtlRtmRtn]P                  ^]P                  ^]P                  ^]P                  ^]P                  ^/tt]u! R: ]tP                  4        4       4      tw]P                  ^]P                  ^]P                  ^/t{]u! R; ]{P                  4        4       4      t|^ t}^t~^tR<tR=tR>tR?t ! R@ RA]4      t ! RB RC]4      t ! RD RE]4      t ! RF RG]4      t]RH8X  d   ^ RIt]! RIRJ4      t]EP                  EP                  RKEP                  ]4      4       ]EP                  EP                  RL4       ]EP                  RM4       ]EP                  4        ]EP                  EP                  RNEP                  ]EP!                  ^4      4      4       ]EP#                  4        R# R#   ] d    ^ RI	H
t  ELi ; i  ] d	    ^ RIt ELi ; i)O    )absolute_importN)
SerialBaseSerialExceptionto_bytes	iterbytesPortNotOpenErrorTimeoutdebuginfowarningerror                                                s                ,                     	   
         e   f   g   h   i   j   k   l   m   n   o   p                     c              #   ,   "   T F
  w  rW!3x  K  	  R # 5iN .0kvs   &  0/usr/lib/python3/dist-packages/serial/rfc2217.py	<genexpr>rG      s     !P5OTQ1&5O   c              #   ,   "   T F
  w  rW!3x  K  	  R # 5ir@   rA   rB   s   &  rF   rG   rG      s     "R6QdaA66QrH   	REQUESTEDACTIVEINACTIVEREALLY_INACTIVEc                   :   a  ] tR t^t o RtRR ltR tR tRtV t	R# )TelnetOptionz@Manage a single telnet option, keeps track of DO/DONT WILL/WONT.Nc
                    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        RV n        Wn	        R# )a  Initialize option.
:param connection: connection used to transmit answers
:param name: a readable name for debug outputs
:param send_yes: what to send when option is to be enabled.
:param send_no: what to send when option is to be disabled.
:param ack_yes: what to expect when remote agrees on option.
:param ack_no: what to expect when remote disagrees on option.
:param initial_state: options initialized with REQUESTED are tried to
    be enabled on startup. use INACTIVE for all others.
FN)

connectionnameoptionsend_yessend_noack_yesack_nostateactiveactivation_callback)
selfrQ   rR   rS   rT   rU   rV   rW   initial_staterZ   s
   &&&&&&&&&&rF   __init__TelnetOption.__init__   s9     %	 "
#6     c                &    RP                  V R7      # )zString for debug outputsz{o.name}:{o.active}({o.state}))oformatr[   s   &rF   __repr__TelnetOption.__repr__  s    /666>>r_   c                @   WP                   8X  Ed7   V P                  \        J d5   \        V n        RV n        V P
                  e   V P                  4        R# R# V P                  \        J d   R# V P                  \        J de   \        V n        V P                  P                  V P                  V P                  4       RV n        V P
                  e   V P                  4        R# R# V P                  \        J d3   V P                  P                  V P                  V P                  4       R# \        RP                  V 4      4      hWP                  8X  d   V P                  \        J d   \        V n        RV n        R# V P                  \        J dE   \        V n        V P                  P                  V P                  V P                  4       RV n        R# V P                  \        J d   R# V P                  \        J d   R# \        RP                  V 4      4      hR# )zWA DO/DONT/WILL/WONT was received for this option, update state and
answer when needed.
TNzoption in illegal state {!r}F)rV   rX   rJ   rK   rY   rZ   rL   rQ   telnet_send_optionrT   rS   rM   rU   
ValueErrorrc   rW   r[   commands   &&rF   process_incomingTelnetOption.process_incoming  sz   
 ll"zzY&#
"++7,,. 8v%x'#
224==$++N"++7,,. 8.224<<M !?!F!Ft!LMM#zzY&%
#v%%
224<<M#x'. !?!F!Ft!LMM $r_   )
rW   rV   rZ   rY   rQ   rR   rS   rU   rT   rX   r@   )
__name__
__module____qualname____firstlineno____doc__r]   re   rl   __static_attributes____classdictcell____classdict__s   @rF   rO   rO      s     J70?$N $Nr_   rO   c                   `   a  ] tR tRt o RtRR ltR tR tR t]	! ]4      t
RR ltR	 tR
tV tR# )TelnetSubnegotiationi3  zA object to handle subnegotiation of options. In this case actually
sub-sub options for RFC 2217. It is used to track com port options.
Nc                f    Vf   TpWn         W n        W0n        R V n        W@n        \
        V n        R # r@   )rQ   rR   rS   value
ack_optionrL   rX   )r[   rQ   rR   rS   r{   s   &&&&&rF   r]   TelnetSubnegotiation.__init__9  s/    J$	
$
r_   c                &    RP                  V R7      # )zString for debug outputs.z{sn.name}:{sn.state})snrb   rd   s   &rF   re   TelnetSubnegotiation.__repr__C  s    %,,,55r_   c                V   Wn         \        V n        V P                  P	                  V P
                  V P                   4       V P                  P                  '       dL   V P                  P                  P                  RP                  V P                  V P                   4      4       R# R# )zRequest a change of the value. a request is sent to the server. if
the client needs to know if the change is performed he has to check the
state of this object.
zSB Requesting {} -> {!r}N)
rz   rJ   rX   rQ   rfc2217_send_subnegotiationrS   loggerr
   rc   rR   )r[   rz   s   &&rF   setTelnetSubnegotiation.setG  sr     

33DKKL??!!!OO""(()C)J)J499VZV`V`)ab "r_   c                    V P                   \        8X  d%   \        RP                  V P                  4      4      hV P                   \
        8H  # )zcCheck if answer from server has been received. when server rejects
the change, raise a ValueError.
z%remote rejected value for option {!r})rX   rM   ri   rc   rR   rK   rd   s   &rF   is_readyTelnetSubnegotiation.is_readyS  s:    
 ::(DKKDIIVWWzzV##r_   c                    \        V4      pVP                  4       '       g1   \        P                  ! R4       V P	                  4       '       g   KD  R# \        RP                  V P                  4      4      h)zWait until the subnegotiation has been acknowledged or timeout. It
can also throw a value error when the answer from the server does not
match the value sent.
皙?z%timeout while waiting for option {!r}N)r	   expiredtimesleepr   r   rc   rR   )r[   timeouttimeout_timers   && rF   waitTelnetSubnegotiation.wait^  sU      (''))JJt}}!"I"P"PQUQZQZ"[\\r_   c                P   V P                   VR\        V P                   4       8X  d   \        V n        M\        V n        V P
                  P                  '       dL   V P
                  P                  P                  RP                  V P                  WP                  4      4       R# R# )zCheck an incoming subnegotiation block. The parameter already has
cut off the header like sub option number and com port option value.
NzSB Answer {} -> {!r} -> {})
rz   lenrK   rX   rM   rQ   r   r
   rc   rR   )r[   	suboptions   &&rF   check_answer!TelnetSubnegotiation.check_answerl  sv    
 ::#3C

O44DJ )DJ??!!!OO""(()E)L)LTYYXacmcm)no "r_   )r{   rQ   rR   rS   rX   rz   r@   )   )rn   ro   rp   rq   rr   r]   re   r   r   propertyrY   r   r   rs   rt   ru   s   @rF   rx   rx   3  s=     
6
c$ hF]p pr_   rx   c                   J  a a ] tR tRt oRtR"tV 3R ltR tR tR t	R t
]R 4       tR#R	 ltR
 tR tR tR tR tR t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]P2                  R 4       tR tR tR tR tR tR tR$R lt R t!R t"R t#R  t$R!t%Vt&V ;t'# )%Serializ  z<Serial port implementation for RFC 2217 remote serial ports.c                  < R V n         R V n        ^ V n        R V n        \	        R4      V n        RV n        R V n        R V n        RV n	        RV n
        ^V n        R V n        R V n        R V n        R V n        \         \"        V `J  ! V/ VB  R # )NF)_thread_socket
_linestate_modemstater	   _modemstate_timeout_remote_suspend_flow_write_lockr   _ignore_set_control_answer_poll_modem_state_network_timeout_telnet_options_rfc2217_port_settings_rfc2217_options_read_buffersuperr   r]   )r[   argskwargs	__class__s   &*,rF   r]   Serial.__init__  s    #*2; $)!*/'!& !#&*# $ fd$d5f5r_   c                
   RV n         RV n        RV n        ^V n        V P                  f   \        R4      hV P                  '       d   \        R4      h \        P                  ! V P                  V P                  4      ^R7      V n        V P                  P                  \        P                  \        P                  ^4       \"        P"                  ! 4       T n        \&        P(                  ! 4       T n        \-        T R\.        \0        \2        \4        \6        \8        4      \-        T R\:        \0        \2        \4        \6        \<        4      .p\-        T R	\>        \4        \6        \0        \2        \<        4      \-        T R
\@        \0        \2        \4        \6        \<        4      \-        T R\@        \4        \6        \0        \2        \<        4      \-        T R\.        \4        \6        \0        \2        \8        4      \-        T R\:        \4        \6        \0        \2        \<        4      .T,           T n!        R\E        T R\F        \H        4      R\E        T R\J        \L        4      R\E        T R\N        \P        4      R\E        T R\R        \T        4      /T n+        R\E        T R\X        \Z        4      R\E        T R\\        \^        4      /T n0        T P`                  Pc                  T PV                  4       ^ T n2        RT n3        \i        R4      T n5        RT n6        RT n        \&        Pn                  ! T Pp                  R7      T n9        T Pr                  Pu                  R4       T Pr                  Pw                  RP!                  T P                  4      4       T Pr                  Py                  4         T PB                   F?  pTPz                  \<        J g   K  T P}                  TP~                  TP                  4       KA  	  \i        T P                  4      pTP                  4       '       gA   \        P                  ! R4       \        R T 4       4      \        R T 4       4      8X  g   KU  M\        RP!                  T4      4      hT P                   '       d5   T P                   P                  RP!                  T PB                  4      4       T P                  4        T P                  '       g   T P                  4        T P                  '       g   T P                  4        T P                  4        T P                  4        R#   \         d2   pRT n        \        RP!                  T P                  T4      4      hRp?ii ; i   T P                  4        h ; i)z`Open port with current settings. This may throw a SerialException
if the port cannot be opened.
NFz.Port must be configured before it can be used.zPort is already open.)r   zCould not open port {}: {}	we-BINARY
we-RFC2217ECHOwe-SGAthey-SGAthey-BINARYthey-RFC2217baudratedatasizeparitystopsizepurgecontrolT)targetz&pySerial RFC 2217 reader thread for {}r   c              3   8   "   T F  qP                   x  K  	  R # 5ir@   rY   rC   ra   s   & rF   rG   Serial.open.<locals>.<genexpr>  s     ;):Axx):   c              3   F   "   T F  qP                   \        8g  x  K  	  R # 5ir@   )rX   rL   r   s   & rF   rG   r     s     Br`q[\77hCV`qs   !z;Remote does not seem to support RFC2217 or BINARY mode {!r}zNegotiated options: {}r   )Nr   r   r   r   _portr   is_opensocketcreate_connectionfrom_urlportstrr   
setsockoptIPPROTO_TCPTCP_NODELAY	Exceptionrc   Queuer   	threadingLockr   rO   BINARYWILLWONTDODONTrL   COM_PORT_OPTIONrJ   r   SGAr   rx   SET_BAUDRATESERVER_SET_BAUDRATESET_DATASIZESERVER_SET_DATASIZE
SET_PARITYSERVER_SET_PARITYSET_STOPSIZESERVER_SET_STOPSIZEr   
PURGE_DATASERVER_PURGE_DATASET_CONTROLSERVER_SET_CONTROLr   updater   r   r	   r   r   Thread_telnet_read_loopr   	setDaemonsetNamestartrX   rh   rT   rS   r   r   r   sumr   _reconfigure_port_dsrdtr_update_dtr_state_rtscts_update_rts_statereset_input_bufferreset_output_bufferclose)r[   msgmandadory_optionsrS   r   s   &    rF   openSerial.open  s   
 */'!& !::!"RSS<<<!"9::	Z!33DMM$,,4OYZ[DLLL##F$6$68J8JAN "KKM %>>+ {FD$D(S|_dD"dT]^
 vtRtT9MxdD"dINz3D$iP}fb$dHU~D$PTV_` 
   ,T:|M`a,T:|M`a,T8zM^_,T:|M`a	'
# ,T7zM^_,T9{M_`!
 	$$T%@%@A#*2; $)! ''t/E/EFt$ELLTZZXY	..<<9,++FOOV]]K / d334Goo''

4 ;):;;sBr`qBr?rr%QXXYjkm m{{{  !9!@!@AUAU!VW ""$<<<&&(<<<&&(##%$$&Y  	ZDL!">"E"EdllTW"XYY	ZZ	JJLsK   A/T)  U( >AU( :U( ,U( ?AU( !U( 70U( )U%4,U  U%(U;c                h   V P                   f   \        R4      hV P                  e   \        R4      h^ V P                  u;8  d   R8  g'   M \        RP                  V P                  4      4      hV P                  R,          P                  \        P                  ! RV P                  4      4       V P                  R,          P                  \        P                  ! RV P                  4      4       V P                  R	,          P                  \        P                  ! R\        V P                  ,          4      4       V P                  R
,          P                  \        P                  ! R\        V P                  ,          4      4       V P                  P!                  4       pV P"                  '       d+   V P"                  P%                  RP                  V4      4       \'        V P(                  4      pVP+                  4       '       g:   \,        P.                  ! R4       \1        R V 4       4      \3        V4      8X  g   KN  M\        RP                  V4      4      hV P"                  '       d+   V P"                  P5                  RP                  V4      4       V P6                  '       d   V P8                  '       d   \        R4      hV P6                  '       d   V P;                  \<        4       R# V P8                  '       d   V P;                  \>        4       R# V P;                  \@        4       R# )z,Set communication parameters on opened port.NzCan only operate on open portsz(write_timeout is currently not supportedzinvalid baudrate: {!r}r      !Ir      !Br   r   zNegotiating settings: {}r   c              3   8   "   T F  qP                   x  K  	  R # 5ir@   r   r   s   & rF   rG   +Serial._reconfigure_port.<locals>.<genexpr>  s     +U88Ur   z7Remote does not accept parameter change (RFC2217): {!r}zNegotiated settings: {}z-xonxoff and rtscts together are not supportedl        )!r   r   _write_timeoutNotImplementedError	_baudrateri   rc   r   r   structpack	_bytesizeRFC2217_PARITY_MAP_parityRFC2217_STOPBIT_MAP	_stopbitsvaluesr   r
   r	   r   r   r   r   r   r   r   r   _xonxoffrfc2217_set_controlSET_CONTROL_USE_HW_FLOW_CONTROLSET_CONTROL_USE_SW_FLOW_CONTROLSET_CONTROL_USE_NO_FLOW_CONTROL)r[   itemsr   s   &  rF   r   Serial._reconfigure_port  s-   <<!"BCC
 *%&PQQ
 4>>+G+5<<T^^LMM##J/33FKKt~~4VW##J/33FKKt~~4VW##H-11&++eEWX\XdXdEe2fg##J/33FKKGZ[_[i[iGj4kl ++224;;;KK8??FG$//0//##JJt+U++s5z9!"["b"bch"ijj;;;KK6==eDE<<<DMMMLMM\\\$$%DE]]]$$%DE$$%DEr_   c                p   RV n         V P                  '       dE    V P                  P                  \        P                  4       V P                  P                  4        V P                  '       d9   V P                  P                  ^4       RV n        \        P                  ! R4       RV n        R#     LW; i)z
Close portFN333333?)
r   r   shutdownr   	SHUT_RDWRr   r   joinr   r   rd   s   &rF   r   Serial.close  s    <<<%%f&6&67""$ <<<LLa DLJJsOs   AB1 1B5c                   \         P                  ! V4      pVP                  R8w  d%   \        RP	                  VP                  4      4      h \         P
                  ! VP                  R4      P                  4        F  w  r4VR8X  d{   \        P                  ! 4        \        P                  ! R4      V n        V P                  P                  \        V^ ,          ,          4       V P                  P                  R4       K  VR8X  d
   RV n        K  VR8X  d
   RV n        K  VR	8X  d   \#        V^ ,          4      V n        K  \'        R
P	                  V4      4      h	  ^ VP(                  u;8:  d   R8  g   M \'        R4      h TP*                  TP(                  3#   \&         d    p\        RP	                  T4      4      hRp?ii ; i)z]extract host and port from an URL string, other settings are extracted
an stored in instance
rfc2217zqexpected a string in the form "rfc2217://<host>:<port>[?option[&option...]]": not starting with rfc2217:// ({!r})TloggingzpySerial.rfc2217zenabled loggingign_set_control
poll_modemr   zunknown option: {!r}i   zport not in range 0...65535zPexpected a string in the form "rfc2217://<host>:<port>[?option[&option...]]": {}N)urlparseurlsplitschemer   rc   parse_qsqueryr  r  basicConfig	getLoggerr   setLevelLOGGER_LEVELSr
   r   r   floatr   ri   porthostname)r[   urlpartsrS   r  es   &&    rF   r   Serial.from_url0  s   
 !!#&<<9$!66<fU\\6JL L	P"*"3"3EKK"F"L"L"NY&'')")"3"34F"GDKKK((vay)ABKK%%&78006:D3|+-1D*y(,1&),<D)$%;%B%B6%JKK #O 

*U* !>?? + 

++	  	P!EEKVAYP P	Ps   D7F G(GGc                n    V P                   '       g   \        4       hV P                  P                  4       # )z9Return the number of bytes currently in the input buffer.)r   r   r   qsizerd   s   &rF   
in_waitingSerial.in_waitingU  s+     |||"$$  &&((r_   c                   V P                   '       g   \        4       h\        4       p \        V P                  4      p\        V4      V8  d   V P                  e!   V P                  P                  4       '       g   \        R4      hV P                  P                  RVP                  4       4      pVf   \        V4      # W$,          pVP                  4       '       g   K  M \        V4      #   \        P                   d     L"i ; i)zRead 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.
z&connection failed (reader thread died)T)r   r   	bytearrayr	   _timeoutr   r   is_aliver   r   get	time_leftbytesr   r   Empty)r[   sizedatar   bufs   &&   rF   readSerial.read\  s     |||"$${	dmm,Gd)d"<<'t||/D/D/F/F)*RSS''++D'2C2C2EF; ;&??$$ # T{ {{ 		s   AC, ;AC, ?C, ,DDc                   V P                   '       g   \        4       hV P                  ;_uu_ 4         V P                  P	                  \        V4      P                  \        \        4      4        RRR4       \        T4      #   \        P                   d    p\        RP                  T4      4      hRp?ii ; i  + '       g   i     LR; i)zOutput the given byte string over the serial port. Can block if the
connection is blocked. May raise SerialException if the connection is
closed.
z$connection failed (socket error): {}N)r   r   r   r   sendallr   replaceIACIAC_DOUBLEDr   r   r   rc   r   )r[   r6  r'  s   && rF   writeSerial.writet  s     |||"$$X$$Xd^%;%;C%MN 
 4y << X%&L&S&STU&VWWX s(   B:<BB7B22B77B::C
	c                    V P                   '       g   \        4       hV P                  \        4       V P                  P                  4       '       d   V P                  P                  R4       K=  R# )z9Clear input buffer, discarding all that is in the buffer.FN)r   r   rfc2217_send_purgePURGE_RECEIVE_BUFFERr   r*  r1  rd   s   &rF   r   Serial.reset_input_buffer  sQ    |||"$$ 45%%''!!%( (r_   c                h    V P                   '       g   \        4       hV P                  \        4       R# )z[Clear output buffer, aborting the current output and
discarding all that is in the buffer.
N)r   r   rB  PURGE_TRANSMIT_BUFFERrd   s   &rF   r   Serial.reset_output_buffer  s%    
 |||"$$ 56r_   c                Z   V P                   '       g   \        4       hV P                  '       d?   V P                  P                  RP	                  V P
                  '       d   RMR4      4       V P
                  '       d   V P                  \        4       R# V P                  \        4       R# )zCSet break: Controls TXD. When active, to transmitting is
possible.
zset BREAK to {}rY   inactiveN)	r   r   r   r   rc   _break_stater  SET_CONTROL_BREAK_ONSET_CONTROL_BREAK_OFFrd   s   &rF   _update_break_stateSerial._update_break_state  su    
 |||"$$;;;KK.55$BSBSBShYcde$$%9:$$%:;r_   c                Z   V P                   '       g   \        4       hV P                  '       d?   V P                  P                  RP	                  V P
                  '       d   RMR4      4       V P
                  '       d   V P                  \        4       R# V P                  \        4       R# )z*Set terminal status line: Request To Send.zset RTS to {}rY   rI  N)	r   r   r   r   rc   
_rts_stater  SET_CONTROL_RTS_ONSET_CONTROL_RTS_OFFrd   s   &rF   r   Serial._update_rts_state  l    |||"$$;;;KK_33HU_`a???$$%78$$%89r_   c                Z   V P                   '       g   \        4       hV P                  '       d?   V P                  P                  RP	                  V P
                  '       d   RMR4      4       V P
                  '       d   V P                  \        4       R# V P                  \        4       R# )z.Set terminal status line: Data Terminal Ready.zset DTR to {}rY   rI  N)	r   r   r   r   rc   
_dtr_stater  SET_CONTROL_DTR_ONSET_CONTROL_DTR_OFFrd   s   &rF   r   Serial._update_dtr_state  rT  r_   c                    V P                   '       g   \        4       h\        V P                  4       \        ,          4      # )z)Read terminal status line: Clear To Send.)r   r   boolget_modem_stateMODEMSTATE_MASK_CTSrd   s   &rF   cts
Serial.cts  0     |||"$$D((*-@@AAr_   c                    V P                   '       g   \        4       h\        V P                  4       \        ,          4      # )z*Read terminal status line: Data Set Ready.)r   r   r[  r\  MODEMSTATE_MASK_DSRrd   s   &rF   dsr
Serial.dsr  r`  r_   c                    V P                   '       g   \        4       h\        V P                  4       \        ,          4      # )z*Read terminal status line: Ring Indicator.)r   r   r[  r\  MODEMSTATE_MASK_RIrd   s   &rF   ri	Serial.ri  0     |||"$$D((*-??@@r_   c                    V P                   '       g   \        4       h\        V P                  4       \        ,          4      # )z*Read terminal status line: Carrier Detect.)r   r   r[  r\  MODEMSTATE_MASK_CDrd   s   &rF   cd	Serial.cd  ri  r_   c                    V P                   # )z Get the current timeout setting.)r/  rd   s   &rF   r   Serial.timeout  s     }}r_   c                    Ve,    V^,            T^ 8  d   \        RP                  T4      4      hWn        R#   \          d    \        RP                  T4      4      hi ; i)zChange timeout setting.NzNot a valid timeout: {!r})	TypeErrorri   rc   r/  r[   r   s   &&rF   r   ro    sf     N! { !<!C!CG!LMM	  N !<!C!CG!LMMNs	   	8 &Ac                j   \         pRp V P                  '       Ed    V P                  P                  R4      pT'       g   T P                  P                  R4       EMa\        T4       EFN  pT\         8X  d?   T\        8X  d	   \        pK"  Te   Y%,          pK0  T P                  P                  T4       KM  T\        8X  d   T\        8X  d:   Te   T\        ,          pMT P                  P                  \        4       \         pK  T\        8X  d   \!        4       p\         pK  T\"        8X  d%   T P%                  \'        T4      4       Rp\         pK  T\(        \*        \,        \.        39   d   Tp\0        pEK  T P3                  T4       \         pEK(  T\0        8X  g   EK6  T P5                  XT4       \         pEKQ  	  EK  V P                  '       d   V P                  P                  R4       R# R#   \        P
                   d     EK  \        P                   dc   pT P                  '       d+   T P                  P                  RP                  T4      4       T P                  P                  R4        Rp?K  Rp?ii ; i  T P                  '       d   T P                  P                  R4       i i ; i)zRead loop for the socket.Ni   z!socket error in reader thread: {}zread thread terminated)M_NORMALr   r   recvr   r   r   r   r
   rc   r   putr   r=  
M_IAC_SEENSBr.  SE_telnet_process_subnegotiationr3  r   r   r   r   M_NEGOTIATE_telnet_process_command_telnet_negotiate_option)r[   moder   r6  r'  bytetelnet_commands   &      rF   r   Serial._telnet_read_loop  s   	<	<,,,<<,,T2D %%))$/%dODx'3;#-D  )4 ) 1	 $ 1 1 5 5d ;+3;  )4 )S 0	 $ 1 1 5 5c :#+D!RZ(1I#+D!RZ ??i@PQ(,I#+D!b$d%;;-1N#.D !88>#+D,55ndK'Q ,T {{{!!":; o ~~  || {{{))*M*T*TUV*WX%%))$/f {{{!!":; sS   J G0 J EJ  J 0I?J 	I?I?AI:4J :I??J 0J2c                    V P                   '       d-   V P                   P                  RP                  V4      4       R# R# z1Process commands other than DO, DONT, WILL, WONT.zignoring Telnet command: {!r}Nr   r   rc   rj   s   &&rF   r|  Serial._telnet_process_command/  0     ;;;KK ? F Fw OP r_   c                   RpV P                    F)  pVP                  V8X  g   K  VP                  V4       RpK+  	  V'       g   V\        8X  g   V\        8X  dh   T P                  V\        8X  d   \        M\        V4       V P                  '       d-   V P                  P                  RP                  V4      4       R# R# R# R# z&Process incoming DO, DONT, WILL, WONT.FTzrejected Telnet option: {!r}Nr   rS   rl   r   r   rh   r   r   r   r   rc   r[   rk   rS   knownitems   &&&  rF   r}  Serial._telnet_negotiate_option5       ((D {{f$%%g. )  $'R-''DdVT;;;KK''(F(M(Mf(UV  #0 r_   c                   VR,          \         8X  Ed   VR,          \        8X  dr   \        V4      ^8  db   \        VR,          4      V n        V P
                  '       d7   V P
                  P                  RP                  V P                  4      4       R# R# VR,          \        8X  d   \        V4      ^8  d{   \        VR,          4      V n	        V P
                  '       d5   V P
                  P                  RP                  V P                  4      4       V P                  P                  R4       R# VR,          \        8X  d
   RV n        R# VR,          \        8X  d
   RV n        R# V P                  P!                  4        F?  pVP"                  VR,          8X  g   K  VP%                  \'        VR	,          4      4        R# 	  V P
                  '       d-   V P
                  P)                  R
P                  V4      4       R# R# V P
                  '       d-   V P
                  P)                  RP                  V4      4       R# R# );Process subnegotiation, the data between IAC SB and IAC SE.r      Nr     Nr  r   NzNOTIFY_LINESTATE: {}NOTIFY_MODEMSTATE: {}r  TFr  NNzignoring COM_PORT_OPTION: {!r}zignoring subnegotiation: {!r}N)r   SERVER_NOTIFY_LINESTATEr   ordr   r   r   rc   SERVER_NOTIFY_MODEMSTATEr   r   restartFLOWCONTROL_SUSPENDr   FLOWCONTROL_RESUMEr   r  r{   r   r3  r   )r[   r   r  s   && rF   rz  %Serial._telnet_process_subnegotiationH  s   S>_,~!88S^q=P"%in"5;;;KK$$%;%B%B4??%ST 3#;;IRS@S#&y~#6 ;;;KK$$%<%C%CDDTDT%UV((0053#66,0)3#55,1) 1188:D)C.8))%	"*>?	 ; {{{++,L,S,ST],^_ # {{{##$C$J$J9$UV r_   c                    V P                   ;_uu_ 4        V P                  P                  V4       RRR4       R#   + '       g   i     R# ; i)zGinternal socket write with no data escaping. used to send telnet stuff.N)r   r   r;  )r[   r6  s   &&rF   _internal_raw_writeSerial._internal_raw_writeh  s/    LL  & s	   ;A	c                L    V P                  \        V,           V,           4       R# zSend DO, DONT, WILL, WONT.N)r  r=  r[   actionrS   s   &&&rF   rh   Serial.telnet_send_optionm  s      v!67r_   c                    VP                  \        \        4      pV P                  \        \        ,           \
        ,           V,           V,           \        ,           \        ,           4       R# )z%Subnegotiation of RFC2217 parameters.N)r<  r=  r>  r  rx  r   ry  r[   rS   rz   s   &&&rF   r   "Serial.rfc2217_send_subnegotiationq  s>    c;/  rO!;f!Du!Ls!RUW!WXr_   c                    V P                   R,          pVP                  V4       VP                  V P                  4       R# )zfSend purge request to the remote.
(PURGE_RECEIVE_BUFFER / PURGE_TRANSMIT_BUFFER / PURGE_BOTH_BUFFERS)
r   N)r   r   r   r   r[   rz   r  s   && rF   rB  Serial.rfc2217_send_purgev  s1    
 $$W-		$''(r_   c                    V P                   R,          pVP                  V4       V P                  '       d   \        P                  ! R4       R# VP                  V P                  4       R# )z)transmit change of control line to remoter   g?N)r   r   r   r   r   r   r   r  s   && rF   r  Serial.rfc2217_set_control  sH    $$Y/*** JJsOIId++,r_   c                    R# )zHcheck if server is ready to receive data. block for some time when
not.
NrA   rd   s   &rF   rfc2217_flow_server_ready Serial.rfc2217_flow_server_ready  s    r_   c                   V P                   '       d   V P                  P                  4       '       d   V P                  '       d   V P                  P	                  R4       V P                  \        4       \        V P                  4      pVP                  4       '       g:   \        P                  ! R4       V P                  P                  4       '       d   KN  M-V P                  '       d   V P                  P                  R4       V P                  e:   V P                  '       d   V P                  P	                  R4       V P                  # \        R4      h)zget last modem state (cached value. If value is "old", request a new
one. This cache helps that we don't issue to many requests when e.g. all
status lines, one after the other is queried by the user (CTS, DSR
etc.)
zpolling modem stater   zpoll for modem state failedzusing cached modem statez!remote sends no NOTIFY_MODEMSTATE)r   r   r   r   r
   r   NOTIFY_MODEMSTATEr	   r   r   r   r   r   r   rr  s   & rF   r\  Serial.get_modem_state  s     !!!d&>&>&F&F&H&H{{{!!"78,,->?d334Goo''

4  //7799;;;KK''(EF
 '{{{!!"<=### ""EFFr_   )r   r   r   r   r   r   r   r   r   r   r   r   r   r/  r   r   r   )2   K   n            i,  iX  i  i  i`	  i  i%  i K  i   i     )r  r_   )(rn   ro   rp   rq   rr   	BAUDRATESr]   r   r   r   r   r   r+  r8  r?  r   r   rM  r   r   r^  rc  rg  rl  r   setterr   r|  r}  rz  r  rh   r   rB  r  r  r\  rs   rt   __classcell__)r   rv   s   @@rF   r   r   z  s-    F4I6$_B*FX"!,J ) )0)7<	:	: B B B B A A A A   ^^	  	  @<HQW&W@'
8Y
)
-!G !Gr_   r   c                   l   a  ] tR tRt o RtRR ltR tR tRR ltRR lt	R	 t
R
 tR tR tR tRtV tR# )PortManageri  zThis class manages the state of Telnet and RFC 2217. It needs a serial
instance and a connection to work with. Connection is expected to implement
a (thread safe) write function, that writes the string to the network.
Nc                   Wn         W n        W0n        R V n        \        V n        RV n        RV n        ^V n        RV n	        ^ V n
        \        V R\        \        \        \        \         \"        4      \        V R\$        \        \        \        \         \"        4      \        V R\$        \        \         \        \        \&        4      \        V R\(        \        \        \        \         \&        4      \        V R\(        \        \         \        \        \"        4      \        V R\*        \        \        \        \         \"        V P,                  4	      \        V R\*        \        \         \        \        \&        V P,                  4	      .V n        V P                  '       d   V P                  P1                  R	4       V P.                   F?  pVP2                  \"        J g   K  V P5                  VP6                  VP8                  4       KA  	  R# )
FNr   r   r   r   r   r   r   z*requesting initial Telnet/RFC 2217 options)serialrQ   r   _client_is_rfc2217rt  r~  r   r  modemstate_masklast_modemstatelinstate_maskrO   r   r   r   r   r   rJ   r   rL   r   r   
_client_okr   r
   rX   rh   rT   rS   )r[   serial_portrQ   r   rS   s   &&&& rF   r]   PortManager.__init__  sX   !$"' 	"  ## vtT4T9MxdD"dINz3D$hO{FD$D(S}fb$dIV|_dD"dT]_c_n_no~D$PTV^`d`o`op 
 ;;;KKJK**F||y(''G +r_   c                    RV n         V P                  '       d   V P                  P                  R4       V P                  RR7       R# )zcallback of telnet option. It gets called when option is activated.
This one here is used to detect when the client agrees on RFC 2217. A
flag is set so that other functions like check_modem_lines know if the
client is OK.
Tzclient accepts RFC 2217force_notificationN)r  r   r   check_modem_linesrd   s   &rF   r  PortManager._client_ok  s;     #';;;KK67 	$7r_   c                `    V P                   P                  \        V,           V,           4       R# r  )rQ   r?  r=  r  s   &&&rF   rh   PortManager.telnet_send_option  s    cFlV34r_   c                    VP                  \        \        4      pV P                  P	                  \        \
        ,           \        ,           V,           V,           \        ,           \        ,           4       R# )z&Subnegotiation of RFC 2217 parameters.N)r<  r=  r>  rQ   r?  rx  r   ry  r  s   &&&rF   r   'PortManager.rfc2217_send_subnegotiation  sB    c;/cBh86AEICORTTUr_   c                   V P                   P                  ;'       d    \        V P                   P                  ;'       d    \        ,          V P                   P
                  ;'       d    \        ,          V P                   P                  ;'       d    \        ,          pY P                  ;'       g    ^ ,          pV\        ,          '       d   V\        ,          pV\        ,          '       d   V\        ,          pV\        ,          '       d   V\        ,          pV\        ,          '       d   V\        ,          pW P                  8w  g	   V'       d   V P                  '       d   W P                  ,          '       g	   V'       dm   V P!                  \"        \%        W P                  ,          .4      4       V P&                  '       d+   V P&                  P)                  RP+                  V4      4       V^,          V n	        R# R# )zhread control lines from serial port and compare the last value sent to remote.
send updates on changes.
r  N)r  r^  r]  rc  rb  rg  rf  rl  rk  r  MODEMSTATE_MASK_CTS_CHANGEMODEMSTATE_MASK_DSR_CHANGEMODEMSTATE_MASK_RI_CHANGEMODEMSTATE_MASK_CD_CHANGEr  r  r   r  r   r   r   rc   )r[   r  
modemstatedeltass   &&  rF   r  PortManager.check_modem_lines  sp    [[__44!4[[__44!46[[^^22 24 [[^^22 24 	 3388q9'''44J'''44J&&&33J&&&33J ---1C'''Z:N:N-N-NTf00,j+?+??@AC ;;;KK$$%<%C%CJ%OP $.#4D  2Dr_   c              #  t   "   \        V4       F$  pV\        8X  d   \        x  \        x  K   Vx  K&  	  R# 5i)zThis generator function is for the user. All outgoing data has to be
properly escaped, so that no IAC character in the data stream messes up
the Telnet state machine in the server.

socket.sendall(escape(data))
N)r   r=  r[   r6  r  s   && rF   escapePortManager.escape(  s+      dODs{		
 $s   68c              #    "   \        V4       EF  pV P                  \        8X  dH   V\        8X  d   \        V n        K1  V P
                  e   V ;P
                  V,          un        KZ  Vx  K`  V P                  \        8X  d   V\        8X  d:   V P
                  e   V ;P
                  V,          un        MVx  \        V n        K  V\        8X  d   \        4       V n        \        V n        K  V\        8X  d:   V P                  \        V P
                  4      4       RV n        \        V n        EK$  V\        \        \        \        39   d   W n        \         V n        EKS  V P#                  V4       \        V n        EKr  V P                  \         8X  g   EK  V P%                  V P                  V4       \        V n        EK  	  R# 5i)a  Handle a bunch of incoming bytes. This is a generator. It will yield
all characters not of interest for Telnet/RFC 2217.

The idea is that the reader thread pushes data from the socket through
this filter:

for byte in filter(socket.recv(1024)):
    # do things like CR/LF conversion/whatever
    # and write data to the serial port
    serial.write(byte)

(socket error handling code left as exercise for the reader)
N)r   r~  rt  r=  rw  r   rx  r.  ry  rz  r3  r   r   r   r   r  r{  r|  r}  r  s   && rF   filterPortManager.filter9  s)     dODyyH$3; *DI ~~1$."
j(3; ~~1$."
 (DIRZ%.[DN (DIRZ77dnn8MN%)DN (DIb$d33*.' +DI 006 (DIk)--d.A.A4H$	Q $s   FG.Gc                    V P                   '       d-   V P                   P                  RP                  V4      4       R# R# r  r  rj   s   &&rF   r|  #PortManager._telnet_process_commandt  r  r_   c                   RpV P                    F)  pVP                  V8X  g   K  VP                  V4       RpK+  	  V'       g   V\        8X  g   V\        8X  dh   T P                  V\        8X  d   \        M\        V4       V P                  '       d-   V P                  P                  RP                  V4      4       R# R# R# R# r  r  r  s   &&&  rF   r}  $PortManager._telnet_negotiate_optionz  r  r_   c                   VR,          \         8X  Ed   V P                  '       d+   V P                  P                  RP                  V4      4       VR,          \        8X  d   V P
                  P                  p \        P                  ! RVR,          4      w  pV^ 8w  d   W0P
                  n        V P                  '       dJ   V P                  P                  RP                  V'       d   RMRV P
                  P                  4      4       T P                  \        \        P                  ! RT P
                  P                  4      4       R
# VR,          \        8X  d   V P
                  P                   p \        P                  ! RVR,          4      w  pV^ 8w  d   WPP
                  n        V P                  '       dJ   V P                  P                  RP                  V'       d   RMRV P
                  P                   4      4       T P                  \"        \        P                  ! RT P
                  P                   4      4       R
# VR,          \$        8X  Ed   V P
                  P&                  p \        P                  ! RVR,          4      ^ ,          pV^ 8w  d   \(        V,          V P
                  n        V P                  '       dJ   V P                  P                  RP                  V'       d   RMRV P
                  P&                  4      4       T P                  \*        \        P                  ! R\,        T P
                  P&                  ,          4      4       R
# VR,          \.        8X  Ed   V P
                  P0                  p \        P                  ! RVR,          4      ^ ,          pV^ 8w  d   \2        V,          V P
                  n        V P                  '       dJ   V P                  P                  RP                  V'       d   RMRV P
                  P0                  4      4       T P                  \4        \        P                  ! R\6        T P
                  P0                  ,          4      4       R
# VR,          \8        8X  EdA   VR,          \:        8X  d   V P
                  P<                  '       d   V P                  \>        \@        4       R
# V P
                  PB                  '       d   V P                  \>        \D        4       R
# V P                  \>        \F        4       R
# VR,          \F        8X  dl   RV P
                  n        RV P
                  n!        V P                  '       d   V P                  P                  R4       V P                  \>        \F        4       R
# VR,          \@        8X  d[   RV P
                  n        V P                  '       d   V P                  P                  R4       V P                  \>        \@        4       R
# VR,          \D        8X  d[   RV P
                  n!        V P                  '       d   V P                  P                  R4       V P                  \>        \D        4       R
# VR,          \H        8X  d0   V P                  '       d   V P                  PK                  R4       R
# VR,          \L        8X  d[   RV P
                  n'        V P                  '       d   V P                  P                  R4       V P                  \>        \L        4       R
# VR,          \P        8X  d[   RV P
                  n'        V P                  '       d   V P                  P                  R4       V P                  \>        \P        4       R
# VR,          \R        8X  d0   V P                  '       d   V P                  PK                  R4       R
# VR,          \T        8X  d[   RV P
                  n+        V P                  '       d   V P                  P                  R4       V P                  \>        \T        4       R
# VR,          \X        8X  d[   RV P
                  n+        V P                  '       d   V P                  P                  R4       V P                  \>        \X        4       R
# VR,          \Z        8X  d0   V P                  '       d   V P                  PK                  R4       R
# VR,          \\        8X  d[   RV P
                  n/        V P                  '       d   V P                  P                  R4       V P                  \>        \\        4       R
# VR,          \`        8X  d[   RV P
                  n/        V P                  '       d   V P                  P                  R 4       V P                  \>        \`        4       R
# R
# VR,          \b        8X  d#   V P                  \d        \g        ^ .4      4       R
# VR,          \h        8X  dB   V P                  '       d   V P                  P                  R!4       V Pk                  RR"7       R
# VR,          \l        8X  d7   V P                  '       d   V P                  P                  R#4       RV n7        R
# VR,          \p        8X  d7   V P                  '       d   V P                  P                  R$4       RV n7        R
# VR,          \r        8X  db   \u        VR,          4      V n;        V P                  '       d7   V P                  P                  R%P                  V Pv                  4      4       R
# R
# VR,          \x        8X  db   \u        VR,          4      V n=        V P                  '       d7   V P                  P                  R&P                  V Pz                  4      4       R
# R
# VR,          \|        8X  Ed   VR,          \~        8X  dd   V P
                  P                  4        V P                  '       d   V P                  P                  R'4       V P                  \        \~        4       R
# VR,          \        8X  dd   V P
                  P                  4        V P                  '       d   V P                  P                  R(4       V P                  \        \        4       R
# VR,          \        8X  d~   V P
                  P                  4        V P
                  P                  4        V P                  '       d   V P                  P                  R)4       V P                  \        \        4       R
# V P                  '       d=   V P                  P                  R*P                  \        VR+,          4      4      4       R
# R
# V P                  '       d=   V P                  P                  R,P                  \        VR-,          4      4      4       R
# R
# V P                  '       d-   V P                  PK                  R.P                  V4      4       R
# R
#   \         dX   pT P                  '       d+   T P                  P                  R	P                  T4      4       Y P
                  n         R
p?ELR
p?ii ; i  \         dX   pT P                  '       d+   T P                  P                  RP                  T4      4       Y P
                  n         R
p?ELR
p?ii ; i  \         dX   pT P                  '       d+   T P                  P                  RP                  T4      4       Y P
                  n         R
p?ELHR
p?ii ; i  \         dX   pT P                  '       d+   T P                  P                  RP                  T4      4       Y P
                  n         R
p?ELR
p?ii ; i)/r  r  zreceived COM_PORT_OPTION: {!r}r  r   :r     Nz{} baud rate: {}r   r1  zfailed to set baud rate: {}Nr   r  z{} data size: {}zfailed to set data size: {}z{} parity: {}zfailed to set parity: {}z{} stop bits: {}zfailed to set stop bits: {}Fzchanged flow control to NoneTz changed flow control to XON/XOFFzchanged flow control to RTS/CTSz'requested break state - not implementedzchanged BREAK to activezchanged BREAK to inactivez%requested DTR state - not implementedzchanged DTR to activezchanged DTR to inactivez%requested RTS state - not implementedzchanged RTS to activezchanged RTS to inactivezrequest for modem stater  suspendresumezline state mask: 0x{:02x}zmodem state mask: 0x{:02x}zpurge inz	purge outz
purge bothzundefined PURGE_DATA: {!r}r  zundefined COM_PORT_OPTION: {!r}:r  NNzunknown subnegotiation: {!r})Fr   r   r
   rc   r   r  r   r   unpackr   ri   r   r   r   r   r   bytesizer   r   r   RFC2217_REVERSE_PARITY_MAPr   r  r   stopbitsRFC2217_REVERSE_STOPBIT_MAPr   r  r   SET_CONTROL_REQ_FLOW_SETTINGxonxoffr   r
  rtsctsr	  r  SET_CONTROL_REQ_BREAK_STATEr   rK  break_conditionrL  SET_CONTROL_REQ_DTRrW  dtrrX  SET_CONTROL_REQ_RTSrQ  rtsrR  NOTIFY_LINESTATEr  r   r  r  r  r   r  SET_LINESTATE_MASKr  r  SET_MODEMSTATE_MASKr  r   rC  r   r   rF  r   PURGE_BOTH_BUFFERSlist)r[   r   backupr   r'  r   r   r  s   &&      rF   rz  *PortManager._telnet_process_subnegotiation  s
   S>_,{{{!!"B"I"I)"TU~---
x"(--y~"FKX1}/7, {{{(();)B)BH5Z_aealalauau)vw001DfkkRWY]YdYdYmYmFno3</--
x"(--y~"FKX1}/7, {{{(();)B)BH5Z_aealalauau)vw001DfkkRWY]YdYdYmYmFno3:-++
q#]]5)C.A!DF{-G-O* {{{(()?)?UZ\`\g\g\n\n)op00%KK'9$++:L:L'MNP 3</--
x%}}UIcNCAFH1}/J8/T, {{{(();)B)BH5Z_aealalauau)vw00'KK':4;;;O;O'PQS 3;.S>%AA{{***889KMlm+++889KMlm889KMlms^'FF*/DKK').DKK&{{{(()GH445GIhis^'FF*.DKK'{{{(()KL445GIhis^'FF)-DKK&{{{(()JK445GIhis^'BB{{{++,UVs^';;26DKK/{{{(()BC445GI]^s^'<<27DKK/{{{(()DE445GI^_s^'::{{{++,STs^'99&*DKKO{{{(()@A445GI[\s^'::&+DKKO{{{(()BC445GI\]s^'::{{{++,STs^'99&*DKKO{{{(()@A445GI[\s^'::&+DKKO{{{(()BC445GI\]	 ; 3#3300+aSM# 3#44;;;KK$$%>?&&$&?3#66;;;KK$$Y/,0)3#55;;;KK$$X.,1)3#55%(3%8";;;KK$$%@%G%GHZHZ%[\ 3#66'*9S>':$;;;KK$$%A%H%HI]I]%^_ 3:-S>%99KK224{{{((4445FH\]s^'<<KK335{{{((5445FH]^s^'99KK224KK335{{{((6445FHZ[{{{))*F*M*MdS\]_S`Na*bc # ;;;KK%%&G&N&NtT]^`TaOb&cd  {{{##$B$I$I)$TU e " 2{{{))*G*N*Nq*QR+1KK((2 " 2{{{))*G*N*Nq*QR+1KK((2 " 0{{{))*D*K*KA*NO)/KK&&0  " 2{{{))*G*N*Nq*QR+1KK((2sf   97x6 57z 2A|  A}% 6zAzz{=&A{88{= }"A}}"%0A)r  r   r   rQ   r  r  r   r~  r  r  r   r  r@   r  )F)rn   ro   rp   rq   rr   r]   r  rh   r   r  r  r  r|  r}  rz  rs   rt   ru   s   @rF   r  r    sL      HF8(5V 5H"7%vQW&~V ~Vr_   r  __main__zrfc2217://localhost:7000r  z{}
z	write...
s   hello
z	read: {}
)
__future__r   r  r   r   r   r   r  ImportErrorurllib.parseparser   queuer  serial.serialutilr   r   r   r   r   r	   DEBUGINFOWARNINGERRORr!  ry  NOPDMBRKIPAOAYTECELGArx  r   r   r   r   r=  r>  r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r   r   r   r   r   r   r  r  SERVER_FLOWCONTROL_SUSPENDSERVER_FLOWCONTROL_RESUMESERVER_SET_LINESTATE_MASKSERVER_SET_MODEMSTATE_MASKr   RFC2217_ANSWER_MAPr  r  r
  r	  r  rK  rL  r  rW  rX  r  rQ  rR  SET_CONTROL_REQ_FLOW_SETTING_IN"SET_CONTROL_USE_NO_FLOW_CONTROL_IN!SET_CONTROL_USE_SW_FLOW_CONTOL_IN!SET_CONTROL_USE_HW_FLOW_CONTOL_IN SET_CONTROL_USE_DCD_FLOW_CONTROL SET_CONTROL_USE_DTR_FLOW_CONTROL SET_CONTROL_USE_DSR_FLOW_CONTROLLINESTATE_MASK_TIMEOUTLINESTATE_MASK_SHIFTREG_EMPTYLINESTATE_MASK_TRANSREG_EMPTYLINESTATE_MASK_BREAK_DETECTLINESTATE_MASK_FRAMING_ERRORLINESTATE_MASK_PARTIY_ERRORLINESTATE_MASK_OVERRUN_ERRORLINESTATE_MASK_DATA_READYrk  rf  rb  r]  r  r  r  r  rC  rF  r  PARITY_NONE
PARITY_ODDPARITY_EVENPARITY_MARKPARITY_SPACEr  dictr  r  STOPBITS_ONESTOPBITS_ONE_POINT_FIVESTOPBITS_TWOr  r  rt  rw  r{  rJ   rK   rL   rM   objectrO   rx   r   r  rn   syssstdoutr?  rc   flushr8  r   rA   r_   rF   <module>r6     sj  z '     $ ) ) W]]
GLLwW]]	  
  
      
     ! " $ # # $   %%!%#-/3113!   ' ") ") ") %         ") %, "$+ !$+ !#*  #*  #*    "  "                    
 
q


  "!P5G5M5M5O!PP  
""A
 
 #"R6I6O6O6Q"RR  
 		#CN6 CNLDp6 DpNzGZ zG@QV& QVj z)62AJJV]]1%&JJ\"GGJGGIJJ\((34GGI S(  $##$  s"   K K, K)(K),K;:K;