PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  7Tc@sAdZdZddddgZdZdefdYZdS( s?usb.backend - Backend interface. This module exports: IBackend - backend interface. Backends are Python objects which implement the IBackend interface. The easiest way to do so is inherinting from IBackend. PyUSB already provides backends for libusb versions 0.1 and 1.0, and OpenUSB library. Backends modules included with PyUSB are required to export the get_backend() function, which returns an instance of a backend object. You can provide your own customized backend if you want to. Bellow you find a skeleton of a backend implementation module: import usb.backend class MyBackend(usb.backend.IBackend): pass def get_backend(): return MyBackend() You can use your customized backend by passing it as the backend parameter of the usb.core.find() function. For example: import custom_backend import usb.core myidVendor = 0xfffe myidProduct = 0x0001 mybackend = custom_backend.get_backend() dev = usb.core.find(backend = mybackend, idProduct=myidProduct, idVendor=myidVendor) For custom backends, you are not required to supply the get_backend() function, since the application code will instantiate the backend. If you do not provide a backend to the find() function, it will use one of the defaults backend according to its internal rules. For details, consult the find() function documentation. sWander Lairson CostatIBackendtlibusb01tlibusb10topenusbcCst|jdS(N(tNotImplementedErrort__name__(tfunc((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyt_not_implementedNscBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZRS(sBackend interface. IBackend is the basic interface for backend implementations. By default, the methods of the interface raise a NotImplementedError exception. A backend implementation should replace the methods to provide the funcionality necessary. As Python is a dynamic typed language, you are not obligated to inherit from IBackend: everything that bahaves like an IBackend is an IBackend. But you are strongly recommended to do so, inheriting from IBackend provides consistent default behavior. cCst|jdS(sThis function is required to return an iterable object which yields an implementation defined device identification for each USB device found in the system. The device identification object is used as argument to other methods of the interface. N(Rtenumerate_devices(tself((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR^scCst|jdS(skReturn the device descriptor of the given device. The object returned is required to have all the Device Descriptor fields accessible as member variables. They must be convertible (but not required to be equal) to the int type. dev is an object yielded by the iterator returned by the enumerate_devices() method. N(Rtget_device_descriptor(R tdev((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR hs cCst|jdS(sWReturn a configuration descriptor of the given device. The object returned is required to have all the Configuration Descriptor fields acessible as member variables. They must be convertible (but not required to be equal) to the int type. The dev parameter is the already described device identification object. config is the logical index of the configuration (not the bConfigurationValue field). By "logical index" we mean the relative order of the configurations returned by the peripheral as a result of GET_DESCRIPTOR request. N(Rtget_configuration_descriptor(R R tconfig((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR ts cCst|jdS(sReturn an interface descriptor of the given device. The object returned is required to have all the Interface Descriptor fields accessible as member variables. They must be convertible (but not required to be equal) to the int type. The dev parameter is the already described device identification object. The intf parameter is the interface logical index (not the bInterfaceNumber field) and alt is the alternate setting logical index (not the bAlternateSetting value). Not every interface has more than one alternate setting. In this case, the alt parameter should be zero. config is the configuration logical index (not the bConfigurationValue field). N(Rtget_interface_descriptor(R R tintftaltR ((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRscCst|jdS(sReturn an endpoint descriptor of the given device. The object returned is required to have all the Endpoint Descriptor fields acessible as member variables. They must be convertible (but not required to be equal) to the int type. The ep parameter is the endpoint logical index (not the bEndpointAddress field) of the endpoint descriptor desired. intf, alt and config are the same values already described in the get_interface_descriptor() method. N(Rtget_endpoint_descriptor(R R tepRRR ((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRs cCst|jdS(sOpen the device for data exchange. This method opens the device identified by the dev parameter for communication. This method must be called before calling any communication related method, such as transfer methods. It returns a handle identifying the communication instance. This handle must be passed to the communication methods. N(Rt open_device(R R ((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRs cCst|jdS(sClose the device handle. This method closes the device communication channel and releases any system resources related to it. N(Rt close_device(R t dev_handle((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRscCst|jdS(sNSet the active device configuration. This method should be called to set the active configuration of the device. The dev_handle parameter is the value returned by the open_device() method and the config_value parameter is the bConfigurationValue field of the related configuration descriptor. N(Rtset_configuration(R Rt config_value((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRscCst|jdS(sjGet the current active device configuration. This method returns the bConfigurationValue of the currently active configuration. Depending on the backend and the OS, either a cached value may be returned or a control request may be issued. The dev_handle parameter is the value returned by the open_device method. N(Rtget_configuration(R R((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRs cCst|jdS(s]Set the interface alternate setting. This method should only be called when the interface has more than one alternate setting. The dev_handle is the value returned by the open_device() method. intf and altsetting are respectivelly the bInterfaceNumber and bAlternateSetting fields of the related interface. N(Rtset_interface_altsetting(R RRt altsetting((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRscCst|jdS(sClaim the given interface. Interface claiming is not related to USB spec itself, but it is generally an necessary call of the USB libraries. It requests exclusive access to the interface on the system. This method must be called before using one of the transfer methods. dev_handle is the value returned by the open_device() method and intf is the bInterfaceNumber field of the desired interface. N(Rtclaim_interface(R RR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRs cCst|jdS(sRelease the claimed interface. dev_handle and intf are the same parameters of the claim_interface method. N(Rtrelease_interface(R RR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRscCst|jdS(sPerform a bulk write. dev_handle is the value returned by the open_device() method. The ep parameter is the bEndpointAddress field whose endpoint the data will be sent to. intf is the bInterfaceNumber field of the interface containing the endpoint. The data parameter is the data to be sent. It must be an instance of the array.array class. The timeout parameter specifies a time limit to the operation in miliseconds. The method returns the number of bytes written. N(Rt bulk_write(R RRRtdatattimeout((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRs cCst|jdS(sPerform a bulk read. dev_handle is the value returned by the open_device() method. The ep parameter is the bEndpointAddress field whose endpoint the data will be received from. intf is the bInterfaceNumber field of the interface containing the endpoint. The size parameter is the number of bytes to be read. The timeout parameter specifies a time limit to the operation in miliseconds. The method returns an array.array object containing the data read. N(Rt bulk_read(R RRRtsizeR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR s cCst|jdS(s#Perform an interrupt write. dev_handle is the value returned by the open_device() method. The ep parameter is the bEndpointAddress field whose endpoint the data will be sent to. intf is the bInterfaceNumber field of the interface containing the endpoint. The data parameter is the data to be sent. It must be an instance of the array.array class. The timeout parameter specifies a time limit to the operation in miliseconds. The method returns the number of bytes written. N(Rt intr_write(R RRRRR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR"s cCst|jdS(s Perform an interrut read. dev_handle is the value returned by the open_device() method. The ep parameter is the bEndpointAddress field whose endpoint the data will be received from. intf is the bInterfaceNumber field of the interface containing the endpoint. The size parameter is the number of bytes to be read. The timeout parameter specifies a time limit to the operation in miliseconds. The method returns an array.array object containing the data read. N(Rt intr_read(R RRRR!R((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR#s cCst|jdS(s$Perform an isochronous write. dev_handle is the value returned by the open_device() method. The ep parameter is the bEndpointAddress field whose endpoint the data will be sent to. intf is the bInterfaceNumber field of the interface containing the endpoint. The data parameter is the data to be sent.It must be an instance of the array.array class. The timeout parameter specifies a time limit to the operation in miliseconds. The method returns the number of bytes written. N(Rt iso_write(R RRRRR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR$!s cCst|jdS(sPerform an isochronous read. dev_handle is the value returned by the open_device() method. The ep parameter is the bEndpointAddress field whose endpoint the data will be received from. intf is the bInterfaceNumber field of the interface containing the endpoint. The size parameter is the number of bytes to be read. The timeout parameter specifies a time limit to the operation in miliseconds. The method returns an array.array object containing the data read. N(Rtiso_read(R RRRR!R((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR%0s cCst|jdS(sIPerform a control transfer on the endpoint 0. The direction of the transfer is inferred from the bmRequestType field of the setup packet. dev_handle is the value returned by the open_device() method. bmRequestType, bRequest, wValue and wIndex are the same fields of the setup packet. data_or_wLength is either the payload to be sent to the device, if any, as an array.array object (None there is no payload) for OUT requests in the data stage or the wLength field specifying the number of bytes to read for IN requests in the data stage. The timeout parameter specifies a time limit to the operation in miliseconds. Return the number of bytes written (for OUT transfers) or the data read (for IN transfers), as an array.array object. N(Rt ctrl_transfer(R Rt bmRequestTypetbRequesttwValuetwIndextdata_or_wLengthR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR&>scCst|jdS(sReset the device.N(Rt reset_device(R R((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR,YscCst|jdS(sDetermine if a kernel driver is active on an interface. If a kernel driver is active, you cannot claim the interface, and the backend will be unable to perform I/O. N(Rtis_kernel_driver_active(R RR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR-]scCst|jdS(sDetach a kernel driver from an interface. If successful, you will then be able to claim the interface and perform I/O. N(Rtdetach_kernel_driver(R RR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR.escCst|jdS(skRe-attach an interface's kernel driver, which was previously detached using detach_kernel_driver().N(Rtattach_kernel_driver(R RR((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyR/ms(Rt __module__t__doc__RR R RRRRRRRRRRR R"R#R$R%R&R,R-R.R/(((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pyRQs0               N(R1t __author__t__all__RtobjectR(((s8/usr/lib/python2.7/site-packages/usb/backend/__init__.pytHs