+
    1_7                     l   ^ 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 R]4      t^ t]P(                  P+                  4       t]R,          R8X  d%   ^ RItRtR	tR
tRtRtRt^t^t^t^t  ! R R]4      t!M]R8X  d    ! R R]4      t!Mz]R,          R8X  d   ^ RItRt" ! R R]4      t!MZ]R,          R8X  g+   ]R,          R8X  g   ]R,          R8X  g   ]R,          R8X  d    ! R R]4      t# ! R R]4      t!M ! R R]4      t!]$! ]R R!4      t%]$! ]R"R#4      t&]$! ]R$R%4      t']$! ]R&R'4      t(]$! ]R(^4      t)]$! ]R)^4      t*]$! ]R*^ 4      t+]$! ]R+^@4      t,]$! ]R,^4      t-]$! ]R-R.4      t.]$! ]R/],4      t/]$! ]R0]-4      t0]1! ]R14      '       d   ]Pd                  t2M
]$! ]R2R34      t2]$! ]R4R54      t3]Ph                  ! R6^ 4      t5]Ph                  ! R6]*4      t6]Ph                  ! R6])4      t7]$! ]R7R84      t8]$! ]R9R:4      t9 ! R; R<]]!4      t: ! R= R>]:4      t; ! R? R@]:4      t<R# )A    )absolute_importN)
SerialBaseSerialExceptionto_bytesPortNotOpenErrorSerialTimeoutExceptionTimeoutc                   <   a  ] tR t^-t o / tR tR tR tR tRt	V t
R# )PlatformSpecificBasec                    \        R 4      h)z9non-standard baudrates are not supported on this platformNotImplementedError)selfbaudrates   &&4/usr/lib/python3/dist-packages/serial/serialposix.py_set_special_baudrate*PlatformSpecificBase._set_special_baudrate0   s    !"]^^    c                    \        R 4      h)z$RS485 not supported on this platformr   )r   rs485_settingss   &&r   _set_rs485_mode$PlatformSpecificBase._set_rs485_mode3   s    !"HIIr   c                    \        R 4      h)z*Low latency not supported on this platformr   )r   low_latency_settingss   &&r   set_low_latency_mode)PlatformSpecificBase.set_low_latency_mode6   s    !"NOOr   c                    V P                   '       d(   \        P                  ! V P                  \        4       R# \        P                  ! V P                  \
        4       R# )zKSet break: Controls TXD. When active, no transmitting is possible.
        N)_break_statefcntlioctlfdTIOCSBRKTIOCCBRKr   s   &r   _update_break_state(PlatformSpecificBase._update_break_state9   s4     KK*KK*r    N)__name__
__module____qualname____firstlineno__BAUDRATE_CONSTANTSr   r   r   r%   __static_attributes____classdictcell____classdict__s   @r   r   r   -   s'     _JP+ +r   r   :N   Nlinuxi   @l   *TX  i+T,@i   i.T  i/T  c                      a  ] tR t^_t o / ^ ^ b^2^b^K^b^n^b^^b^^b^^bR^bR^bR^	bR^
bR^bR^bR^bR^bR	^bR
Rb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'/CtR( tR) tR* tR+tV t	R,# )-PlatformSpecifici,  iX  i  i  i`	  i  i%  i K  i   i   i  i  i  i    i  i        i      @B     	  ` 
  逄   %&   -   ig5   i 	=   c                   \         P                   ! R ^ .^ ,          4      p \        P                  ! V P                  \        P
                  V4       V'       d   V^;;,          R,          uu&   MV^;;,          R,          uu&   \        P                  ! V P                  \        P                  V4       R#   \         d    p\        RP                  Y4      4      hRp?ii ; i)ii    z1Failed to update ASYNC_LOW_LATENCY flag to {}: {}Ni)
arrayr   r    r!   termiosTIOCGSERIALTIOCSSERIALIOError
ValueErrorformat)r   r   bufes   &&  r   r   %PlatformSpecific.set_low_latency_mode   s    ++cA38,CvDGGW%8%8#> (Ff$FFg%F DGGW%8%8#> v !T![![\p!tuuvs   7B6 AB6 6C CC c                   \         P                   ! R ^ .^@,          4      p \        P                  ! V P                  \        V4       V^;;,          \
        P                  ( ,          uu&   V^;;,          \        ,          uu&   V;V^	&   V^
&   \        P                  ! V P                  \        V4       R#   \         d    p\        RP                  Y4      4      hRp?ii ; i)rJ   z'Failed to set custom baud rate ({}): {}N)rK   r   r    r!   TCGETS2rL   CBAUDBOTHERTCSETS2rO   rP   rQ   )r   r   rR   rS   s   &&  r   r   &PlatformSpecific._set_special_baudrate   s    ++cA38,C`DGGWc2A7==.(A& #++AR DGGWc2 ` !J!Q!QRZ!^__`s   BB6 6C CC c                   \         P                   ! R ^ .^,          4      p \        P                  ! V P                  \        V4       V^ ;;,          \
        ,          uu&   VEe.   VP                  '       d   V^ ;;,          \        ,          uu&   MV^ ;;,          \        ( ,          uu&   VP                  '       d   V^ ;;,          \        ,          uu&   MV^ ;;,          \        ( ,          uu&   VP                  '       d   V^ ;;,          \        ,          uu&   MV^ ;;,          \        ( ,          uu&   VP                  e    \        VP                  R,          4      V^&   VP                  e    \        VP                  R,          4      V^&   M^ V^ &   \        P                  ! V P                  \        V4       R#   \          d    p\#        RP%                  T4      4      hRp?ii ; i)rJ   N  zFailed to set RS485 mode: {})rK   r   r    r!   
TIOCGRS485SER_RS485_ENABLEDloopbackSER_RS485_RX_DURING_TXrts_level_for_txSER_RS485_RTS_ON_SENDrts_level_for_rxSER_RS485_RTS_AFTER_SENDdelay_before_txintdelay_before_rx
TIOCSRS485rO   rP   rQ   )r   r   rR   rS   s   &&  r   r    PlatformSpecific._set_rs485_mode   s_   ++cA37+CKDGGZ5A++!-%...A"88A#9"99%666A"77A#8"88%666A"::A#;";;%55A!$^%C%Cd%J!KA%55A!$^%C%Cd%J!KACFDGGZ5 K !?!F!Fq!IJJKs-   AF? 7AF? =AF? B:F? ?G)
G$$G)r'   N)
r(   r)   r*   r+   r,   r   r   r   r-   r.   r/   s   @r   r4   r4   _   s;     
X 
X 
 X 
 X	 

 X 
 X 
 X 
 X 
 X 
 X 
 X 
 X 
 X 
 X 
 X 
  X! 
" X# 
$ XXXXXXXXXXXXXX? 
D	v$	` 	K 	Kr   r4   cygwinc                   F    ] tR t^tRRRRRRRRR	R
RRRRRRRRRRRR/tRtR# )r4   i  r5   i  r7   r6   r:   r8   r<   r9   r>   r;   r@   r=   rB   r?   rD   rA   rF   rC   rG   rE   rH   r'   N)r(   r)   r*   r+   r,   r-   r'   r   r   r4   r4      sA    GGGGGWWWWWW
r   :N   Ndarwinl   T  c                      a  ] tR t^t o ]P
                  ! 4       ^,          P                  R4      tRtRt	]
! ]^ ,          4      ^8  d   R tR tRtV tR# )r4   .{t  zt  c                    \         P                   ! R V.4      p\        P                  ! V P                  \        V^4       R# )rJ   N)rK   r   r    r!   IOSSIOSPEED)r   r   rR   s   && r   r   rZ      s*    kk#z2DGG[#q9r   c                    V P                   '       d2   \        P                  ! V P                  \        P
                  4       R# \        P                  ! V P                  \        P                  4       R# zOSet break: Controls TXD. When active, no transmitting is possible.
            Nr   r   r    r!   r4   r"   r#   r$   s   &r   r%   $PlatformSpecific._update_break_state   B        DGG%5%>%>?DGG%5%>%>?r   r'   N)r(   r)   r*   r+   osunamesplitosx_versionr"   r#   rf   r   r%   r-   r.   r/   s   @r   r4   r4      sM     hhjm))#. {1~!#:
	@ 	@r   :N   Nbsd:N   Nfreebsdnetbsdopenbsdc                   &   a  ] tR t^t o R tRtV tR# )ReturnBaudratec                    V# )Nr'   )r   keys   &&r   __getitem__ReturnBaudrate.__getitem__   s    Jr   r'   N)r(   r)   r*   r+   r   r-   r.   r/   s   @r   r   r      s     	 	r   r   c                   <   a  ] tR t^t o ]! 4       tRtRtR tRt	V t
R# )r4   rp   rq   c                    V P                   '       d2   \        P                  ! V P                  \        P
                  4       R# \        P                  ! V P                  \        P                  4       R# ru   rv   r$   s   &r   r%   rw      rx   r   r'   N)r(   r)   r*   r+   r   r,   r"   r#   r%   r-   r.   r/   s   @r   r4   r4      s&      ,-	@ 	@r   c                       ] tR tRtRtR# )r4   i	  r'   N)r(   r)   r*   r+   r-   r'   r   r   r4   r4   	  s    r   TIOCMGETiT  TIOCMBISiT  TIOCMBICiT  TIOCMSETiT  	TIOCM_DTR	TIOCM_RTS	TIOCM_CTS	TIOCM_CAR	TIOCM_RNG	TIOCM_DSR   TIOCM_CDTIOCM_RITIOCINQFIONREADiT  TIOCOUTQiT  Ir"   i'T  r#   i(T  c                     a  ] tR tRt o RtR tRR ltR t]R 4       t	RR lt
R tR	 tR
 tR tR tR tR tRR ltR tR t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR tR R ltR R ltR tRtV tR# )!Seriali0  zSerial port class POSIX implementation. Serial port configuration is
done with termios and fcntl. Runs on Linux and many other Un*x like
systems.
c                <   V P                   f   \        R4      hV P                  '       d   \        R4      hRV n         \        P
                  ! V P                  \        P                  \        P                  ,          \        P                  ,          4      V n        RRuT n        T n        RRuT n        T n         T P#                  RR7        T P$                  '       g   T P'                  4        T P(                  '       g   T P+                  4        T P3                  4        \        P4                  ! 4       w  T n        T n        \        P4                  ! 4       w  T n        T n        \6        P6                  ! T P                  \6        P8                  \        P                  4       \6        P6                  ! T P                  \6        P8                  \        P                  4       RT n        R#   \         d=   pRT n        \        TP                  RP                  T P                   T4      4      hRp?ii ; i  \,         d<   pTP                  \        P.                  \        P0                  39  d   h  Rp?ELdRp?ii ; i  \:         Ed     \        P<                  ! T P                  4       M  \>         d     Mi ; iRT n        T P                  e(   \        P<                  ! T P                  4       RT n        T P                  e(   \        P<                  ! T P                  4       RT n        T P                   e(   \        P<                  ! T P                   4       RT n        T P                  e(   \        P<                  ! T P                  4       RT n        h 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.zcould not open port {}: {}T)force_update) _portr   is_openr!   ry   openportstrO_RDWRO_NOCTTY
O_NONBLOCKOSErrorerrnorQ   pipe_abort_read_rpipe_abort_read_wpipe_abort_write_rpipe_abort_write_w_reconfigure_port_dsrdtr_update_dtr_state_rtscts_update_rts_staterO   EINVALENOTTY_reset_input_bufferpiper   F_SETFLBaseExceptionclose	Exception)r   msgrS   s   &  r   r   Serial.open7  s    ::!"RSS<<<!"9::	cggdllBII,Cbmm,STDG :>t6 6;?8!8)	"""5|||**,|||**, $$&=?WWY:D"D$:?Awwy<D#T%<KK..r}}MKK//N2 g  	cDG!#))-I-P-PQUQ[Q[]`-abb	c   775<<">> ?  	!   DG%%1//0)-&%%1//0)-&&&2001*.'&&2001*.'-	sz   AG, <I? 3H6 H6 CI? ,H377H..H36I<0I71I? 7I<<I? ?N J-,N-J;8N:J;;C Nc                   V P                   f   \        R4      hV P                  e   V P                  '       dG    \        P                  ! V P                   \        P
                  \        P                  ,          4       M/\        P                  ! V P                   \        P                  4       Rp^ ;rEV P                  e   ^p\        V P                  ^
,          4      p \        P                  ! V P                   4      pVw  rxrrpT	\        P"                  \        P$                  ,          ,          p	T
\        P&                  \        P(                  ,          \        P*                  ,          \        P,                  ,          \        P.                  ,          \        P0                  ,          \        P2                  ,          ( ,          p
R F3  p\5        \        T4      '       g   K  T
\7        \        T4      ( ,          p
K5  	  T\        P8                  \        P:                  ,          \        P<                  ,          ( ,          pT\        P>                  \        P@                  ,          \        PB                  ,          \        PD                  ,          ( ,          p\5        \        R4      '       d   T\        PF                  ( ,          p\5        \        R4      '       d   T\        PH                  ( ,          p \7        \        RP                  T PJ                  4      4      ;rT	\        PX                  ( ,          p	T PZ                  ^8X  d   T	\        P\                  ,          p	MT PZ                  ^8X  d   T	\        P^                  ,          p	MvT PZ                  ^8X  d   T	\        P`                  ,          p	MMT PZ                  ^8X  d   T	\        Pb                  ,          p	M$\W        R
P                  T PZ                  4      4      hT Pd                  \f        Ph                  8X  d   T	\        Pj                  ( ,          p	MT Pd                  \f        Pl                  8X  d   T	\        Pj                  ,          p	M[T Pd                  \f        Pn                  8X  d   T	\        Pj                  ,          p	M$\W        RP                  T Pd                  4      4      hT\        Pp                  \        Pr                  ,          ( ,          pT Pt                  \f        Pv                  8X  d;   T	\        Px                  \        Pz                  ,          \|        ,          ( ,          p	EMT Pt                  \f        P~                  8X  d=   T	\        Pz                  \|        ,          ( ,          p	T	\        Px                  ,          p	EMGT Pt                  \f        P                  8X  d<   T	\|        ( ,          p	T	\        Px                  \        Pz                  ,          ,          p	MT Pt                  \f        P                  8X  dE   \|        '       d9   T	\        Px                  \|        ,          \        Pz                  ,          ,          p	MT Pt                  \f        P                  8X  dH   \|        '       d<   T	\        Px                  \|        ,          ,          p	T	\        Pz                  ( ,          p	M$\W        RP                  T Pt                  4      4      h\5        \        R4      '       d   T P                  '       d.   T\        P                  \        P                  ,          ,          pMT\        P                  \        P                  ,          \        P                  ,          ( ,          pMlT P                  '       d.   T\        P                  \        P                  ,          ,          pM-T\        P                  \        P                  ,          ( ,          p\5        \        R4      '       dD   T P                  '       d   T	\        P                  ,          p	MqT	\        P                  ( ,          p	MX\5        \        R4      '       dC   T P                  '       d   T	\        P                  ,          p	MT	\        P                  ( ,          p	T^ 8  g   T^8  d   \W        RP                  T4      4      hYM\        P                  &   T^ 8  g   T^8  d   \W        RP                  T4      4      hY]\        P                  &   T'       g   YxYYT.T8w  d5   \        P                  ! T P                   \        P                  YxYYT.4       Te   T P                  T4       T P                  e   T P                  T P                  4       R# R#   \         d6   p\        TP                  RP                  T P                  T4      4      hRp?ii ; i  \        P                    d    p\        RP                  T4      4      hRp?ii ; i  \L         d     T PN                  T PJ                  ,          ;r EL+  \P         d     \R        ;rM"  \T         d    \7        \        R4      ;r Mi ; i \        T PJ                  4      pT^ 8  d%   \W        R	P                  T PJ                  4      4      h  EL  \V         d&    \W        R	P                  T PJ                  4      4      hi ; ii ; ii ; i),Set communication parameters on opened port.Nz+Can only operate on a valid file descriptorz&Could not exclusively lock port {}: {}Could not configure port: {}IUCLCPARMRKzB{}B38400zInvalid baud rate: {!r}zInvalid char len: {!r}z$Invalid stop bit specification: {!r}zInvalid parity: {!r}IXANYCRTSCTSCNEW_RTSCTSzInvalid vmin: {!r}Invalid vtime: {!r})ECHOCTLECHOKE)Qr!   r   
_exclusiver   flockLOCK_EXLOCK_NBrO   r   rQ   r   LOCK_UN_inter_byte_timeoutrf   rL   	tcgetattrerrorCLOCALCREADICANONECHOECHOEECHOKECHONLISIGIEXTENhasattrgetattrOPOSTONLCROCRNLINLCRIGNCRICRNLIGNBRKr   r   	_baudrateAttributeErrorr,   KeyErrorrX   	NameErrorrP   CSIZE	_bytesizeCS8CS7CS6CS5	_stopbitsserialSTOPBITS_ONECSTOPBSTOPBITS_ONE_POINT_FIVESTOPBITS_TWOINPCKISTRIP_parityPARITY_NONEPARENBPARODDCMSPARPARITY_EVEN
PARITY_ODDPARITY_MARKPARITY_SPACE_xonxoffIXONIXOFFr   r   r   r   VMINVTIME	tcsetattrTCSANOWr   _rs485_moder   )r   r   r   custom_baudvminvtime	orig_attriflagoflagcflaglflagispeedospeedccflags   &&             r   r   Serial._reconfigure_portx  sz   77?!"OPP ??&wKK)FG DGGU]]3##/D00256E	N))$''2I=F:E% 	'..7==017>>GLL07==@==!#*>>2<< ")..1 2 	2 *Dw%%''4000 * 	7==7==07==@AA7==7==07==@7>>QRR7G$$gmm^#E7H%%gnn_$E	[%gu||DNN/KLLF0 	'-->>QW[[ E^^q W[[ E^^q W[[ E^^q W[[ E5<<T^^LMM>>V000w~~&&E^^v===gnn%E^^v222gnn%ECJJ4>>Z[[7==7>>122<<6---w~~6?@@E\\V///w~~.//Egnn%E\\V...fWEgnnw~~56E\\V///FFgnnv->?E\\V000VVgnnv-.Ew~~&&E3::4<<HII 7G$$}}}',,677<<'--7'--GHH}}}',,677<<'--7887I&&|||'//*7??++Wm,,|||'--.7..//
 !8tcz188>??7<<19299%@AA!7==E%KyXuVR@B "&&{3'  !1!12 (Y  w)#))5]5d5deieoeoqt5uvvw }} 	N!"@"G"G"LMM	N*  	[["&"9"9$.."II [
A&,,FV  A&-gx&@@FVA["%dnn"5K #Q()B)I)I$..)YZZ ' " W$%>%E%Ednn%UVVW[	[s   Af' !'g* 9*h! 'g'20g""g'*h?hh!l-ik=i"!k="j>k= jk=k	+k=l	0k99k==lc                   V P                   '       d   V P                  e   \        P                  ! V P                  4       RV n        \        P                  ! V P                  4       \        P                  ! V P
                  4       \        P                  ! V P                  4       \        P                  ! V P                  4       RRuV n        V n        RRuV n        V n        RV n         R# R# )z
Close portNF)r   r!   ry   r   r   r   r   r   r$   s   &r   r   Serial.close  s    <<<ww"!//0//0001001AEt>&(>CG@')@ DL r   c                    \         P                  ! V P                  \        \        4      p\
        P                  ! RV4      ^ ,          # )z9Return the number of bytes currently in the input buffer.r   )r   r    r!   r   TIOCM_zero_strstructunpackr   ss   & r   
in_waitingSerial.in_waiting!  s0     KK.9}}S!$Q''r   c                   V P                   '       g   \        4       h\        4       p\        V P                  4      p\        V4      V8  d    \        P                  ! V P                  V P                  .. . VP                  4       4      w  p pV P                  V9   d#   \        P                  ! V P                  R4       MwV'       g   Mn\        P                  ! V P                  V\        V4      ,
          4      pV'       g   \        R4      hVP                  V4       VP/                  4       '       g   K   \1        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,                   d   pT^ ,          \        P                   \        P"                  \        P$                  \        P&                  \        P(                  39  d   \        RP+                  T4      4      h Rp?EL;Rp?ii ; i)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.
r\   zgdevice reports readiness to read but returned no data (device disconnected or multiple access on port?)zread failed: {}N)r   r   	bytearrayr	   _timeoutlenselectr!   r   	time_leftry   readr   extendr   r   EAGAINEALREADYEWOULDBLOCKEINPROGRESSEINTRrQ   r   expiredbytes)r   sizer$  timeoutready_rR   rS   s   &&      r   r$  Serial.read)  s    |||"$${$--($i$"!$mmTWWd6L6L,MrSUW^WhWhWjkq!))U2GGD22D9
 ggdggtc$i'78   *LM M C   T{5  G 775<<ARARTYTeTeglgrgr"ss)*;*B*B1*EFF t<< G Q4enne>O>OQVQbQbdidodopp)*;*B*B1*EFF q	Gs9   A3E E 
1E IA6G		I I!A3IIc                p    V P                   '       d$   \        P                  ! V P                  R 4       R# R#    xN)r   ry   writer   r$   s   &r   cancel_readSerial.cancel_read\  s$    <<<HHT++T2 r   c                p    V P                   '       d$   \        P                  ! V P                  R 4       R# R# r3  )r   ry   r5  r   r$   s   &r   cancel_writeSerial.cancel_write`  s$    <<<HHT,,d3 r   c                x   V P                   '       g   \        4       h\        V4      p\        V4      ;r4\	        V P
                  4      pV^ 8  Ed    \        P                  ! V P                  V4      pVP                  '       d   V# VP                  '       g   VP                  4       '       d   \        R4      h\        P                  ! V P                  .V P                  .. VP                  4       4      w  rxp	V'       d#   \        P                   ! V P                  R4       MV'       g   \        R4      hMVP                  4       e   Q h\        P                  ! V P                  .V P                  .. R4      w  rxp	V'       d#   \        P                   ! V P                  ^4       MXV'       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.                  \&        P0                  39  d   \#        RP3                  T
4      4      h Rp
?
LRp
?
i\        P4                   d   p
T
^ ,          \&        P(                  \&        P*                  \&        P,                  \&        P.                  \&        P0                  39  d   \#        RP3                  T
4      4      h Rp
?
ELmRp
?
ii ; i)z2Output the given byte string over the serial port.zWrite timeoutr\   Nzwrite failed (select)zwrite failed: {})r   r   r   r!  r	   _write_timeoutry   r5  r!   is_non_blockingis_infiniter+  r   r"  r   r#  r$  r   r   r   r&  r'  r(  r)  r*  rQ   r   )r   datadtx_lenlengthr.  nabortr/  r0  rS   s   &&         r   r5  Serial.writed  su   |||"$$TNa& $--.qj)HHHTWWa(*** H ,,, ((4_EE&,mmT5L5L4MPTPWPWyZ\^e^o^o^q&rOE! 7 7> 4_EE ! #,,.666&,mmT5L5L4MPTPWPWyZ\^b&cOE! 7 7; -.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sd   2H H H H /A4H $H ,A;H (H 0H L9'L9(A6J##L9:L9;A3L44L9c                ~    V P                   '       g   \        4       h\        P                  ! V P                  4       R# )zJFlush of file like objects. In this case, wait until all data
is written.
N)r   r   rL   tcdrainr!   r$   s   &r   flushSerial.flush  s&    
 |||"$$ r   c                d    \         P                  ! V P                  \         P                  4       R# z9Clear input buffer, discarding all that is in the buffer.N)rL   tcflushr!   TCIFLUSHr$   s   &r   r   Serial._reset_input_buffer  s    !1!12r   c                ^    V P                   '       g   \        4       hV P                  4        R# rK  )r   r   r   r$   s   &r   reset_input_bufferSerial.reset_input_buffer  s     |||"$$  "r   c                    V P                   '       g   \        4       h\        P                  ! V P                  \        P
                  4       R# )z[Clear output buffer, aborting the current output and discarding all
that is in the buffer.
N)r   r   rL   rL  r!   TCOFLUSHr$   s   &r   reset_output_bufferSerial.reset_output_buffer  s.    
 |||"$$!1!12r   c                    V P                   '       g   \        4       h\        P                  ! V P                  \        VR,          4      4       R# )zISend break condition. Timed, returns to idle state after given
duration.
      ?N)r   r   rL   tcsendbreakr!   rf   )r   durations   &&r   
send_breakSerial.send_break  s3    
 |||"$$DGGSD%9:r   c                    V P                   '       d-   \        P                  ! V P                  \        \
        4       R# \        P                  ! V P                  \        \
        4       R# )z)Set terminal status line: Request To SendN)
_rts_stater   r    r!   r   TIOCM_RTS_strr   r$   s   &r   r   Serial._update_rts_state  3    ???KK=9KK=9r   c                    V P                   '       d-   \        P                  ! V P                  \        \
        4       R# \        P                  ! V P                  \        \
        4       R# )z-Set terminal status line: Data Terminal ReadyN)
_dtr_stater   r    r!   r   TIOCM_DTR_strr   r$   s   &r   r   Serial._update_dtr_state  r`  r   c                    V P                   '       g   \        4       h\        P                  ! V P                  \
        \        4      p\        P                  ! RV4      ^ ,          \        ,          ^ 8g  # )z(Read terminal status line: Clear To Sendr   )
r   r   r   r    r!   r   r  r  r  r   r  s   & r   cts
Serial.cts  L     |||"$$KK>:}}S!$Q')3q88r   c                    V P                   '       g   \        4       h\        P                  ! V P                  \
        \        4      p\        P                  ! RV4      ^ ,          \        ,          ^ 8g  # )z)Read terminal status line: Data Set Readyr   )
r   r   r   r    r!   r   r  r  r  r   r  s   & r   dsr
Serial.dsr  rh  r   c                    V P                   '       g   \        4       h\        P                  ! V P                  \
        \        4      p\        P                  ! RV4      ^ ,          \        ,          ^ 8g  # )z)Read terminal status line: Ring Indicatorr   )
r   r   r   r    r!   r   r  r  r  r   r  s   & r   ri	Serial.ri  L     |||"$$KK>:}}S!$Q'(2a77r   c                    V P                   '       g   \        4       h\        P                  ! V P                  \
        \        4      p\        P                  ! RV4      ^ ,          \        ,          ^ 8g  # )z)Read terminal status line: Carrier Detectr   )
r   r   r   r    r!   r   r  r  r  r   r  s   & r   cd	Serial.cd  ro  r   c                    \         P                  ! V P                  \        \        4      p\
        P                  ! RV4      ^ ,          # )z:Return the number of bytes currently in the output buffer.r   )r   r    r!   r   r  r  r  r  s   & r   out_waitingSerial.out_waiting  s0     KK>:}}S!$Q''r   c                R    V P                   '       g   \        4       hV P                  # )zwFor easier use of the serial port instance with select.
WARNING: this function is not portable to different platforms!
)r   r   r!   r$   s   &r   filenoSerial.fileno  s    
 |||"$$wwr   c                   V P                   '       g   \        4       hV'       d2   \        P                  ! V P                  \        P
                  4       R# \        P                  ! V P                  \        P                  4       R# )zManually control flow - when software flow control is enabled.
This will send XON (true) or XOFF (false) to the other device.
WARNING: this function is not portable to different platforms!
N)r   r   rL   tcflowr!   TCIONTCIOFFr   enables   &&r   set_input_flow_controlSerial.set_input_flow_control  E     |||"$$NN477GMM2NN477GNN3r   c                   V P                   '       g   \        4       hV'       d2   \        P                  ! V P                  \        P
                  4       R# \        P                  ! V P                  \        P                  4       R# )zManually control flow of outgoing data - when hardware or software flow
control is enabled.
WARNING: this function is not portable to different platforms!
N)r   r   rL   rz  r!   TCOONTCOOFFr}  s   &&r   set_output_flow_controlSerial.set_output_flow_control  r  r   c                :    ^ RI pVP                  R\        4       R# )zDEPRECATED - has no useNz0nonblocking() has no effect, already nonblocking)warningswarnDeprecationWarning)r   r  s   & r   nonblockingSerial.nonblocking  s    HJ\]r   )r!   r   r   r   r   r   N)F   )rW  T) r(   r)   r*   r+   __doc__r   r   r   propertyr  r$  r6  r9  r5  rH  r   rP  rT  rZ  r   r   rf  rj  rm  rq  rt  rw  r  r  r  r-   r.   r/   s   @r   r   r   0  s     ?BW3r!  ( (1f344l!3#3;:: 9 9 9 9 8 8 8 8 ( (44^ ^r   r   c                   .   a  ] tR tRt o RtRR ltRtV tR# )PosixPollSeriali  zPoll based read implementation. Not all systems support poll properly.
However this one has better handling of errors, such as a device
disconnecting while it's in use (e.g. USB-serial unplugged).
c                T   V P                   '       g   \        4       h\        4       p\        V P                  4      p\
        P                  ! 4       pVP                  V P                  \
        P                  \
        P                  ,          \
        P                  ,          \
        P                  ,          4       VP                  V P                  \
        P                  \
        P                  ,          \
        P                  ,          \
        P                  ,          4       V^ 8  Edu   \        V4      V8  Edd   TP                  VP                  '       d   RMVP!                  4       R,          4       Fi  w  rVWPP                  8X  d    MVV\
        P                  \
        P                  ,          \
        P                  ,          ,          '       g   K`  \#        R4      h	  XV P                  8X  d#   \$        P&                  ! V P                  R4       M\$        P&                  ! V P                  V\        V4      ,
          4      pVP)                  V4       VP+                  4       '       g1   V P,                  f   EKT  V P,                  ^ 8  g   EKh  V'       d   EKs   \/        V4      # )r  Nr\   zdevice reports error (poll))r   r   r  r	   r   r"  pollregisterr!   POLLINPOLLERRPOLLHUPPOLLNVALr   r!  r>  r#  r   ry   r$  r%  r+  r   r,  )r   r-  r$  r.  r  r!   eventrR   s   &&      r   r$  PosixPollSerial.read&  s    |||"$${$--({{}dggv}}v~~=NQWQ`Q``ad,,fmmfnn.Lv~~.]`f`o`o.op!8d)d" "&73F3F3F4WM^M^M`cgMg!iIB333 ?&// QRR-.KLL	 "j ///GGD22D9ggdggtc$i'78C ??$$ 44@TE]E]`aEaknknT{r   r'   Nr  )r(   r)   r*   r+   r  r$  r-   r.   r/   s   @r   r  r    s        r   r  c                   R   a a ] tR tRt oRtRV 3R lltRR lt]! 4       tRt	Vt
V ;t# )VTIMESerialiI  aF  Implement timeout using vtime of tty device instead of using select.
This means that no inter character timeout can be specified and that
the error handling is degraded.

Overall timeout is disabled when inter-character timeout is used.

Note that this implementation does NOT support cancel_read(), it will
just ignore that.
c                  < \         \        V `  4        \        P                  ! V P                  \        P
                  ^ 4       V P                  e    ^p\        V P                  ^
,          4      pM1V P                  f   ^p^ pM^ p\        V P                  ^
,          4      p \        P                  ! V P                  4      pVw  rVrxrpT^ 8  g   T^8  d   \        RP                  T4      4      hY;\        P                   &   Y+\        P"                  &   \        P$                  ! T P                  \        P&                  YVYxYT.4       R#   \        P                   d+   p\        P                  ! RP                  T4      4      hRp?ii ; i)r   Nr   r   )superr  r   r   r!   r   r   rf   r   rL   r   r   r   r   rQ   rP   r  r  r  r  )r   r   r  r  r	  r
  r  r  r  r  r  r  r   	__class__s   &&           r   r   VTIMESerial._reconfigure_portU  s>   k424DGGU]]A.##/D00256E]]"DED*+E	U))$''2I=F:E% 19299%@AA!7==7<<uVR@	B }} 	U(()G)N)Ns)STT	Us   #'E F!%FFc                   V P                   '       g   \        4       h\        4       p\        V4      V8  dN   \        P
                  ! V P                  V\        V4      ,
          4      pV'       g   MVP                  V4       K]  \        V4      # )r  )	r   r   r  r!  ry   r$  r!   r%  r,  )r   r-  r$  rR   s   &&  r   r$  VTIMESerial.reads  sb     |||"$${$i$''$''4#d)#34CKKT{r   r'   r  r  )r(   r)   r*   r+   r  r   r$  r  r6  r-   r.   __classcell__)r  r0   s   @@r   r  r  I  s      	B<" *KKr   r  )=
__future__r   r   r   ry   r"  r  sysrL   r   serial.serialutilr   r   r   r   r   r	   objectr   r   platformlowerplatrK   rV   rY   rX   r]   rh   r^   rb   rd   r`   r4   rs   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   packr  r^  rc  r"   r#   r   r  r  r'   r   r   <module>r     s  : '   	   
  6 6+6 +0 

 ||8w F GGF JJ"&)'_K/ _KD 
X
/ 
  
"XK@/ @* 
"X	"X	"X	"X @/ @(/  7J/7J/7J/7J/ G[%0	G[%0	 G[%0	G[%0	G[%0	G[%0	7J	27J	2 7IooGgz62G7J/S!$C+C+7J/7J/l^Z) l^^'f 'T;& ;r   