%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core20/2379/lib/python3/dist-packages/serial/__pycache__/
Upload File :
Create Path :
Current File : //snap/core20/2379/lib/python3/dist-packages/serial/__pycache__/rs485.cpython-38.pyc

U

�qV��@s:dZddlZddlZGdd�de�ZGdd�dej�ZdS)z�The 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.
�Nc@seZdZddd�ZdS)�
RS485SettingsTFNcCs"||_||_||_||_||_dS�N)�rts_level_for_tx�rts_level_for_rx�loopback�delay_before_tx�delay_before_rx)�selfrrrrr�r
�./usr/lib/python3/dist-packages/serial/rs485.py�__init__s
zRS485Settings.__init__)TFFNN)�__name__�
__module__�__qualname__rr
r
r
rrs�rcsFeZdZdZ�fdd�Z�fdd�Zedd��Zejdd��Z�Z	S)	�RS485a5    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')
    cstt|�j||�d|_dSr)�superrr�_alternate_rs485_settings)r	�args�kwargs��	__class__r
rr;szRS485.__init__cs�|jdk	rz|�|jj�|jjdk	r2t�|jj�tt|��|�tt|��	�|jj
dk	rjt�|jj
�|�|jj�ntt|��|�dS)z=Write to port, controlling RTS before and after transmitting.N)rZsetRTSrr�time�sleeprr�write�flushrr)r	�brr
rr?s
zRS485.writecCs|jS)z�        Enable RS485 mode and apply new settings, set to None to disable.
        See serial.rs485.RS485Settings for more info about the value.
        �r)r	r
r
r�
rs485_modeRszRS485.rs485_modecCs
||_dSrr)r	Zrs485_settingsr
r
rrZs)
r
rr�__doc__rr�propertyr�setter�
__classcell__r
r
rrr#s
r)rr�serial�objectrZSerialrr
r
r
r�<module>
s

Zerion Mini Shell 1.0