
    
                     4    S r  " S S\5      r " S S\5      rg)zImplement base classes for hid package.

This module provides the base classes implemented by the
platform-specific modules.  It includes a base class for
all implementations built on interacting with file-like objects.
c                   F    \ rS rSrSr\S 5       rS rS rS r	S r
S rS	rg
)	HidDevice   z/Base class for all HID devices in this package.c                      g)a4  Enumerates all the hid devices.

This function enumerates all the hid device and provides metadata
for helping the client select one.

Returns:
  A list of dictionaries of metadata.  Each implementation is required
  to provide at least: vendor_id, product_id, product_string, usage,
  usage_page, and path.
N r       )platform/bq/third_party/pyu2f/hid/base.py	EnumerateHidDevice.Enumerate   s     	r   c                     g)zInitialize the device at path.Nr   )selfpaths     r   __init__HidDevice.__init__)   s    r   c                     g)zReturns the max input report data length in bytes.

Returns the max input report data length in bytes.  This excludes the
report id.
Nr   r   s    r   GetInReportDataLengthHidDevice.GetInReportDataLength-        	r   c                     g)zReturns the max output report data length in bytes.

Returns the max output report data length in bytes.  This excludes the
report id.
Nr   r   s    r   GetOutReportDataLength HidDevice.GetOutReportDataLength5   r   r   c                     g)zWrites packet to device.

Writes the packet to the device.

Args:
  packet: An array of integers to write to the device.  Excludes the report
  ID. Must be equal to GetOutReportLength().
Nr   )r   packets     r   WriteHidDevice.Write=        	r   c                     g)zReads packet from device.

Reads the packet from the device.

Returns:
  An array of integers read from the device.  Excludes the report ID.
  The length is equal to GetInReportDataLength().
Nr   r   s    r   ReadHidDevice.ReadH   r   r   r   N)__name__
__module____qualname____firstlineno____doc__staticmethodr	   r   r   r   r   r   __static_attributes__r   r   r   r   r      s0    7	 								r   r   c                   >    \ rS rSrSrSrSrSrSrSr	Sr
SrSrS rSrg)DeviceDescriptorT   z.Descriptor for basic attributes of the device.N    c                     0 n[        U R                  R                  5       5       H!  u  p#UR                  S5      (       a  M  X1U'   M#     U$ )N	internal_)list__dict__items
startswith)r   outkvs       r   ToPublicDictDeviceDescriptor.ToPublicDicta   sB    
CT]]((*+\\+&&A , Jr   r   )r    r!   r"   r#   r$   
usage_pageusage	vendor_id
product_idproduct_stringr   internal_max_in_report_leninternal_max_out_report_lenr4   r&   r   r   r   r(   r(   T   s4    6*
%)*.	$  !r   r(   N)r$   objectr   r(   r   r   r   <module>r>      s#    9	 9	xv r   