#NEWLINE# def __read( self , fn , dev_handle , ep , intf , buff , timeout ) : #NEWLINE# #INDENT# ( address , length ) = buff . buffer_info ( ) #NEWLINE# length *= buff . itemsize #NEWLINE# transferred = c_int ( ) #NEWLINE# retval = fn ( intf . handle , ep , cast ( address , POINTER ( c_ubyte ) ) , length , byref ( transferred ) , timeout ) #NEWLINE# if ( not ( transferred . value and ( retval == LIBUSB_ERROR_TIMEOUT ) ) ) : #NEWLINE# #INDENT# _check ( retval ) #NEWLINE# #UNINDENT# return transferred . value