+
    ^                     f    R t ^ RIHt ^ RIt^ RIt ! R R]4      t ! R R]P                  4      tR# )zThe settings for RS485 are stored in a dedicated object that can be applied to
serial ports (where supported).
NOTE: Some implementations may only support a subset of the settings.
)absolute_importNc                   *   a  ] tR t^t o RR ltRtV tR# )RS485SettingsNc                B    Wn         W n        W0n        W@n        WPn        R # N)rts_level_for_txrts_level_for_rxloopbackdelay_before_txdelay_before_rx)selfr   r   r	   r
   r   s   &&&&&&./usr/lib/python3/dist-packages/serial/rs485.py__init__RS485Settings.__init__   s!     !1 0 ..    )r   r
   r	   r   r   )TFFNN)__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     / /r   r   c                   v   a a ] tR t^%t oRtV 3R ltV 3R lt]R 4       t]P                  R 4       tRt
VtV ;t# )RS485a  A subclass that replaces the write method with one that toggles RTS
according to the RS485 settings.

NOTE: This may work unreliably on some serial ports (control signals not
      synchronized or delayed compared to data). Using delays may be
      unreliable (varying times, larger than expected) as the OS may not
      support very fine grained delays (no smaller than in the order of
      tens of milliseconds).

NOTE: Some implementations support this natively. Better performance
      can be expected when the native version is used.

NOTE: The loopback property is ignored by this implementation. The actual
      behavior depends on the used hardware.

Usage:

    ser = RS485(...)
    ser.rs485_mode = RS485Settings(...)
    ser.write(b'hello')
c                >   < \         \        V `
  ! V/ VB  R V n        R # r   )superr   r   _alternate_rs485_settings)r   argskwargs	__class__s   &*,r   r   RS485.__init__=   s    eT#T4V4)-&r   c                4  < V P                   e   V P                  V P                   P                  4       V P                   P                  e+   \        P
                  ! V P                   P                  4       \        \        V `#  V4       \        \        V `'  4        V P                   P                  e+   \        P
                  ! V P                   P                  4       V P                  V P                   P                  4       R# \        \        V `#  V4       R# )z=Write to port, controlling RTS before and after transmitting.N)r   setRTSr   r
   timesleepr   r   writeflushr   r   )r   br   s   &&r   r%   RS485.writeA   s    ))5KK66GGH--==I

499IIJ%$Q'%$&--==I

499IIJKK66GGH%$Q'r   c                    V P                   # )zEnable RS485 mode and apply new settings, set to None to disable.
See serial.rs485.RS485Settings for more info about the value.
r   )r   s   &r   
rs485_modeRS485.rs485_modeT   s     ---r   c                    Wn         R # r   r*   )r   rs485_settingss   &&r   r+   r,   \   s    )7&r   r*   )r   r   r   r   __doc__r   r%   propertyr+   setterr   r   __classcell__)r   r   s   @@r   r   r   %   sG     ..(& . . 8 8 8r   r   )	r/   
__future__r   r#   serialobjectr   Serialr    r   r   <module>r8      s1    '  /F /98FMM 98r   