Lines Matching refs:handle

71     WindowsUsbTransport(std::unique_ptr<usb_handle> handle) : handle_(std::move(handle)) {}  in WindowsUsbTransport()  argument
89 int recognized_device(usb_handle* handle, ifc_match_func callback);
95 void usb_cleanup_handle(usb_handle* handle);
98 void usb_kick(usb_handle* handle);
231 void usb_cleanup_handle(usb_handle* handle) { in usb_cleanup_handle() argument
232 if (NULL != handle) { in usb_cleanup_handle()
233 if (NULL != handle->adb_write_pipe) in usb_cleanup_handle()
234 AdbCloseHandle(handle->adb_write_pipe); in usb_cleanup_handle()
235 if (NULL != handle->adb_read_pipe) in usb_cleanup_handle()
236 AdbCloseHandle(handle->adb_read_pipe); in usb_cleanup_handle()
237 if (NULL != handle->adb_interface) in usb_cleanup_handle()
238 AdbCloseHandle(handle->adb_interface); in usb_cleanup_handle()
240 handle->interface_name.clear(); in usb_cleanup_handle()
241 handle->adb_write_pipe = NULL; in usb_cleanup_handle()
242 handle->adb_read_pipe = NULL; in usb_cleanup_handle()
243 handle->adb_interface = NULL; in usb_cleanup_handle()
247 void usb_kick(usb_handle* handle) { in usb_kick() argument
248 if (NULL != handle) { in usb_kick()
249 usb_cleanup_handle(handle); in usb_kick()
278 int recognized_device(usb_handle* handle, ifc_match_func callback) { in recognized_device() argument
283 if (NULL == handle) in recognized_device()
287 if (!AdbGetUsbDeviceDescriptor(handle->adb_interface, &device_desc)) { in recognized_device()
293 if (!AdbGetUsbInterfaceDescriptor(handle->adb_interface, &interf_desc)) { in recognized_device()
318 if (!AdbGetSerialNumber(handle->adb_interface, info.serial_number, in recognized_device()
338 std::unique_ptr<usb_handle> handle; in find_usb_device() local
365 handle = do_usb_open(next_interface->device_name); in find_usb_device()
366 if (NULL != handle) { in find_usb_device()
368 if (recognized_device(handle.get(), callback)) { in find_usb_device()
372 usb_cleanup_handle(handle.get()); in find_usb_device()
373 handle.reset(); in find_usb_device()
381 return handle; in find_usb_device()
385 std::unique_ptr<usb_handle> handle = find_usb_device(callback); in usb_open() local
386 return handle ? new WindowsUsbTransport(std::move(handle)) : nullptr; in usb_open()