Lines Matching refs:dh
118 libusb_device_handle *dh = NULL;
120 if ((ret = libusb_open(devs[i],&dh)) == 0)
124 int n = libusb_get_string_descriptor_ascii(dh,desc.iSerialNumber,sernum,64);
130 libusb_close(dh);
164 libusb_device_handle *dh = NULL;
166 if (libusb_open(devs[i],&dh) != 0) continue;
168 n = libusb_get_string_descriptor_ascii(dh,desc.iSerialNumber,serial,64);
173 libusb_close(dh);
177 if ((libusb_kernel_driver_active(dh,0)) && (libusb_detach_kernel_driver(dh,0) != 0))
179 libusb_close(dh);
183 if (libusb_set_configuration(dh,1) != 0)
185 libusb_close(dh);
189 if (libusb_claim_interface(dh,0) != 0)
191 libusb_close(dh);
197 return dh;