HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/usb/__pycache__/control.cpython-39.pyc
a

j��Y#"�@s�dZdZgd�ZddlmZddlmZdd�ZdZdZ	dZ
dZd	Zd
Z
ddd�Zdd
d�Zddd�Zd dd�Zd!dd�Zdd�Zdd�Zdd�Zdd�ZdS)"a�usb.control - USB standard control requests

This module exports:

get_status - get recipeint status
clear_feature - clear a recipient feature
set_feature - set a recipient feature
get_descriptor - get a device descriptor
set_descriptor - set a device descriptor
get_configuration - get a device configuration
set_configuration - set a device configuration
get_interface - get a device interface
set_interface - set a device interface
zWander Lairson Costa)�
get_status�
clear_feature�set_feature�get_descriptor�set_descriptor�get_configuration�set_configuration�
get_interface�
set_interface�
ENDPOINT_HALT�FUNCTION_SUSPEND�DEVICE_REMOTE_WAKEUP�	U1_ENABLE�	U2_ENABLE�
LTM_ENABLE�NcCsh|durtj}d}n<t|tj�r.tj}|j}n"t|tj�rHtj}|j	}nt
d��t�|tj|�}||fS)NrzInvalid recipient.)
�util�CTRL_RECIPIENT_DEVICE�
isinstance�coreZ	Interface�CTRL_RECIPIENT_INTERFACE�bInterfaceNumberZEndpointZCTRL_RECIPIENT_ENDPOINTZbEndpointAddress�
ValueError�build_request_type�CTRL_TYPE_STANDARD)�	recipient�	direction�r�wIndex�
bmRequestType�r�//usr/lib/python3.9/site-packages/usb/control.py�_parse_recipientAs �r!��0�1�2cCs6t|tj�\}}|j|d|dd�}|d|dd>BS)aeReturn the status for the specified recipient.

    dev is the Device object to which the request will be
    sent to.

    The recipient can be None (on which the status will be queried
    from the device), an Interface or Endpoint descriptors.

    The status value is returned as an integer with the lower
    word being the two bytes status value.
    r��r�bRequestr�data_or_wLengthr"�)r!r�CTRL_IN�
ctrl_transfer)�devrrr�retrrr r\s�rcCs:|tkr|�|�n"t|tj�\}}|j|d||d�dS)aClear/disable a specific feature.

    dev is the Device object to which the request will be
    sent to.

    feature is the feature you want to disable.

    The recipient can be None (on which the status will be queried
    from the device), an Interface or Endpoint descriptors.
    r"�rr(r�wValueN)r
Z
clear_haltr!r�CTRL_OUTr,�r-Zfeaturerrrrrr ros�rcCs&t|tj�\}}|j|d||d�dS)aSet/enable a specific feature.

    dev is the Device object to which the request will be
    sent to.

    feature is the feature you want to enable.

    The recipient can be None (on which the status will be queried
    from the device), an Interface or Endpoint descriptors.
    �r/N)r!rr1r,r2rrr r�s�rcCs4||d>B}t�tjtjtj�}|j|d|||d�S)agReturn the specified descriptor.

    dev is the Device object to which the request will be
    sent to.

    desc_size is the descriptor size.

    desc_type and desc_index are the descriptor type and index,
    respectively. wIndex index is used for string descriptors
    and represents the Language ID. For other types of descriptors,
    it is zero.
    r*��rr(r0rr)�rrr+rrr,)r-Z	desc_size�	desc_type�
desc_indexrr0rrrr r�s
��rcCs8||d>B}t�tjtjtj�}|j|d|||d�dS)a�Update an existing descriptor or add a new one.

    dev is the Device object to which the request will be
    sent to.

    The desc parameter is the descriptor to be sent to the device.
    desc_type and desc_index are the descriptor type and index,
    respectively. wIndex index is used for string descriptors
    and represents the Language ID. For other types of descriptors,
    it is zero.
    r*�r5N)rrr1rrr,)r-Zdescr7r8rr0rrrr r�s��rcCs(t�tjtjtj�}|j|ddd�dS)a,Get the current active configuration of the device.

    dev is the Device object to which the request will be
    sent to.

    This function differs from the Device.get_active_configuration
    method because the later may use cached data, while this
    function always does a device request.
    r*r")r(r)rr6)r-rrrr r�s
���rcCs|�|�dS)zrSet the current device configuration.

    dev is the Device object to which the request will be
    sent to.
    N)r)r-ZbConfigurationNumberrrr r�srcCs*t�tjtjtj�}|j|d|dd�dS)z�Get the current alternate setting of the interface.

    dev is the Device object to which the request will be
    sent to.
    �
r"r'r)rrr+rrr,)r-rrrrr r�s���rcCs|�||�dS)zxSet the alternate setting of the interface.

    dev is the Device object to which the request will be
    sent to.
    N)Zset_interface_altsetting)r-rZbAlternateSettingrrr r	�sr	)N)N)N)r)N)�__doc__�
__author__�__all__Zusb.utilrZusb.corerr!r
rrr
rrrrrrrrrrr	rrrr �<module>s(