Current File : //proc/self/root/usr/lib/python3/dist-packages/serial/__pycache__/serialposix.cpython-312.pyc
�

1�_7����ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZm
Z
mZmZmZGd�de�ZdZej(j+�Zedddk(r$ddlZdZd	Zd
ZdZdZd
ZdZdZdZdZ Gd�de�Z!nmedk(rGd�de�Z!n\edddk(rddlZdZ"Gd�de�Z!nBedddk(sedddk(sedddk(sedddk(rGd �d!e�Z#Gd"�de�Z!nGd#�de�Z!e$ed$d%�Z%e$ed&d'�Z&e$ed(d)�Z'e$ed*d+�Z(e$ed,d�Z)e$ed-d�Z*e$ed.d/�Z+e$ed0d1�Z,e$ed2d3�Z-e$ed4d5�Z.e$ed6e,�Z/e$ed7e-�Z0e1ed8�r
ejdZ2n
e$ed9d:�Z2e$ed;d<�Z3ejhd=d�Z5ejhd=e*�Z6ejhd=e)�Z7e$ed>d?�Z8e$ed@dA�Z9GdB�dCee!�Z:GdD�dEe:�Z;GdF�dGe:�Z<y)H�)�absolute_importN)�
SerialBase�SerialException�to_bytes�PortNotOpenError�SerialTimeoutException�Timeoutc�(�eZdZiZd�Zd�Zd�Zd�Zy)�PlatformSpecificBasec��td��)Nz9non-standard baudrates are not supported on this platform��NotImplementedError)�self�baudrates  �4/usr/lib/python3/dist-packages/serial/serialposix.py�_set_special_baudratez*PlatformSpecificBase._set_special_baudrate0s��!�"]�^�^�c��td��)Nz$RS485 not supported on this platformr
)r�rs485_settingss  r�_set_rs485_modez$PlatformSpecificBase._set_rs485_mode3s��!�"H�I�Irc��td��)Nz*Low latency not supported on this platformr
)r�low_latency_settingss  r�set_low_latency_modez)PlatformSpecificBase.set_low_latency_mode6s��!�"N�O�Orc��|jr%tj|jt�ytj|jt
�y)zS        Set break: Controls TXD. When active, no transmitting is possible.
        N)�_break_state�fcntl�ioctl�fd�TIOCSBRK�TIOCCBRK�rs r�_update_break_statez(PlatformSpecificBase._update_break_state9s1������K�K�����*��K�K�����*rN)�__name__�
__module__�__qualname__�BAUDRATE_CONSTANTSrrrr"�rrrr-s����_�J�P�+rr��linuxi@l*TXi+T,@ii.Ti/T����c��eZdZidd�dd�dd�dd�dd	�d
d�dd
�dd�dd�dd�dd�dd�dd�dd�dd�dd�d d!�d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0��Zd1�Zd2�Zd3�Zy4)5�PlatformSpecificr�2r*�Kr+�n��r,�r(���i,�iX�i��	i�
i`	�i��i�%�
iK�i��i�ii�i�i���	�
���
��)i�i�i� �����@B���`�逄�%&��-i�g5i	=c��tjddgdz�}	tj|jtj
|�|r|dxxdzcc<n
|dxxdzcc<tj|jtj|�y#t$r }tdj||���d}~wwxYw)N�ir� r,i i���z1Failed to update ASYNC_LOW_LATENCY flag to {}: {})
�arrayrrr�termios�TIOCGSERIAL�TIOCSSERIAL�IOError�
ValueError�format)rr�buf�es    rrz%PlatformSpecific.set_low_latency_mode�s����+�+�c�A�3��8�,�C�

v����D�G�G�W�%8�%8�#�>�(���F�f�$�F���F�g�%�F����D�G�G�W�%8�%8�#�>���
v� �!T�![�![�\p�rs�!t�u�u��
v�s�A;B�	C�!B<�<Cc��tjddgdz�}	tj|jt|�|dxxt
jzcc<|dxxtzcc<|x|d<|d<tj|jt|�y#t$r }tdj||���d}~wwxYw)NrVr�@r+r:r;z'Failed to set custom baud rate ({}): {})rXrrr�TCGETS2rY�CBAUD�BOTHER�TCSETS2r\r]r^)rrr_r`s    rrz&PlatformSpecific._set_special_baudrate�s����+�+�c�A�3��8�,�C�
`����D�G�G�W�c�2��A��7�=�=�.�(���A��&� ��#+�+��A���R�����D�G�G�W�c�2���
`� �!J�!Q�!Q�RZ�\]�!^�_�_��
`�s�BB�	C�'C�Cc��tjddgdz�}	tj|jt|�|dxxt
zcc<|��|jr|dxxtzcc<n|dxxtzcc<|jr|dxxtzcc<n|dxxtzcc<|jr|dxxtzcc<n|dxxtzcc<|j�t|jdz�|d<|j�!t|jdz�|d<nd|d<tj|jt|�y#t $r}t#dj%|���d}~wwxYw)NrVrr9��r*r+zFailed to set RS485 mode: {})rXrrr�
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�
TIOCSRS485r\r]r^)rrr_r`s    rrz PlatformSpecific._set_rs485_mode�sU���+�+�c�A�3��7�+�C�
K����D�G�G�Z��5��A��+�+��!�-�%�.�.��A��"8�8���A��#9�"9�9��%�6�6��A��"7�7���A��#8�"8�8��%�6�6��A��":�:���A��#;�";�;��%�5�5�A�!$�^�%C�%C�d�%J�!K��A��%�5�5�A�!$�^�%C�%C�d�%J�!K��A���C��F����D�G�G�Z��5���
K� �!?�!F�!F�q�!I�J�J��
K�s�EE�	F�'F�FN)r#r$r%r&rrrr'rrr/r/_s�� 
�
�X� 
��X� 
�
�X� 
�
�X�	 
�

�X� 
�
�X�
 
�
�X� 
�
�X� 
�
�X� 
�
�X� 
�
�X� 
�
�X� 
�
�X� 
�
�X� 
�
�X� 
� 
�X�! 
�"
�X�# 
�$��������������? 
��D	v�$	`� 	Krr/�cygwinc�(�eZdZddddddddd	d
dd�Zy
)r/rArBrCrDrErFrGrHrIrJrK)i�i�rLrMrNrOrPrQrRrSrTN)r#r$r%r&r'rrr/r/�s+�������������
�rr7�darwinlTc��eZdZej�djd�ZdZdZe	ed�dk\rd�Z
d�Zy	)
r/r+�.�{t �zt rr9c�~�tjd|g�}tj|jt|d�y)NrVr*)rXrrr�IOSSIOSPEED)rrr_s   rrz&PlatformSpecific._set_special_baudrate�s*���k�k�#��z�2�����D�G�G�[�#�q�9rc���|jr/tj|jtj
�ytj|jtj�y�z[            Set break: Controls TXD. When active, no transmitting is possible.
            N�rrrrr/rr r!s rr"z$PlatformSpecific._update_break_state��?��� � ����D�G�G�%5�%>�%>�?����D�G�G�%5�%>�%>�?rN)r#r$r%�os�uname�split�osx_versionrr rrrr"r'rrr/r/�sF���b�h�h�j��m�)�)�#�.�������{�1�~��!�#�
:�
	@rr3�bsdr8�freebsd�netbsd�openbsdc��eZdZd�Zy)�ReturnBaudratec��|S)Nr')r�keys  r�__getitem__zReturnBaudrate.__getitem__�s���JrN)r#r$r%r�r'rrr�r��s��	rr�c�(�eZdZe�ZdZdZd�Zy)r/rzr{c���|jr/tj|jtj
�ytj|jtj�yrr�r!s rr"z$PlatformSpecific._update_break_state�r�rN)r#r$r%r�r&rr r"r'rrr/r/�s��,�-������	@rc��eZdZy)r/N)r#r$r%r'rrr/r/	s��r�TIOCMGETiT�TIOCMBISiT�TIOCMBICiT�TIOCMSETiT�	TIOCM_DTR�	TIOCM_RTS�	TIOCM_CTSrW�	TIOCM_CARrb�	TIOCM_RNG��	TIOCM_DSR��TIOCM_CD�TIOCM_RI�TIOCINQ�FIONREADiT�TIOCOUTQiT�Iri'Tr i(Tc���eZdZdZd�Zdd�Zd�Zed��Zdd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zdd�Zd�Zd�Zed��Zed��Zed��Zed��Zed��Zd�Zdd�Zdd�Zd�Zy)�Serialz�    Serial port class POSIX implementation. Serial port configuration is
    done with termios and fcntl. Runs on Linux and many other Un*x like
    systems.
    c���|j�td��|jrtd��d|_	t	j
|jtjtjztjz�|_d\|_
|_d\|_|_	|j#d��	|j$s|j'�|j(s|j+�|j3�t	j4�\|_
|_t	j4�\|_|_t7j6|jt6j8tj�t7j6|jt6j8tj�d|_y#t$r<}d|_t|jdj|j|���d}~wwxYw#t,$r8}|jtj.tj0fvr�Yd}~��Xd}~wwxYw#t:$�r	t	j<|j�n#t>$rYnwxYwd|_|j�&t	j<|j�d|_|j�&t	j<|j�d|_
|j �&t	j<|j �d|_|j�&t	j<|j�d|_�wxYw)zo        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.zPort is already open.zcould not open port {}: {}�NNT)�force_update) �_portr�is_openrr��open�portstr�O_RDWR�O_NOCTTY�
O_NONBLOCK�OSError�errnor^�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_stater\�EINVAL�ENOTTY�_reset_input_buffer�piper�F_SETFL�
BaseException�close�	Exception)r�msgr`s   rr�zSerial.open7s����:�:��!�"R�S�S��<�<�!�"9�:�:����	c��g�g�d�l�l�B�I�I����,C�b�m�m�,S�T�D�G�:D�6���� 6�;E�8����!8�)	��"�"��"�5�
��|�|��*�*�,��|�|��*�*�,�
�$�$�&�=?�W�W�Y�:�D�"�D�$:�?A�w�w�y�<�D�#�T�%<��K�K��.�.��
�
�r�}�}�M��K�K��/�/�����
�
�N�2����g�	c��D�G�!�#�)�)�-I�-P�-P�QU�Q[�Q[�]`�-a�b�b��	c�� �
��7�7�5�<�<����">�>��?��
���	�
�������!���
��
���D�G��%�%�1�����/�/�0�)-��&��%�%�1�����/�/�0�)-��&��&�&�2�����0�0�1�*.��'��&�&�2�����0�0�1�*.��'��-	�st�AG
�+I�>8H�6CI�
	H�7H
�
H�	I�-I�I�I�I�
M!�!J�M!�	J
�
M!�J
�
CM!c��|j�td��|j�{|jrA	tj|jtj
tjz�n.tj|jtj�d}dx}}|j�d}t|jdz�}	tj|j�}|\}}}	}
}}}
|	tj"tj$zz}	|
tj&tj(ztj*ztj,ztj.ztj0ztj2zz}
dD]'}t5t|�s�|
t7t|�z}
�)|tj8tj:ztj<zz}|tj>tj@ztjBztjDzz}t5td	�r|tjFz}t5td
�r|tjHz}	t7tdj|jJ��x}}|	tjXz}	|jZdk(r|	tj\z}	n�|jZdk(r|	tj^z}	nj|jZdk(r|	tj`z}	nG|jZdk(r|	tjbz}	n$tWdj|jZ���|jdtfjhk(r|	tjjz}	n�|jdtfjlk(r|	tjjz}	nU|jdtfjnk(r|	tjjz}	n$tWdj|jd���|tjptjrzz}|jttfjvk(r.|	tjxtjzzt|zz}	�n^|jttfj~k(r0|	tjzt|zz}	|	tjxz}	�n|jttfj�k(r/|	t|z}	|	tjxtjzzz}	n�|jttfj�k(r2t|r,|	tjxt|ztjzzz}	nv|jttfj�k(r5t|r/|	tjxt|zz}	|	tjzz}	n$tWdj|jt���t5td�rh|j�r%|tj�tj�zz}n�|tj�tj�ztj�zz}nV|j�r%|tj�tj�zz}n%|tj�tj�zz}t5td�r5|j�r|	tj�z}	nY|	tj�z}	nDt5td�r4|j�r|	tj�z}	n|	tj�z}	|dks|dkDrtWdj|���||
tj�<|dks|dkDrtWdj|���||
tj�<|s|||	|
|||
g|k7r6tj�|jtj�|||	|
|||
g�|�|j�|�|j��|j�|j��yy#t$r5}t|jdj|j|���d}~wwxYw#tj $r}tdj|���d}~wwxYw#tL$r�	|jN|jJx}}n�#tP$r�	tRx}}n!#tT$rt7td�x}}YnwxYw	t|jJ�}|dkrUtWd
j|jJ���#tV$r%tWd
j|jJ���wxYwYnwxYwY���wxYw)�,Set communication parameters on opened port.Nz+Can only operate on a valid file descriptorz&Could not exclusively lock port {}: {}rr*r;�Could not configure port: {})�ECHOCTL�ECHOKE�IUCLC�PARMRKzB{}�B38400zInvalid baud rate: {!r}r9r8r7r(zInvalid char len: {!r}z$Invalid stop bit specification: {!r}zInvalid parity: {!r}�IXANY�CRTSCTS�CNEW_RTSCTS�zInvalid vmin: {!r}�Invalid vtime: {!r})Qrr�
_exclusiver�flock�LOCK_EX�LOCK_NBr\r�r^r��LOCK_UN�_inter_byte_timeoutrrrY�	tcgetattr�error�CLOCAL�CREAD�ICANON�ECHO�ECHOE�ECHOK�ECHONL�ISIG�IEXTEN�hasattr�getattr�OPOST�ONLCR�OCRNL�INLCR�IGNCR�ICRNL�IGNBRKr�r��	_baudrate�AttributeErrorr&�KeyErrorre�	NameErrorr]�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)rr�r��custom_baud�vmin�vtime�	orig_attr�iflag�oflag�cflag�lflag�ispeed�ospeed�cc�flags               rr�zSerial._reconfigure_portxsy���7�7�?�!�"O�P�P��?�?�&����w��K�K����������)F�G����D�G�G�U�]�]�3������u��#�#�/��D���0�0�2�5�6�E�	N��)�)�$�'�'�2�I�=F�:�E�5�%�����	�'�.�.�7�=�=�0�1��
�7�>�>�G�L�L�0�7�=�=�@��=�=�!�#*�>�>�2��<�<� �")�.�.�1�2�	2��*�	1�D��w��%��'�'�4�0�0�0��	1�	�7�=�=�7�=�=�0�7�=�=�@�A�A��
�7�=�=�7�=�=�0�7�=�=�@�7�>�>�Q�R�R���7�G�$��g�m�m�^�#�E��7�H�%��g�n�n�_�$�E�	[�%�g�u�|�|�D�N�N�/K�L�L�F�V�0	�'�-�-�����>�>�Q���W�[�[� �E�
�^�^�q�
 ��W�[�[� �E�
�^�^�q�
 ��W�[�[� �E�
�^�^�q�
 ��W�[�[� �E��5�<�<�T�^�^�L�M�M��>�>�V�0�0�0��w�~�~�&�&�E�
�^�^�v�=�=�
=��g�n�n�%�E�
�^�^�v�2�2�
2��g�n�n�%�E��C�J�J�4�>�>�Z�[�[�
�7�=�=�7�>�>�1�2�2���<�<�6�-�-�-��w�~�~����6��?�@�@�E�
�\�\�V�/�/�
/��w�~�~��.�/�/�E��g�n�n�%�E�
�\�\�V�.�.�
.��f�W��E��g�n�n�w�~�~�5�6�E�
�\�\�V�/�/�
/�F��g�n�n�v�-����>�?�E�
�\�\�V�0�0�
0�V��g�n�n�v�-�.�E��w�~�~�&�&�E��3�:�:�4�<�<�H�I�I��7�G�$��}�}��'�,�,����6�7���7�<�<�'�-�-�7�'�-�-�G�H�H���}�}��'�,�,����6�7���7�<�<�'�-�-�7�8�8���7�I�&��|�|��'�/�/�*���7�?�?�+�+��
�W�m�
,��|�|��'�-�-�.���7�.�.�/�/��
�!�8�t�c�z��1�8�8��>�?�?���7�<�<���1�9�����2�9�9�%�@�A�A�!��7�=�=���E�5�%�����K�y�X������������u�e�V�V�R�@�
B��"��&�&�{�3����'�� � ��!1�!1�2�(��Y�w�)�#�)�)�5]�5d�5d�ei�eo�eo�qt�5u�v�v��w���}�}�	N�!�"@�"G�"G��"L�M�M��	N��*�	[�
[�"&�"9�"9�$�.�.�"I�I�����
[�
A�&,�,�F�V�� �A�&-�g�x�&@�@�F�V�A��[�"%�d�n�n�"5�K�#�Q��(�)B�)I�)I�$�.�.�)Y�Z�Z��	"�W�$�%>�%E�%E�d�n�n�%U�V�V�W��'�!
[��	[�s��?`?�)b�+b5�?	a=�0a8�8a=�b2�b-�-b2�5	f	�?c�f	�	f�%c.�-f�.d�	f�d�f�e�%)f�.e<�<f�?f	�f�f	�f	c���|jr�|j��tj|j�d|_tj|j�tj|j
�tj|j�tj|j�d\|_|_d\|_|_d|_yy)z
Close portNr�F)r�rr�r�r�r�r�r�r!s rr�zSerial.closes����<�<��w�w�"�������!��������/�/�0�����/�/�0�����0�0�1�����0�0�1�AK�>��&��(>�CM�@��'��)@� �D�L�rc��tj|jtt�}tjd|�dS)z9Return the number of bytes currently in the input buffer.r�r)rrrr��TIOCM_zero_str�struct�unpack�r�ss  r�
in_waitingzSerial.in_waiting!s0��
�K�K�����.�9���}�}�S�!�$�Q�'�'rc��|js
t��t�}t|j�}t|�|kr�	t
j|j|jggg|j��\}}}|j|vr,tj|jd�	t1|�S|s	t1|�Stj|j|t|�z
�}|std��|j|�|j/�r	t1|�St|�|kr��t1|�S#t$r}}|jtj tj"tj$tj&tj(fvrtdj+|���Yd}~��d}~wtj,$rw}|dtj tj"tj$tj&tj(fvrtdj+|���Yd}~��?d}~wwxYw)��        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.
        rhzgdevice reports readiness to read but returned no data (device disconnected or multiple access on port?)zread failed: {}Nr)r�r�	bytearrayr	�_timeout�len�selectrr��	time_leftr��readr�extendr�r��EAGAIN�EALREADY�EWOULDBLOCK�EINPROGRESS�EINTRr^r��expired�bytes)r�sizer)�timeout�ready�_r_r`s        rr)zSerial.read)s����|�|�"�$�$��{���$�-�-�(���$�i�$��"
!�$�m�m�T�W�W�d�6L�6L�,M�r�SU�W^�Wh�Wh�Wj�k���q�!��)�)�U�2��G�G�D�2�2�D�9��D�T�{��;��8�T�{��7�g�g�d�g�g�t�c�$�i�'7�8�� �*�L�M�M����C� ���� ���T�{��O�$�i�$��N�T�{���5�
G��7�7�5�<�<�����AR�AR�TY�Te�Te�gl�gr�gr�"s�s�)�*;�*B�*B�1�*E�F�F�t���<�<�
G��Q�4����e�n�n�e�>O�>O�QV�Qb�Qb�di�do�do�p�p�)�*;�*B�*B�1�*E�F�F�q��	
G�s3�A.E
�?E
�
,E
�
	I�A3G�I�$A,I�Ic�^�|jr!tj|jd�yy�N�x)r�r��writer�r!s r�cancel_readzSerial.cancel_read\s"���<�<��H�H�T�+�+�T�2�rc�^�|jr!tj|jd�yyr7)r�r�r9r�r!s r�cancel_writezSerial.cancel_write`s"���<�<��H�H�T�,�,�d�3�rc���|js
t��t|�}t|�x}}t	|j
�}|dkD�rr	t
j|j|�}|jr|S|js�|j�rtd��tj|jg|jgg|j��\}}}	|r!t
j |jd�n�|std��|j��J�tj|jg|jggd�\}}}	|r!t
j |jd�nE|st#d��||d}||z}|js|j�rtd��|dkDr��r|t|�z
S#t"$r�t$$r}}
|
j&t&j(t&j*t&j,t&j.t&j0fvrt#dj3|
���Yd}
~
��d}
~
wtj4$rw}
|
dt&j(t&j*t&j,t&j.t&j0fvrt#dj3|
���Yd}
~
��Nd}
~
wwxYw)z2Output the given byte string over the serial port.rz
Write timeoutrhNr*zwrite failed (select)zwrite failed: {})r�rrr&r	�_write_timeoutr�r9r�is_non_blocking�is_infiniter0rr'r�r(r)rr�r�r+r,r-r.r/r^r�)r�data�d�tx_len�lengthr3�n�abortr4r5r`s           rr9zSerial.writedst���|�|�"�$�$��T�N���a�&� ����$�-�-�.���q�j�)
H��H�H�T�W�W�a�(���*�*��H� �,�,����(�4�_�E�E�&,�m�m�T�5L�5L�4M�PT�PW�PW�y�Z\�^e�^o�^o�^q�&r�O�E�5�!������ 7� 7��>�� �4�_�E�E�"�,�,�.�6�6�6�&,�m�m�T�5L�5L�4M�PT�PW�PW�y�Z\�^b�&c�O�E�5�!������ 7� 7��;�� �-�.E�F�F��a�b�E���!����*�*�w���/@�,�_�=�=�Y�q�j�Z��A�����!#�
���
H��7�7�5�<�<�����AR�AR�TY�Te�Te�gl�gr�gr�"s�s�)�*<�*C�*C�A�*F�G�G�t���<�<�
H��Q�4����e�n�n�e�>O�>O�QV�Qb�Qb�di�do�do�p�p�)�*<�*C�*C�A�*F�G�G�q��	
H�s:�-G
�9B	G
�A3G
�7G
�
K!�A3I�K!�*A,K�K!c�n�|js
t��tj|j�y)zb        Flush of file like objects. In this case, wait until all data
        is written.
        N)r�rrY�tcdrainrr!s r�flushzSerial.flush�s$��
�|�|�"�$�$������� rc�`�tj|jtj�y�z9Clear input buffer, discarding all that is in the buffer.N)rY�tcflushr�TCIFLUSHr!s rr�zSerial._reset_input_buffer�s���������!1�!1�2rc�P�|js
t��|j�yrK)r�rr�r!s r�reset_input_bufferzSerial.reset_input_buffer�s���|�|�"�$�$�� � �"rc��|js
t��tj|jtj
�y)zs        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        N)r�rrYrLr�TCOFLUSHr!s r�reset_output_bufferzSerial.reset_output_buffer�s,��
�|�|�"�$�$��������!1�!1�2rc��|js
t��tj|jt|dz��y)za        Send break condition. Timed, returns to idle state after given
        duration.
        ��?N)r�rrY�tcsendbreakrrr)r�durations  r�
send_breakzSerial.send_break�s1��
�|�|�"�$�$����D�G�G�S��D��%9�:rc���|jr*tj|jtt
�ytj|jtt
�y)z)Set terminal status line: Request To SendN)�
_rts_staterrrr��
TIOCM_RTS_strr�r!s rr�zSerial._update_rts_state��1���?�?��K�K�����=�9��K�K�����=�9rc���|jr*tj|jtt
�ytj|jtt
�y)z-Set terminal status line: Data Terminal ReadyN)�
_dtr_staterrrr��
TIOCM_DTR_strr�r!s rr�zSerial._update_dtr_state�r[rc���|js
t��tj|jt
t�}tjd|�dtzdk7S)z(Read terminal status line: Clear To Sendr�r)
r�rrrrr�rrrr�rs  r�ctsz
Serial.cts��J���|�|�"�$�$��K�K�����>�:���}�}�S�!�$�Q�'�)�3�q�8�8rc���|js
t��tj|jt
t�}tjd|�dtzdk7S)z)Read terminal status line: Data Set Readyr�r)
r�rrrrr�rrrr�rs  r�dsrz
Serial.dsr�rarc���|js
t��tj|jt
t�}tjd|�dtzdk7S)z)Read terminal status line: Ring Indicatorr�r)
r�rrrrr�rrrr�rs  r�riz	Serial.ri��J���|�|�"�$�$��K�K�����>�:���}�}�S�!�$�Q�'�(�2�a�7�7rc���|js
t��tj|jt
t�}tjd|�dtzdk7S)z)Read terminal status line: Carrier Detectr�r)
r�rrrrr�rrrr�rs  r�cdz	Serial.cd�rfrc��tj|jtt�}tjd|�dS)z:Return the number of bytes currently in the output buffer.r�r)rrrr�rrrrs  r�out_waitingzSerial.out_waiting�s0��
�K�K�����>�:���}�}�S�!�$�Q�'�'rc�F�|js
t��|jS)z�        For easier use of the serial port instance with select.
        WARNING: this function is not portable to different platforms!
        )r�rrr!s r�filenoz
Serial.fileno�s��
�|�|�"�$�$��w�w�rc���|js
t��|r/tj|jtj
�ytj|jtj�y)z�        Manually 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�rrY�tcflowr�TCION�TCIOFF�r�enables  r�set_input_flow_controlzSerial.set_input_flow_control��C���|�|�"�$�$���N�N�4�7�7�G�M�M�2��N�N�4�7�7�G�N�N�3rc���|js
t��|r/tj|jtj
�ytj|jtj�y)z�        Manually control flow of outgoing data - when hardware or software flow
        control is enabled.
        WARNING: this function is not portable to different platforms!
        N)r�rrYrnr�TCOON�TCOOFFrqs  r�set_output_flow_controlzSerial.set_output_flow_controlrtrc�8�ddl}|jdt�y)zDEPRECATED - has no userNz0nonblocking() has no effect, already nonblocking)�warnings�warn�DeprecationWarning)rrzs  r�nonblockingzSerial.nonblockings����
�
�H�J\�]rN)F�r*)rT�T)r#r$r%�__doc__r�r�r��propertyr!r)r:r<r9rIr�rOrRrWr�r�r`rcrerhrjrlrsrxr}r'rrr�r�0s����?�BW3�r!� �(��(�1�f3�4�4�l!�3�#�3�;�:�:��9��9��9��9��8��8��8��8��(��(��4�4�^rr�c��eZdZdZdd�Zy)�PosixPollSerialz�    Poll 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���|js
t��t�}t|j�}tj�}|j|jt
jt
jzt
jzt
jz�|j|jt
jt
jzt
jzt
jz�|dkD�rYt|�|k�rJ|j
|jrdn|j!�dz�D]V\}}||jk(rnB|t
jt
jzt
jzzs�Mt#d��|jk(r,t%j&|jd�	t/|�St%j&|j|t|�z
�}|j)|�|j+�s|j,�|j,dkDr|s	t/|�St|�|kr��Jt/|�S)r#rNrhzdevice reports error (poll))r�rr$r	r%r'�poll�registerr�POLLIN�POLLERR�POLLHUP�POLLNVALr�r&r@r(rr�r)r*r0r�r1)rr2r)r3r�r�eventr_s        rr)zPosixPollSerial.read&s����|�|�"�$�$��{���$�-�-�(���{�{�}���
�
�d�g�g�v�}�}�v�~�~�=����N�QW�Q`�Q`�`�a��
�
�d�,�,�f�m�m�f�n�n�.L�v�~�~�.]�`f�`o�`o�.o�p��!�8��d�)�d�"�"&���7�3F�3F�4�W�M^�M^�M`�cg�Mg�!i�M�I�B���T�3�3�3��������� ?�&�/�/� Q�R�-�.K�L�L�	M���/�/�/��G�G�D�2�2�D�9���T�{���g�g�d�g�g�t�c�$�i�'7�8�����C� ��?�?�$� �4�4�@�T�E]�E]�`a�Ea�kn���T�{��%�d�)�d�"�$�T�{�rNr~)r#r$r%r�r)r'rrr�r�s��� rr�c�:��eZdZdZd�fd�	Zdd�Ze�Z�xZS)�VTIMESerialab    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���tt|��tj|jtj
d�|j�d}t|jdz�}n+|j�d}d}nd}t|jdz�}	tj|j�}|\}}}}}	}
}|dks|dkDrtdj|���||tj <||tj"<tj$|jtj&|||||	|
|g�y#tj$r)}tjdj|���d}~wwxYw)r�rNr*r;r�r�r�)�superr�r�rrr�r�rrr%rYr�r�r�rr^r]r
r	rr)rr�rrrrrrrrrrr��	__class__s             �rr�zVTIMESerial._reconfigure_portUsN���
�k�4�2�4�
���D�G�G�U�]�]�A�.��#�#�/��D���0�0�2�5�6�E�
�]�]�
"��D��E��D���
�
��*�+�E�	U��)�)�$�'�'�2�I�=F�:�E�5�%������1�9�����2�9�9�%�@�A�A�!��7�=�=����7�<�<�������������u�e�V�V�R�@�	B���}�}�	U��(�(�)G�)N�)N�s�)S�T�T��	U�s�)E�E<�$E7�7E<c�(�|js
t��t�}t|�|krZt	j
|j|t|�z
�}|s	t|�S|j|�t|�|kr�Zt|�S)r#)	r�rr$r&r�r)rr*r1)rr2r)r_s    rr)zVTIMESerial.readss|���|�|�"�$�$��{���$�i�$���'�'�$�'�'�4�#�d�)�#3�4�C����T�{��
�K�K���	�$�i�$��
�T�{�rrr~)	r#r$r%r�r�r)r�r:�
__classcell__)r�s@rr�r�Is���	�B�<�"�*�Krr�)=�
__future__rr�rr�r'r�sysrYr��serial.serialutilrrrrrr	�objectrr�platform�lower�platrXrcrfrerirtrjrnrprlr/r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��packrrZr^rr r�r�r�r'rr�<module>r�s���:'�
��	�
�
�
��
�6�6�+�6�+�0
��
�|�|��������8�w����F��G��G�
�F��J��J�"��&��)��'��_K�/�_K�D
�X��

�/�

� 
�"�1�X�����K�@�/�@�*
�"�1�X���	�"�1�X���	�"�1�X���	�"�1�X������@�/�@�(
�/�
��7�J��/���7�J��/���7�J��/���7�J��/��
�G�[�%�0�	��G�[�%�0�	�
�G�[�%�0�	��G�[�%�0�	��G�[�%�0�	��G�[�%�0�	��7�J�	�2���7�J�	�2���7�I���o�o�G��g�z�6�2�G��7�J��/������S�!�$������C��+�
�����C��+�
��7�J��/���7�J��/��l^�Z�)�l^�^'�f�'�T;�&�;r
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!