Lines Matching refs:self
69 def __init__(self, data_phase_type): argument
70 self.data_phase_type = data_phase_type
85 def __init__(self, device, subdevice): argument
86 self._device_class = device
87 self._subdevice_class = subdevice
89 def __call__(self, device): argument
92 cfg, bInterfaceClass=self._device_class,
93 bInterfaceSubClass=self._subdevice_class)
117 def __init__(self, ep_in, ep_out): argument
118 self._ep_in = ep_in
119 self._ep_out = ep_out
121 def __read_response(self, timeout=None): argument
126 … resp = self._ep_in.read(CommandDispatcher.response_struct_len, timeout=timeout).tostring()
128 resp = self._ep_in.read(CommandDispatcher.response_struct_len).tostring()
145 def __dispatch_no_data(self, command): argument
151 self._ep_out.write(command)
153 retcode, datalen = self.__read_response()
158 def __dispatch_device_to_host(self, command): argument
164 self._ep_out.write(command)
166 retcode, datalen = self.__read_response()
171 resp = self._ep_in.read(int(datalen), timeout=CommandDispatcher.data_phase_timeout)
173 retcode, datalen = self.__read_response()
177 def __dispatch_host_to_device(self, command, data): argument
185 self._ep_out.write(command)
188 retcode, datalen = self.__read_response(CommandDispatcher.data_phase_timeout)
196 self._ep_out.write(data, timeout=CommandDispatcher.data_phase_timeout)
200 retcode, datalen = self.__read_response()
203 def dispatch(self, command, data=None): argument
221 result = self.__dispatch_no_data(command)
223 result = self.__dispatch_host_to_device(command, data)
225 result = self.__dispatch_device_to_host(command)