Lines Matching refs:dh
119 libusb_device_handle *dh = NULL; in canusb_findalldevs() local
121 if ((ret = libusb_open(devs[i],&dh)) == 0) in canusb_findalldevs()
125 int n = libusb_get_string_descriptor_ascii(dh,desc.iSerialNumber,sernum,64); in canusb_findalldevs()
131 libusb_close(dh); in canusb_findalldevs()
165 libusb_device_handle *dh = NULL; in canusb_opendevice() local
167 if (libusb_open(devs[i],&dh) != 0) continue; in canusb_opendevice()
169 n = libusb_get_string_descriptor_ascii(dh,desc.iSerialNumber,serial,64); in canusb_opendevice()
174 libusb_close(dh); in canusb_opendevice()
178 if ((libusb_kernel_driver_active(dh,0)) && (libusb_detach_kernel_driver(dh,0) != 0)) in canusb_opendevice()
180 libusb_close(dh); in canusb_opendevice()
184 if (libusb_set_configuration(dh,1) != 0) in canusb_opendevice()
186 libusb_close(dh); in canusb_opendevice()
190 if (libusb_claim_interface(dh,0) != 0) in canusb_opendevice()
192 libusb_close(dh); in canusb_opendevice()
198 return dh; in canusb_opendevice()