+
    Ȧ^_7                        ^ RI H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]P*                  /t^t ! R R	]4      t]R
8X  d   ^ RIt]! R4      t]P8                  P;                  RP=                  ]4      4       ]P8                  P;                  R4       ]P;                  R4       ]P?                  4        ]P8                  P;                  RP=                  ]PA                  ^4      4      4       ]PC                  4        R# R#   ] d    ^ RI	H
t  EL%i ; i)    )absolute_importN)
SerialBaseSerialExceptionto_bytesPortNotOpenErrorSerialTimeoutExceptionTimeoutdebuginfowarningerrorc                      a  ] tR t^-t o RtRtR tR tR tR t	]
R 4       tRR ltR tR	 tR
 tRR ltR tR tR t]
R 4       t]
R 4       t]
R 4       t]
R 4       tR tRtV tR# )Serialz-Serial port implementation for plain sockets.c                   RV n         V P                  f   \        R4      hV P                  '       d   \        R4      h \        P
                  ! V P                  V P                  4      \        R7      V n	        T P                  P                  R4       T P                  4        RT n        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)z`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.zPort is already open.)timeoutzCould not open port {}: {}FT)logger_portr   is_opensocketcreate_connectionfrom_urlportstrPOLL_TIMEOUT_socket	Exceptionformatsetblocking_reconfigure_port_dsrdtr_update_dtr_state_rtscts_update_rts_statereset_input_bufferreset_output_buffer)selfmsgs   & C/usr/lib/python3/dist-packages/serial/urlhandler/protocol_socket.pyopenSerial.open3   s   
 ::!"RSS<<<!"9::	Z!33DMM$,,4OYefDL
 	  ' 	 |||""$|||""$!  "  	ZDL!">"E"EdllTW"XYY	Zs   :D E,EEc                    V P                   f   \        R4      hV P                  '       d   V P                  P                  R4       R# R# )zbSet communication parameters on opened port. For the socket://
protocol all settings are ignored!
NzCan only operate on open portsz!ignored port configuration change)r   r   r   r   r%   s   &r'   r   Serial._reconfigure_portQ   s;    
 <<!"BCC;;;KK@A     c                0   V P                   '       d}   V P                  '       dL    V P                  P                  \        P                  4       V P                  P                  4        RT n        RV n         \        P                  ! R4       R# R#     L,; i)z
Close portNFg333333?)r   r   shutdownr   	SHUT_RDWRclosetimesleepr+   s   &r'   r1   Serial.close[   sk    <<<|||LL))&*:*:;LL&&(  $ DLJJsO 
s   AB B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  \        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 stringr   zexpected a string in the form "socket://<host>:<port>[?logging={debug|info|warning|error}]": not starting with socket:// ({!r})TloggingzpySerial.socketzenabled loggingzunknown option: {!r}i   zport not in range 0...65535z_expected a string in the form "socket://<host>:<port>[?logging={debug|info|warning|error}]": {}N)urlparseurlsplitschemer   r   parse_qsqueryitemsr6   basicConfig	getLoggerr   setLevelLOGGER_LEVELSr
   
ValueErrorporthostname)r%   urlpartsoptionvalueses   &&    r'   r   Serial.from_urlj   sG   !!#&<<8#!55;VELL5IK K	_"*"3"3EKK"F"L"L"NY&'')")"3"34E"FDKKK((vay)ABKK%%&78$%;%B%B6%JKK #O 

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

++  	_!TTZTZ[\T]_ _	_s   C7E F(FFc                    V P                   '       g   \        4       h\        P                  ! V P                  .. . ^ 4      w  rp\	        V4      # )z9Return the number of bytes currently in the input buffer.)r   r   selectr   len)r%   lrlwlxs   &   r'   
in_waitingSerial.in_waiting   s?     |||"$$ ]]DLL>2r1=
2wr-   c                \   V P                   '       g   \        4       h\        4       p\        V P                  4      p\        V4      V8  d    \        P                  ! V P                  .. . VP                  4       4      w  p pV'       g   MhV P                  P                  V\        V4      ,
          4      pV'       g   \        R4      hVP                  V4       VP-                  4       '       g   K   \/        V4      #   \         d   pTP                  \        P                  \        P                  \        P                   \        P"                  \        P$                  39  d   \        RP'                  T4      4      h Rp?LRp?i\        P(                  \*        P(                  3 d   pT^ ,          \        P                  \        P                  \        P                   \        P"                  \        P$                  39  d   \        RP'                  T4      4      h Rp?ELKRp?i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socket disconnectedread failed: {}N)r   r   	bytearrayr	   _timeoutrL   rK   r   	time_leftrecvr   extendOSErrorerrnoEAGAINEALREADYEWOULDBLOCKEINPROGRESSEINTRr   r   r   expiredbytes)r%   sizereadr   ready_bufrH   s   &&      r'   rc   Serial.read   s    |||"$${$--($i$G$mmT\\NBGDUDUDWXq!
 ll''s4y(89 )*?@@C    T{  G 775<<ARARTYTeTeglgrgr"ss)*;*B*B1*EFF tLL&,,/ G Q4enne>O>OQVQbQbdidodopp)*;*B*B1*EFF q	Gs3   =C? AC? ?H+
A6F&H+,H+-A3H&&H+c                   V P                   '       g   \        4       h\        V4      p\        V4      ;r4\	        V P
                  4      pV^ 8  Ed@    V P                  P                  V4      pVP                  '       d   V# VP                  '       gk   VP                  4       '       d   \        R4      h\        P                  ! . V P                  .. VP                  4       4      w  rxpV'       g   \        R4      hMNVP                  4       e   Q h\        P                  ! . V P                  .. R4      w  rxpV'       g   \        R4      hW&R pW6,          pTP                  '       d   EK#  TP                  4       '       g   EK<  \        R4      hV\        V4      ,
          #   \         d    h \         d   p	T	P                   \         P"                  \         P$                  \         P&                  \         P(                  \         P*                  39  d   \        RP-                  T	4      4      h Rp	?	LRp	?	i\        P.                   d   p	T	^ ,          \         P"                  \         P$                  \         P&                  \         P(                  \         P*                  39  d   \        RP-                  T	4      4      h Rp	?	ELmRp	?	ii ; 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Write timeoutNzwrite failed (select)zwrite failed: {})r   r   r   rL   r	   _write_timeoutr   sendis_non_blockingis_infiniter`   r   rK   rV   r   rY   rZ   r[   r\   r]   r^   r_   r   r   )
r%   datadtx_lenlengthr   nre   rd   rH   s
   &&        r'   writeSerial.write   s'    |||"$$TNa& $--.qj#HLL%%a(*** H ,,, ((4_EE"(--T\\NBHYHYH["\KAa 4_EE ! #,,.666"(--T\\NB"MKAa -.EFFbE ***w/@/@,_==A! #  H 775<<ARARTYTeTeglgrgr"ss)*<*C*CA*FGG t<< H Q4enne>O>OQVQbQbdidodopp)*<*C*CA*FGG q	HsK   ,F" ?F" F" F" )B.F" "K	7K	8A6H33K	
K	A3KK	c                T   V P                   '       g   \        4       hRpV'       dQ   \        P                  ! V P                  .. . ^ 4      w  p p V'       d   V P                  P	                  R4      pKV  KX  R#   \
         d   pTP                  \        P                  \        P                  \        P                  \        P                  \        P                  39  d   \        RP                  T4      4      h Rp?K  Rp?i\        P                  \        P                  3 d   pT^ ,          \        P                  \        P                  \        P                  \        P                  \        P                  39  d   \        RP                  T4      4      h Rp?EK  Rp?ii ; i)z9Clear input buffer, discarding all that is in the buffer.Ti   rS   N)r   r   rK   r   rW   rY   rZ   r[   r\   r]   r^   r_   r   r   r   r   )r%   rd   re   rH   s   &   r'   r#   Serial.reset_input_buffer   s4   |||"$$  --BBKE1aG LL--d3E  
  G 775<<ARARTYTeTeglgrgr"ss)*;*B*B1*EFF tLL&,,/ G Q4enne>O>OQVQbQbdidodopp)*;*B*B1*EFF q	Gs2   A9 A9 9F'A6D  &F''F'(A3F""F'c                    V P                   '       g   \        4       hV P                  '       d   V P                  P                  R4       R# R# )z[Clear output buffer, aborting the current output and
discarding all that is in the buffer.
zignored reset_output_bufferNr   r   r   r   r+   s   &r'   r$   Serial.reset_output_buffer  s7    
 |||"$$;;;KK:; r-   c                    V P                   '       g   \        4       hV P                  '       d-   V P                  P                  RP	                  V4      4       R# R# )zISend break condition. Timed, returns to idle state after given
duration.
zignored send_break({!r})N)r   r   r   r   r   )r%   durations   &&r'   
send_breakSerial.send_break  sB    
 |||"$$;;;KK7>>xHI r-   c                    V P                   '       d7   V P                   P                  RP                  V P                  4      4       R# R# )zBSet break: Controls TXD. When active, to transmitting is
possible.z!ignored _update_break_state({!r})N)r   r   r   _break_stater+   s   &r'   _update_break_stateSerial._update_break_state  s6     ;;;KK@GGHYHYZ[ r-   c                    V P                   '       d7   V P                   P                  RP                  V P                  4      4       R# R# )z)Set terminal status line: Request To Sendzignored _update_rts_state({!r})N)r   r   r   
_rts_stater+   s   &r'   r"   Serial._update_rts_state%  2    ;;;KK>EEdooVW r-   c                    V P                   '       d7   V P                   P                  RP                  V P                  4      4       R# R# )z-Set terminal status line: Data Terminal Readyzignored _update_dtr_state({!r})N)r   r   r   
_dtr_stater+   s   &r'   r    Serial._update_dtr_state*  r   r-   c                    V P                   '       g   \        4       hV P                  '       d   V P                  P                  R4       R# )z(Read terminal status line: Clear To Sendzreturning dummy for ctsTrw   r+   s   &r'   cts
Serial.cts/  5     |||"$$;;;KK67r-   c                    V P                   '       g   \        4       hV P                  '       d   V P                  P                  R4       R# )z)Read terminal status line: Data Set Readyzreturning dummy for dsrTrw   r+   s   &r'   dsr
Serial.dsr8  r   r-   c                    V P                   '       g   \        4       hV P                  '       d   V P                  P                  R4       R# )z)Read terminal status line: Ring Indicatorzreturning dummy for riFrw   r+   s   &r'   ri	Serial.riA  s5     |||"$$;;;KK56r-   c                    V P                   '       g   \        4       hV P                  '       d   V P                  P                  R4       R# )z)Read terminal status line: Carrier Detectzreturning dummy for cd)Trw   r+   s   &r'   cd	Serial.cdJ  r   r-   c                6    V P                   P                  4       # )z@Get the file handle of the underlying socket for use with select)r   filenor+   s   &r'   r   Serial.filenoV  s    ||""$$r-   )r   r   r   N)2   K   n            i,  iX  i  i  i`	  i  i%  i K  i   i   i  )   )g      ?)__name__
__module____qualname____firstlineno____doc__	BAUDRATESr(   r   r1   r   propertyrP   rc   rr   r#   r$   r{   r   r"   r    r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r'   r   r   -   s     74I#<B,:  'R3jG2<J\X
X
        % %r-   r   __main__zsocket://localhost:7000z{}
z	write...
s   hello
z	read: {}
)"
__future__r   rZ   r6   rK   r   r2   r7   ImportErrorurllib.parseparseserial.serialutilr   r   r   r   r   r	   DEBUGINFOWARNINGERRORr@   r   r   r   syssstdoutrr   r   flushrc   r1    r-   r'   <module>r      s  & '     $6 6
 W]]
GLLwW]]	 k%Z k%`	 z()AJJV]]1%&JJ\"GGJGGIJJ\((34GGI C
  $##$s   D5 5EE